Example #1
0
        private void CreateObjects()
        {
            DiningRoom = new Room("Dining Room", "a crystal chandelier and flowers");
            LivingRoom = new RoomWithDoor("Living room", "an antique carpet", "an oak door with a brass knob");
            Kitchen    = new RoomWithDoor("Kitchen", "Big Kitchen", "a screen door");
            FrontYard  = new OutsideWithDoor("FrontYard", false, "an oak door with a brass knob");
            BackYard   = new OutsideWithDoor("BackYard", true, "a screen door");
            garden     = new Outside("Garden", false);

            //Initialize Exits
            garden.Exits     = new Location[] { FrontYard, BackYard };
            DiningRoom.Exits = new Location[] { Kitchen, LivingRoom };
            LivingRoom.Exits = new Location[] { DiningRoom };
            Kitchen.Exits    = new Location[] { DiningRoom };
            FrontYard.Exits  = new Location[] { BackYard, garden };
            BackYard.Exits   = new Location[] { FrontYard, garden };

            //Initialize Doors
            FrontYard.DoorLocation  = LivingRoom;
            LivingRoom.DoorLocation = FrontYard;
            Kitchen.DoorLocation    = BackYard;
            BackYard.DoorLocation   = Kitchen;
        }
Example #2
0
        private void CreateObjects()
        {
            DiningRoom = new Room("Dining Room", "a crystal chandelier and flowers");
            LivingRoom = new RoomWithDoor("Living room", "an antique carpet", "an oak door with a brass knob");
            Kitchen = new RoomWithDoor("Kitchen", "Big Kitchen", "a screen door");
            FrontYard = new OutsideWithDoor("FrontYard", false, "an oak door with a brass knob");
            BackYard = new OutsideWithDoor("BackYard", true, "a screen door");
            garden = new Outside("Garden", false);

            //Initialize Exits
            garden.Exits = new Location[] { FrontYard, BackYard };
            DiningRoom.Exits = new Location[] { Kitchen, LivingRoom };
            LivingRoom.Exits = new Location[] { DiningRoom };
            Kitchen.Exits = new Location[] { DiningRoom };
            FrontYard.Exits = new Location[] { BackYard, garden };
            BackYard.Exits = new Location[] { FrontYard, garden };

            //Initialize Doors
            FrontYard.DoorLocation = LivingRoom;
            LivingRoom.DoorLocation = FrontYard;
            Kitchen.DoorLocation = BackYard;
            BackYard.DoorLocation = Kitchen;
        }