Ejemplo n.º 1
0
 private void FillRemainingRooms()
 {
     for (int row = 0; row < Height; row++)
     {
         for (int column = 0; column < Width; column++)
         {
             if (!(Rooms[row][column] is Entrance || Rooms[row][column] is Exit))
             {
                 Rooms[row][column] = new StandardRoom();
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void PlacePillars()
        {
            Random          rand     = new Random();
            DungeonPosition position = null;

            for (int pillarsPlaced = 0; pillarsPlaced < 4;)
            {
                position = new DungeonPosition(rand.Next(Width), rand.Next(Height));
                if (Rooms[position.Y][position.X] is StandardRoom)
                {
                    StandardRoom room = (StandardRoom)Rooms[position.Y][position.X];

                    if (!room.HasPillar)
                    {
                        room.HasPillar = true;
                        pillarsPlaced++;
                    }
                }
            }
        }