Example #1
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());
        }
Example #2
0
 private static void inventoryDemo()
 {
     /* INVENTORY TEST */
     Inventory inv = new Inventory(true);
     Item s = new Item("sword", "shiny");
     s.AutoGenSynonyms();
     inv.AddItem(s);
     Bucket b = new Bucket(3);
     inv.AddItem(b);
     Console.WriteLine(inv);
 }