Пример #1
0
        private void secondFloor(out Room hallwayWest, out Room hallwayEast)
        {
            Room myroom = new MyHotelRoom();
            Room myBathroom = new MyHotelRoomBathroom();
            Room myCloset = new Closet();

            this.StartingPoint = myroom;

            // connect room to bathroom
            myroom.ExitsHere.AddExit("e", "door", "leading to a small bathroom {0}", myBathroom);
            myBathroom.ExitsHere.AddExit("w", "door", "leading back into your hotel room {0}", myroom);

            // connect room to closet
            myroom.ExitsHere.AddExit("ne", "doorway", "leading to a small closet {0}", myCloset);
            myCloset.ExitsHere.AddExit("sw", "doorway", "leading back into your hotel room {0}", myroom);

            Room hallwayMid = new HallwayFloorTwoMid();

            // connect room to hallway
            myroom.ExitsHere.AddExit("n", "door", hallwayMid);
            hallwayMid.ExitsHere.AddExit("s", "door", myroom);

            hallwayWest = new HallwayFloorTwoWest();

            // connect mid <=> west hallways
            hallwayWest.ExitsHere.AddExit("e", null, "From here the hallway continues east.", hallwayMid);
            hallwayMid.ExitsHere.AddExit("w", null, "From here the hallway continues east and west.", hallwayWest);

            hallwayEast = new HallwayFloorTwoEast();

            // connect mid <=> east hallways
            hallwayMid.ExitsHere.AddExit("e", null, "From here the hallway continues east and west.", hallwayEast);
            hallwayEast.ExitsHere.AddExit("w", null, "From here the hallway continues west.", hallwayMid);
        }
Пример #2
0
        private static void verboseExitDemo()
        {
            Room myroom = new MyHotelRoom();
            Room myBathroom = new MyHotelRoomBathroom();

            // connect room to bathroom
            myroom.ExitsHere.AddExit("e", "doorway", "leading to a small bathroom", myBathroom);
            myBathroom.ExitsHere.AddExit("w", "doorway", "leading back into your hotel room", myroom);

            Room hallwayMid = new HallwayFloorTwoMid();

            // connect room to hallway
            myroom.ExitsHere.AddExit("n", "door", hallwayMid);
            hallwayMid.ExitsHere.AddExit("s", "door", myroom);

            Room hallwayWest = new HallwayFloorTwoWest();

            // connect mid <=> west hallways
            hallwayWest.ExitsHere.AddExit("e", null, "From here the hallway continues east.", hallwayMid);
            hallwayMid.ExitsHere.AddExit("w", null, "From here the hallway continues east and west.", hallwayWest);

            Console.WriteLine(hallwayMid.Look(true));
        }