Exemplo n.º 1
0
        private void PlaceEntrance()
        {
            DungeonPosition position = GetRandomExteriorPosition();

            EntranceLocation = position;
            Rooms[position.Y][position.X] = new Entrance();
        }
Exemplo n.º 2
0
        private void PlaceExit()
        {
            DungeonPosition position = GetRandomExteriorPosition();

            do
            {
                position = GetRandomExteriorPosition();
            } while (position.Equals(EntranceLocation));

            ExitLocation = position;
            Rooms[position.Y][position.X] = new Exit();
        }
Exemplo n.º 3
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++;
                    }
                }
            }
        }