Example #1
0
        private void CreateObjects()
        {
            livingRoom = new RoomWithDoor("Гостинная", "Старинный ковер", "Дубовая дверь с латунной ручкой");
            kitchen    = new RoomWithDoor("Кухня", "Плита из нержавеющей стали", "Сетчатая дверь");
            diningRoom = new Room("Столовая", "Хрустальная люстра");
            backYard   = new OutsideWithDoor("Задний двор", true, "Сетчатая дверь");
            frontYard  = new OutsideWithDoor("Лужайка", false, "Дубовая дверь с латунной ручкой");
            garden     = new Outside("Сад", false);

            livingRoom.exits = new Location[] { diningRoom };
            kitchen.exits    = new Location[] { diningRoom };
            diningRoom.exits = new Location[] { livingRoom, kitchen };
            backYard.exits   = new Location[] { frontYard, garden };
            frontYard.exits  = new Location[] { backYard, garden };
            garden.exits     = new Location[] { frontYard, backYard };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation  = livingRoom;

            kitchen.DoorLocation  = backYard;
            backYard.DoorLocation = kitchen;
        }
        private void CreateObjects()
        {
            livingRoom = new RoomWithDoor("Living room", "old carpet", "oak door with aeneous doornob");
            kitchen    = new RoomWithDoor("Kitchen", "hot plate made of stainless steel", "net door");
            diningRoom = new Room("Dining room", "cut-glass chandalier");

            frontYard = new OutsideWithDoor("Front yard", false, "oak door with aeneous doornob");
            backYard  = new OutsideWithDoor("Back yard", true, "net door");
            garden    = new Outside("Garden", false);

            livingRoom.Exits = new Location[] { diningRoom };
            kitchen.Exits    = new Location[] { diningRoom };
            diningRoom.Exits = new Location[] { kitchen, livingRoom };

            frontYard.Exits = new Location[] { backYard, garden };
            backYard.Exits  = new Location[] { frontYard, garden };
            garden.Exits    = new Location[] { frontYard, backYard };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation  = livingRoom;

            kitchen.DoorLocation  = backYard;
            backYard.DoorLocation = kitchen;
        }