Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public LightSwitch(Closet whereAmI)
            : base("lightswitch",
			    new List<string>() {
					"light",
					"switch",
					"light switch",
				})
        {
            this.CanPickUp = false;
            this.actionMessages.Add("read", readString);
            this.actionMessages.Add("look", lookString);
            this.parent = whereAmI;
        }
Ejemplo n.º 3
0
        private static void roomDemo()
        {
            /* ROOM TEST */
            Inventory inv = new Inventory(false);
            Item f;
            f = new Item("flask", "blue");
            inv.AddItem(f);
            f = new Item("eel", "electric");
            inv.AddItem(f);
            f = new Item("sword");
            inv.AddItem(f);

            Inventory invb = new Inventory(false);
            f = new Item("broom");
            invb.AddItem(f);
            f = new Item("bucket");
            invb.AddItem(f);

            Room foo = new Room("Test Chamber",
                "This is a small chamber. In the dim light you can see the walls "+
                "expand and contract as if they were unstable. If you strain your "+
                "ears you can just barely hear someone typing furiously on a keyboard.",
                inv
            );
            Closet bar = new Closet("Test Closet",
                "It is too dark to see.",
                "You are standing in a small broom closet.",
                invb
            );

            foo.Exits.AddExit("n", "doorway", bar);
            foo.Exits.AddExit("u", "ladder", foo);
            foo.Exits.AddExit("d", "ladder", foo);
            foo.Exits.AddExit("s", foo);

            Console.WriteLine("Entering room...");
            Console.WriteLine(foo.EnterRoom());
            Console.WriteLine("Entering room again...");
            Console.WriteLine(foo.EnterRoom());

            Console.WriteLine("Entering closet...");
            Console.WriteLine(bar.EnterRoom());

            Console.WriteLine("Let there be light...");
            Console.WriteLine(bar.TurnOnLight());
            Console.WriteLine(bar.Look());
        }