Esempio n. 1
0
        private static Map GetStaticMap()
        {
            Room[,] rooms = new Room[3, 3];
            for (int x = 0; x < rooms.GetLength(0); x++)
                for (int y = 0; y < rooms.GetLength(1); y++)
                    rooms[x, y] = new Room(new Point(x, y));

            rooms[0, 0].SouthExit = new Exit(Directions.South);
            rooms[0, 0].EastExit = new Exit(Directions.East);

            rooms[1, 0].WestExit = new Exit(Directions.West);
            rooms[1, 0].EastExit = new Exit(Directions.East);

            rooms[2, 0].WestExit = new Exit(Directions.West);
            rooms[2, 0].SouthExit = new Exit(Directions.South);

            rooms[0, 1].NorthExit = new Exit(Directions.North);
            rooms[0, 1].EastExit = new Exit(Directions.East);
            rooms[0, 1].SouthExit = new Exit(Directions.South);

            rooms[0, 2].NorthExit = new Exit(Directions.North);
            rooms[0, 2].EastExit = new Exit(Directions.East);

            rooms[1, 1].WestExit = new Exit(Directions.West);

            rooms[1, 2].WestExit = new Exit(Directions.West);
            rooms[1, 2].EastExit = new Exit(Directions.East);

            rooms[2, 1].NorthExit = new Exit(Directions.North);
            rooms[2, 1].SouthExit = new Exit(Directions.South);

            rooms[2, 2].NorthExit = new Exit(Directions.North);
            rooms[2, 2].WestExit = new Exit(Directions.West);

            return new Map(rooms);
        }