Exemple #1
0
        public void CreateObjects()
        {
            stairs          = new Room("Stairs", "wooden bannister");
            upstairsHallway = new RoomWithHidingPlace("Upstairs Hallway", "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 bed", "under the bed");
            bathroom        = new RoomWithHidingPlace("Bathroom", "a sink an a toilet", "in the shower");
            livingRoom      = new RoomWithDoor("Living Room", "antique carpet", "an oak door with a brass knob", "under the carpet");
            diningRoom      = new RoomWithHidingPlace("Dining Room", "crystal chandelier", "on the chandelier");
            kitchen         = new RoomWithDoor("Kitchen", "stainless steel appliances", "a screen door", "on the fridge");

            frontYard = new OutsideWithDoor("Front Yard", false, "a heavy-looking oak door");
            backYard  = new OutsideWithDoor("Back Yard", true, "a screen door");
            garden    = new OutsideWithHidingPlace("Garden", false, "in the shed");
            driveway  = new OutsideWithHidingPlace("Driveway", false, "behind the garage");

            stairs.Exits          = new Location[] { livingRoom, upstairsHallway };
            upstairsHallway.Exits = new Location[] { masterBedroom, secondBedroom, bathroom, stairs };
            bathroom.Exits        = new Location[] { upstairsHallway };
            masterBedroom.Exits   = new Location[] { upstairsHallway };
            secondBedroom.Exits   = new Location[] { upstairsHallway };
            diningRoom.Exits      = new Location[] { livingRoom, kitchen };
            livingRoom.Exits      = new Location[] { frontYard, stairs };
            kitchen.Exits         = new Location[] { diningRoom };
            frontYard.Exits       = new Location[] { backYard, garden, driveway };
            backYard.Exits        = new Location[] { kitchen, frontYard, driveway };
            garden.Exits          = new Location[] { frontYard, backYard };
            driveway.Exits        = new Location[] { frontYard, backYard };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation  = livingRoom;
            kitchen.DoorLocation    = diningRoom;
            backYard.DoorLocation   = kitchen;
        }
Exemple #2
0
        private void CreateObjects()
        {
            livingRoom    = new RoomWithDoor("Living room", "Antic carpet", "wardrobe", "Wooden door");
            diningRoom    = new Room("Dinning room", "Crystal chandelier");
            kitchen       = new RoomWithDoor("Kitchen", "steel cutlery", "cupboard", "steel door");
            stairs        = new Room("Stairs", "wooden handrail");
            hallway       = new RoomWithHidingPlace("Hallway 1st floor", "long carpet", "wardrobe");
            bathroom      = new RoomWithHidingPlace("Bathroom", "amazing bath", "curtain");
            masterBedroom = new RoomWithHidingPlace("Bedroom", "big bed", "bed");
            secondBedroom = new RoomWithHidingPlace("Second Bedroom", "second big bed", "second bed");

            driveway  = new OutsideWithHidingPlace("Road", true, "garage");
            garden    = new OutsideWithHidingPlace("Garden", false, "shed");
            frontYard = new OutsideWithDoor("Front yard", false, "Wooden door");
            backYard  = new OutsideWithDoor("Back yard", true, "steel door");


            diningRoom.Exits    = new Location[] { livingRoom, kitchen };
            livingRoom.Exits    = new Location[] { diningRoom };
            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 };
            backYard.Exits  = new Location[] { frontYard, garden };
            garden.Exits    = new Location[] { backYard, frontYard };
            driveway.Exits  = new Location[] { backYard, frontYard };

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

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