Ejemplo n.º 1
0
 /// <summary>
 ///     Carga todos los valores en base a la información del Room
 /// </summary>
 public void fillRoomData(RoomsEditorRoom room)
 {
     updateUiData(mapView.selectedRoom.Walls[0], roofImage, roofAutoUv, roofUTile, roofVTile);
     updateUiData(mapView.selectedRoom.Walls[1], floorImage, floorAutoUv, floorUTile, floorVTile);
     updateUiData(mapView.selectedRoom.Walls[2], eastWallImage, eastWallAutoUv, eastWallUTile, eastWallVTile);
     updateUiData(mapView.selectedRoom.Walls[3], westWallImage, westWallAutoUv, westWallUTile, westWallVTile);
     updateUiData(mapView.selectedRoom.Walls[4], northWallImage, northWallAutoUv, northWallUTile, northWallVTile);
     updateUiData(mapView.selectedRoom.Walls[5], southWallImage, southWallAutoUv, southWallUTile, southWallVTile);
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Crea un nuevo Room y lo agrega al panel2D
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pos"></param>
        public RoomsEditorRoom createRoom(string name, Point pos, Size size)
        {
            var rPanel = new RoomPanel(name, this, pos, size);
            var room   = new RoomsEditorRoom(name, rPanel);

            Rooms.Add(room);

            panel2d.Controls.Add(room.RoomPanel.Label);

            return(room);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Chequea colision con otros rooms.
        ///     Devuelve el room contra el cual colisiono o null
        /// </summary>
        internal RoomsEditorRoom testRoomPanelCollision(RoomsEditorRoom room, Rectangle testRect)
        {
            foreach (var r in Rooms)
            {
                if (r != room)
                {
                    if (r.RoomPanel.Label.Bounds.IntersectsWith(testRect))
                    {
                        return(r);
                    }
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
        public RoomsEditorWall(RoomsEditorRoom room, string name, Types type)
        {
            this.room         = room;
            this.type         = type;
            Name              = name;
            WallSegments      = new List <TgcPlane>();
            IntersectingRooms = new List <RoomsEditorRoom>();

            //cargar valores default de la pared
            Texture = TgcTexture.createTexture(D3DDevice.Instance.Device,
                                               room.RoomPanel.mapView.defaultTextureImage);
            AutoAdjustUv = true;
            UTile        = 1f;
            VTile        = 1f;

            switch (type)
            {
            case Types.Roof:
                Normal = TGCVector3.Down;
                break;

            case Types.Floor:
                Normal = TGCVector3.Up;
                break;

            case Types.East:
                Normal = new TGCVector3(-1, 0, 0);
                break;

            case Types.West:
                Normal = new TGCVector3(1, 0, 0);
                break;

            case Types.North:
                Normal = new TGCVector3(0, 0, -1);
                break;

            case Types.South:
                Normal = new TGCVector3(0, 0, 1);
                break;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Seleccionar un cuarto
        /// </summary>
        private void selectRoom(RoomsEditorRoom room)
        {
            if (selectedRoom != null)
            {
                selectedRoom.RoomPanel.setRoomSelected(false);
            }

            selectedRoom = room;
            selectedRoom.RoomPanel.setRoomSelected(true);
            groupBoxEditRoom.Enabled = true;

            //Cargar datos de edicion del Room
            textBoxRoomName.Text              = selectedRoom.Name;
            numericUpDownRoomPosX.Value       = selectedRoom.RoomPanel.Label.Location.X;
            numericUpDownRoomPosY.Value       = selectedRoom.RoomPanel.Label.Location.Y;
            numericUpDownRoomWidth.Value      = selectedRoom.RoomPanel.Label.Width;
            numericUpDownRoomLength.Value     = selectedRoom.RoomPanel.Label.Height;
            numericUpDownRoomHeight.Value     = selectedRoom.Height;
            numericUpDownRoomFloorLevel.Value = selectedRoom.FloorLevel;
        }
Ejemplo n.º 6
0
 /// <summary>
 ///     Eliminar un room
 /// </summary>
 internal void deleteRoom(RoomsEditorRoom room)
 {
     Rooms.Remove(room);
     panel2d.Controls.Remove(room.RoomPanel.Label);
 }