Esempio n. 1
0
        public PortalTemplate(XmlNode xmlNode)
        {
            int pixel_x     = Int32.Parse(xmlNode.Attributes["x"].Value);
            int pixel_y     = Int32.Parse(xmlNode.Attributes["y"].Value);
            int pixel_width =
                (xmlNode.Attributes["width"] != null)
                ? Int32.Parse(xmlNode.Attributes["width"].Value)
                : (int)GameConstants.TILE_PIXEL_SIZE;
            int pixel_height =
                (xmlNode.Attributes["height"] != null)
                ? Int32.Parse(xmlNode.Attributes["height"].Value)
                : (int)GameConstants.TILE_PIXEL_SIZE;

            Point3d position0 = GameConstants.ConvertPixelPositionToRoomPosition(pixel_x, pixel_y);
            Point3d position1 = GameConstants.ConvertPixelPositionToRoomPosition(pixel_x + pixel_width, pixel_y + pixel_height);

            portal_id = Int32.Parse(xmlNode.Attributes["id"].Value);

            bounding_box =
                new AABB3d(
                    Point3d.Min(position0, position1),
                    Point3d.Max(position0, position1));

            roomSide = (MathConstants.eSignedDirection)Enum.Parse(typeof(MathConstants.eSignedDirection), xmlNode.Attributes["Direction"].Value);

            portal_type = (ePortalType)Enum.Parse(typeof(ePortalType), xmlNode.Attributes["Type"].Value);
        }
Esempio n. 2
0
 public Portal()
 {
     portal_id= -1;
     target_portal_id = -1;
     room_x= 0;
     room_y= 0;
     room_z= 0;
     portal_type = ePortalType.door;
     room_side = MathConstants.eSignedDirection.positive_x;
     bounding_box = new AABB3d();
 }
Esempio n. 3
0
        public AABB3d bounding_box; // Room Relative

        public Portal()
        {
            portal_id        = -1;
            target_portal_id = -1;
            room_x           = 0;
            room_y           = 0;
            room_z           = 0;
            portal_type      = ePortalType.door;
            room_side        = MathConstants.eSignedDirection.positive_x;
            bounding_box     = new AABB3d();
        }
Esempio n. 4
0
        public PortalTemplate(XmlNode xmlNode)
        {
            int pixel_x = Int32.Parse(xmlNode.Attributes["x"].Value);
            int pixel_y = Int32.Parse(xmlNode.Attributes["y"].Value);
            int pixel_width =
                (xmlNode.Attributes["width"] != null)
                ? Int32.Parse(xmlNode.Attributes["width"].Value)
                : (int)GameConstants.TILE_PIXEL_SIZE;
            int pixel_height =
                (xmlNode.Attributes["height"] != null)
                ? Int32.Parse(xmlNode.Attributes["height"].Value)
                : (int)GameConstants.TILE_PIXEL_SIZE;

            Point3d position0 = GameConstants.ConvertPixelPositionToRoomPosition(pixel_x, pixel_y);
            Point3d position1 = GameConstants.ConvertPixelPositionToRoomPosition(pixel_x + pixel_width, pixel_y + pixel_height);

            portal_id = Int32.Parse(xmlNode.Attributes["id"].Value);

            bounding_box =
                new AABB3d(
                    Point3d.Min(position0, position1),
                    Point3d.Max(position0, position1));

            roomSide = (MathConstants.eSignedDirection)Enum.Parse(typeof(MathConstants.eSignedDirection), xmlNode.Attributes["Direction"].Value);

            portal_type = (ePortalType)Enum.Parse(typeof(ePortalType), xmlNode.Attributes["Type"].Value);
        }