Esempio n. 1
0
 private void runGame()
 {
     this.startGame();
     this.layout = new RoomLayout();
     Globals.CurrentGlobals.CurrentPlayer.CurrentRoom = this.layout.StartingPoint;
     this.shell = new Shell();
     this.shell.FirstShell();
     while (!this.shell.WantsQuit && !this.shell.WantsRestart) {
         this.shell.DoShell();
     }
     if (this.shell.WantsRestart) {
         // do it again
         this.runGame();
     }
 }
Esempio n. 2
0
        private static void movementDemo()
        {
            Inventory plr = new Inventory(true, new List<Item>() {
                new Bucket(3),
                new Bucket(5),
            });

            RoomLayout rms = new RoomLayout();

            string[] cmds = new string[] {
                //"n",
                //"e",
                //"go n",
                //"look",
                //"search",
                //"pick",
                //"take",
                //"steal",
                "take small bucket",
            };
            Console.WriteLine(rms.StartingPoint.ToString());
            List<Item> it;
            string[] ve;
            foreach (string c in cmds) {
                ve = Commands.GetCommandVerb(c);
                it = Commands.GetCommandItems(c,rms.StartingPoint, plr);
                Console.WriteLine("in: {0}", c);
                if (ve != null) {
                    Console.WriteLine("  verb: {0} ({1})", ve[0], ve[1]);
                } else {
                    Console.WriteLine("  (unrecognized verb)");
                }
                if (it.Count > 0) {
                    Console.WriteLine("  item: {0}", it[0]);
                } else {
                    Console.WriteLine("  (unrecognized item)");
                }
            }
        }