Esempio n. 1
0
        public void InitializeGame()
        {
            // inside
            diningRoom    = new Room("Dining Room", "a crystal chandelier");
            stairs        = new Room("Stairs", "a wooden bannister");
            kitchen       = new RoomWithDoor("Kitchen", "stainless steel appliances", "on top of fridge", "screen door");
            livingRoom    = new RoomWithDoor("Living Room", "an antique carpet", "under the sofa", "an oak door with a brass knob");
            hallway       = new RoomWithHidingPlace("Upstairs hallway", "a picture of a dog", "in the closet");
            masterBedroom = new RoomWithHidingPlace("Master Bedroom", "a large bed", "under the bed");
            secondBedroom = new RoomWithHidingPlace("Second Bedroom", "a small bad", "under the bed");
            bathroom      = new RoomWithHidingPlace("Bathroom", "a sink and a toilette", "in the shower");

            // outside
            frontYard = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            backYard  = new OutsideWithDoor("Back Yard", true, "screen door");
            garden    = new OutsideWithHidingPlace("Garden", false, "in the sheed");
            driveaway = new OutsideWithHidingPlace("Driveaway", false, "in the garage");

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

            kitchen.Exits        = new Location[] { diningRoom };
            kitchen.DoorLocation = backYard;

            livingRoom.Exits        = new Location[] { diningRoom, stairs };
            livingRoom.DoorLocation = frontYard;

            stairs.Exits        = new Location[] { livingRoom, hallway };
            hallway.Exits       = new Location[] { stairs, bathroom, masterBedroom, secondBedroom };
            bathroom.Exits      = new Location[] { hallway };
            masterBedroom.Exits = new Location[] { hallway };
            secondBedroom.Exits = new Location[] { hallway };

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

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

            backYard.Exits        = new Location[] { garden, frontYard, driveaway };
            backYard.DoorLocation = kitchen;
        }
Esempio n. 2
0
 private void CreateObjects()
 {
     livingRoom = new RoomWithDoor("Гостиная", "старинный ковер",
                                   "в гардеробе", "дубовая дверь с латунной ручкой");
     diningRoom = new RoomWithHidingPlace("Столовая", "хрустальная люстра",
                                          "в высоком шкафу");
     kitchen = new RoomWithDoor("Кухня", "приборы из нержавеющей стали",
                                "в сундуке", "сетчатая дверь");
     stairs  = new Room("Лестница", "деревянные перила");
     hallway = new RoomWithHidingPlace("Верхний коридор", "картина с собакой",
                                       "в гардеробе");
     bathroom = new RoomWithHidingPlace("Ванная", "раковина и туалет",
                                        "в душе");
     masterBedroom = new RoomWithHidingPlace("Главная спальня", "большая кровать",
                                             "под кроватью");
     secondBedroom = new RoomWithHidingPlace("Вторая спальня", "маленькая кровать",
                                             "под кроватью");
     frontYard               = new OutsideWithDoor("лужайка", false, "тяжелая дубовая дверь");
     backYard                = new OutsideWithDoor("Задний двор", true, "сетчатая дверь");
     garden                  = new OutsideWithHidingPlace("Сад", false, "в сарае");
     driveway                = new OutsideWithHidingPlace("Подъезд", true, "в гараже");
     diningRoom.Exits        = new Location[] { livingRoom, kitchen };
     livingRoom.Exits        = new Location[] { diningRoom, stairs };
     kitchen.Exits           = new Location[] { diningRoom };
     stairs.Exits            = new Location[] { livingRoom, hallway };
     hallway.Exits           = new Location[] { stairs, bathroom, masterBedroom, secondBedroom };
     bathroom.Exits          = new Location[] { hallway };
     masterBedroom.Exits     = new Location[] { hallway };
     secondBedroom.Exits     = new Location[] { hallway };
     frontYard.Exits         = new Location[] { backYard, garden, driveway };
     backYard.Exits          = new Location[] { frontYard, garden, driveway };
     garden.Exits            = new Location[] { backYard, frontYard };
     driveway.Exits          = new Location[] { backYard, frontYard };
     livingRoom.DoorLocation = frontYard;
     frontYard.DoorLocation  = livingRoom;
     kitchen.DoorLocation    = backYard;
     backYard.DoorLocation   = kitchen;
 }