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

            frontYard.Exits = new Location[2] {
                livingRoom, garden
            };
            livingRoom.Exits = new Location[2] {
                frontYard, diningRoom
            };
            diningRoom.Exits = new Location[2] {
                livingRoom, kitchen
            };
            kitchen.Exits = new Location[2] {
                diningRoom, backYard
            };
            backYard.Exits = new Location[2] {
                kitchen, garden
            };
            garden.Exits = new Location[2] {
                frontYard, backYard
            };
        }
Beispiel #2
0
 private void CreateObjects()
 {
     livingRoom = new RoomWithDoor("an antique carpet", "Living Room",
     "an oak door with a brass knob");
     diningRoom = new Room( "a crystal chandelier","Dining Room");
     kitchen = new RoomWithDoor("stainless steel appliances", "Kitchen", "a screen door");
     frontYard = new OutsideWithDoor(false, "Front Yard", "an oak door with a brass knob");
     backYard = new OutsideWithDoor(true, "Back Yard", "a screen door");
     garden = new Outside(false,"Garden");
     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.location = frontYard;
     frontYard.location= livingRoom;
     kitchen.location = backYard;
     backYard.location = kitchen;
 }
Beispiel #3
0
        public void CreateObjects()
        {
            _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);
            _livingRoom = new RoomWithDoor("Living Room", "Antique Carpet", "An Oak Door With A Brass Knob");
            _kitchen    = new RoomWithDoor("Kitchen", "Stainless Steel appliances", "A Screen Door");
            _diningRoom = new Room("Dining Room", "Crystal Chandelier");

            _frontYard.Exits  = new Location[] { _backYard, _garden };
            _backYard.Exits   = new Location[] { _frontYard, _garden };
            _garden.Exits     = new Location[] { _frontYard, _backYard };
            _livingRoom.Exits = new Location[] { _diningRoom };
            _kitchen.Exits    = new Location[] { _diningRoom };
            _diningRoom.Exits = new Location[] { _livingRoom, _kitchen };

            _frontYard.DoorLocation  = _livingRoom;
            _livingRoom.DoorLocation = _frontYard;
            _backYard.DoorLocation   = _kitchen;
            _kitchen.DoorLocation    = _backYard;
        }
Beispiel #4
0
        private void CreateLocations()
        {
            livingRoom = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob");
            diningRoom = new Room("Dining Room", "a chrystal chandelier");
            kitchen = new RoomWithDoor("Kitchen", "stainles steel appliances", "a screen door");

            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);

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

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

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation = livingRoom;
            kitchen.DoorLocation = backYard;
            backYard.DoorLocation = kitchen;
        }