Пример #1
0
        public void TestPart1()
        {
            Room            diningRoom = new Room("Dining Room", "a crystal chandelier");
            RoomWithDoor    kitchen    = new RoomWithDoor("Kitchen", "stainless steel appliances", "screen door");
            RoomWithDoor    livingRoom = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob");
            Outside         garden     = new Outside("Garden", false);
            OutsideWithDoor frontYard  = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            OutsideWithDoor backYard   = new OutsideWithDoor("Back Yard", true, "screen door");

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

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

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

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

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

            backYard.Exits        = new Location[] { garden, frontYard };
            backYard.DoorLocation = kitchen;
        }
Пример #2
0
        private void InitializeRoom()
        {
            diningRoom = new Room("Dining Room", "a crystal chandelier");
            kitchen    = new RoomWithDoor("Kitchen", "stainless steel appliances", "screen door");
            livingRoom = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob");
            garden     = new Outside("Garden", false);
            frontYard  = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            backYard   = new OutsideWithDoor("Back Yard", true, "screen door");

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

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

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

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

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

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

            houseMove = new HouseMove(diningRoom);
        }
Пример #3
0
        private void 建立所有區域()
        {
            客廳 = new RoomWithDoor("豪華的客廳", "65吋大電視,豪華大沙發", "可以通往前院的門");
            餐廳 = new Room("溫馨的餐廳", "大餐桌,烤箱,大冰箱");
            廚房 = new RoomWithDoor("實用的廚房", "爐子,微波爐,洗碗機", "可以通往後院的門");
            前院 = new OutsideWithDoor("前院", true, "可以回客廳的門");
            後院 = new OutsideWithDoor("後院", true, "可以回廚房的門");
            花圃 = new Outside("美麗的花園", true);



            客廳.Exits        = new Location[] { 前院, 餐廳 };
            客廳.DoorLocation = 前院;
            餐廳.Exits        = new Location[] { 客廳, 廚房 };
            廚房.Exits        = new Location[] { 後院, 餐廳 };
            廚房.DoorLocation = 後院;

            前院.Exits        = new Location[] { 客廳, 花圃 };
            前院.DoorLocation = 客廳;

            後院.Exits        = new Location[] { 廚房, 花圃 };
            後院.DoorLocation = 廚房;

            花圃.Exits = new Location[] { 前院, 後院 };
        }
Пример #4
0
        private static void CreateObjects()
        {
            DiningRoom    = new Room("Jadalnia", "Błyszczący żyrandol");
            Garden        = new OutsideWithHidingLocation("Ogród", false, "Na drzewie");
            Frontyard     = new OutsideWithDoor("Podwórze frontowe", true, "Małe ze sklejki bez zamka", "W żywopłocie");
            Backyard      = new OutsideWithDoor("Podwórze z tyłu", true, "Wielkie dębowe z mosiężną klamką", "Za płotem");
            Kitchen       = new RoomWithDoor("Kuchnia", "Nierdzerwne błyszczące sztucznie  i ", "Małe ze sklejki bez zamka", "w szafie ściennej");
            LivingRoom    = new RoomWithDoor("Salon", "Dywan perski", "Wielkie dębowe z mosiężną klamką", "za łóżkiem");
            Stairs        = new Room("Schody", "Drewniania poręcz");
            Hallway       = new RoomWithHidingPlace("Korytarz", "Obrazek z psem", "W szafie ściennej");
            MasterBedroom = new RoomWithHidingPlace("Duża sypalnia", "Duże łóżko", "Pod łóżkiem");
            SecondBedroom = new RoomWithHidingPlace("Druga sypalnia", "Małe łóżko", "Pod łóżkiem");
            Bathroom      = new RoomWithHidingPlace("Łazienka", "Umywalka i toaleta", "Pod  prysznicem");
            DriveWay      = new OutsideWithHidingLocation("Droga dojazdowa", true, "W garażu");

            myOpponent = new Opponent(Frontyard);


            Garden.Exits     = new Location[] { Frontyard, Backyard };
            Frontyard.Exits  = new Location[] { Garden, LivingRoom };
            Backyard.Exits   = new Location[] { Kitchen, Garden };
            Kitchen.Exits    = new Location[] { Backyard, DiningRoom };
            DiningRoom.Exits = new Location[] { Kitchen, LivingRoom };
            LivingRoom.Exits = new Location[] { DiningRoom, Frontyard };
            Stairs.Exits     = new Location[] { LivingRoom, Hallway };
            Hallway.Exits    = new Location[] { MasterBedroom, SecondBedroom, Bathroom };

            Frontyard.DoorLocation  = LivingRoom;
            LivingRoom.DoorLocation = Frontyard;

            Backyard.DoorLocation = Kitchen;
            Kitchen.DoorLocation  = Backyard;
        }
        private void 建立所有區域()
        {
            //create first floor
            //客廳 = new RoomWithDoor("豪華的客廳", "65吋大電視,豪華大沙發", "可以通往前院的門");
            //建立有樓梯的客廳
            客廳 = new RoomWithDoorAndStair("豪華的客廳", "65吋大電視,豪華大沙發", "可以通往前院的門", "可以通往二樓的樓梯");
            餐廳 = new Room("溫馨的餐廳","大餐桌,烤箱,大冰箱");
            廚房 = new RoomWithDoor("實用的廚房", "爐子,微波爐,洗碗機", "可以通往後院的門");
            前院 = new OutsideWithDoor("前院", true, "可以回客廳的門");
            後院 = new OutsideWithDoor("後院", true, "可以回廚房的門");
            花圃 = new Outside("美麗的花園",true);

            //create second floor
            主臥室 = new RoomWithDoor("豪華的主臥室", "65吋大電視,豪華大床", "可以通往前陽台的門");
            主臥浴室 = new Room("主臥的浴室", "大浴缸");
            客人浴室 = new Room("客人的浴室", "淋浴間");
            書房 = new Room("工作用書房", "電腦很多台");
            前陽台 = new OutsideWithDoor("前陽台", true, "可以回主臥室的門");
            後陽台 = new OutsideWithDoor("後陽台", true, "可以回走道的門");
            空中花園 = new Outside("美麗的空中花園", true);
            //走道 = new AisleWithDoor("二樓走道", "壁掛繪畫作裝飾", "可以通往後陽台的門");
            //建立有樓梯的走道
            走道 = new AisleWithDoorAndStair("二樓走道", "壁掛繪畫作裝飾", "可以通往後陽台的門", "可以通往一樓的樓梯");

            //一樓布局
            客廳.Exits = new Location[] { 前院, 餐廳, 走道 };
            客廳.DoorLocation = 前院;
            客廳.StairLocation = 走道;
            餐廳.Exits = new Location[] { 客廳, 廚房 };
            廚房.Exits = new Location[] { 後院, 餐廳 };
            廚房.DoorLocation = 後院;

            前院.Exits = new Location[] { 客廳, 花圃 };
            前院.DoorLocation = 客廳;

            後院.Exits = new Location[] { 廚房, 花圃 };
            後院.DoorLocation = 廚房;

            花圃.Exits = new Location[] { 前院, 後院 };

            //二樓布局
            主臥室.Exits = new Location[] { 前陽台, 主臥浴室, 走道 };
            主臥室.DoorLocation = 前陽台;
            主臥浴室.Exits = new Location[] { 主臥室 };
            書房.Exits = new Location[] { 走道 };
            客人浴室.Exits = new Location[] { 走道 };
            走道.Exits = new Location[] { 主臥室, 客廳, 書房, 客人浴室, 後陽台 };
            走道.DoorLocation = 後陽台;
            走道.StairLocation = 客廳;

            前陽台.Exits = new Location[] { 主臥室, 空中花園 };
            前陽台.DoorLocation = 主臥室;

            後陽台.Exits = new Location[] { 走道, 空中花園 };
            後陽台.DoorLocation = 走道;

            空中花園.Exits = new Location[] { 前陽台, 後陽台 };
        }
Пример #6
0
 private void CreateObjects()
 {
     livingRoom              = new RoomWithDoor("Гостиная", "старинный ковер", "дубовая дверь с латунной ручкой");
     diningRoom              = new Room("Столовая", "хрустальная люстра");
     kitchen                 = new RoomWithDoor("Кухня", "плита из нержавеющей стали", "сетчатая дверь");
     frontYard               = new OutsideWithDoor("лужайка", false, "дубовая дверь с латунной ручкой");
     backYard                = new OutsideWithDoor("Задний двор", true, "сетчатая дверь");
     garden                  = new Outside("Сад", false);
     diningRoom.Exits        = new Location[] { livingRoom, kitchen };
     livingRoom.Exits        = new Location[] { diningRoom };
     kitchen.Exits           = new Location[] { diningRoom };
     frontYard.Exits         = new Location[] { backYard, garden };
     backYard.Exits          = new Location[] { frontYard, garden };
     garden.Exits            = new Location[] { backYard, frontYard };
     livingRoom.DoorLocation = frontYard;
     frontYard.DoorLocation  = livingRoom;
     kitchen.DoorLocation    = backYard;
     backYard.DoorLocation   = kitchen;
 }
Пример #7
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;
        }
Пример #8
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;
 }
Пример #9
0
        private void CreateObjects()
        {
            livingRoom  = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob");
            kitchen     = new RoomWithDoor("Kitchen", "stainless steel apliances", "a screen door");
            dinningRoom = new Room("Dinning Room", "a crystal chandelier");

            frontYard = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            backYard  = new OutsideWithDoor("Back Yard", true, "a screen door");
            garden    = new Outside("Garden", false);

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

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

            kitchen.DoorLocation  = backYard;
            backYard.DoorLocation = kitchen;
        }
        /*
            CHAMADA AO METODO 'MoveToANewLocation' MOVIDA
            PARA O CONTRUTOR DO FORMULÁRIO E EFETUADO A
            DECLARAÇÃO DAS VARIAVEIS DE FORMA GLOBAL.

            OBS.: AS DUAS FORMAS FUNCIONAM, POREM A CHAMADA
            DO METODO 'MoveToANewLocation' DENTRO DO METODO
            'CreateObject' FERE A REAL FUNÇÃO DO METODO
            'CreateObject'.
        */
        //private void CreateObject()
        //{
        //    OutsideWithDoor frontYard = new OutsideWithDoor("Quintal da Frente", true, "Porta de madeira com tetra chave");
        //    Outside garden = new Outside("Jardim", false);
        //    OutsideWithDoor backYard = new OutsideWithDoor("Quintal dos Fundos", true, "Porta de ferro com tela");
        //    RoomWithDoor livingRoom = new RoomWithDoor("Sala de Estar", " um tapete antigo ", "Porta de madeira com tetra chave");
        //    Room dinningRoom = new Room("Sala de Jantar", " um quadro, uma mesa de 6 lugares, na mesa tem um castiçal");
        //    RoomWithDoor kitchen = new RoomWithDoor("Cozinha", " um pinquin de geladeira", "Porta de ferro com tela");
        //    frontYard.Exits = new Location[] { garden, livingRoom };
        //    frontYard.DoorLocation = livingRoom;
        //    garden.Exits = new Location[] { frontYard, backYard };
        //    backYard.Exits = new Location[] { garden, kitchen };
        //    backYard.DoorLocation = kitchen;
        //    livingRoom.Exits = new Location[] { frontYard, dinningRoom};
        //    livingRoom.DoorLocation = frontYard;
        //    dinningRoom.Exits = new Location[] { livingRoom, kitchen };
        //    kitchen.Exits = new Location[] { dinningRoom, backYard };
        //    kitchen.DoorLocation = backYard;
        //    MoveToANewLocation(livingRoom);
        //}
        private void CreateObject()
        {
            frontYard = new OutsideWithDoor("Quintal da Frente", true, "Porta de madeira com tetra chave");
            garden = new Outside("Jardim", false);
            backYard = new OutsideWithDoor("Quintal dos Fundos", true, "Porta de ferro com tela");

            livingRoom = new RoomWithDoor("Sala de Estar", " um tapete antigo ", "Porta de madeira com tetra chave");
            dinningRoom = new Room("Sala de Jantar", " um quadro, uma mesa de 6 lugares, na mesa tem um castiçal");
            kitchen = new RoomWithDoor("Cozinha", " um pinquin de geladeira", "Porta de ferro com tela");

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

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

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

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

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

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