示例#1
0
        private void createLocations()
        {
            startUp =
                new Location("an office with paper strewn everywhere, how anyone works effectively here is a mystery",
                    "Julies Office");
            Location lounge =
                new Location("an open space containing comfortable looking couches and artwork of dubious quality",
                    "Airport Lounge");
            Shop shop = new Shop("Some shop", "Shop");
            Location t127 = new Location("a lecture theatre", "T127");
            Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office");

            startUp.AddExit("south", new Exit("you see an open space to the south", lounge));
            lounge.AddExit("north", new Exit("you see a mound of paper to the north", startUp));
            startUp.AddExit("east", new Exit("you see a shop in the east", shop));
            shop.AddExit("west", new Exit("you see a mound of paper to the west", startUp));

            Key gregKey = new Key(10, 5, "Key Greg's office");
            Key dummyKey = new Key(5, 5, "Dumb key");
            shop.Items.Add("gregkey", gregKey);
            shop.Items.Add("dummykey", dummyKey);

            startUp.AddExit("west", new Exit("you see a terrifying office to the west", gregsoffice));
            gregsoffice.AddExit("east", new Exit("you see a mound of paper to the east", startUp));

            t127.AddExit("south", new Exit("you see a mound of paper to the south", startUp));
            startUp.AddExit("north", new Exit("you see a bleak place to the north", t127));

            lounge.AddExit("northwest", new Exit("you see a terrifying office to the northwest", gregsoffice));
            gregsoffice.AddExit("southeast", new Exit("you see an open space to the southeast", lounge));

            gregsoffice.Locked = true;
            gregKey.Location = gregsoffice;
        }
示例#2
0
 public void Init()
 {
     playerInput = new ParsedInput("look", new ArrayList());
     thePlayer = new Player("greg");
     t127 = new Location("a lecture theatre", "T127");
     Location gregsoffice = new Location("a spinning vortex of terror", "Greg's Office");
     southExit = new Exit("you see a mound of paper to the south", gregsoffice);
     t127.AddExit("south", southExit );
     thePlayer.CurrentLocation = t127;
     handler = new CommandHandler();
     look = new LookCommand();
 }
示例#3
0
 public void Init()
 {
     playerInput = new ParsedInput("move", new ArrayList());
     thePlayer = new Player("greg");
     t127 = new Location("a lecture theatre", "T127");
     gregsoffice = new Location("a spinning vortex of terror", "Greg's Office");
     t127.AddExit("south", new Exit("you see a mound of paper to the south", gregsoffice));
     gregsoffice.AddExit("north", new Exit("you see a bleak place to the north", t127));
     thePlayer.CurrentLocation = t127;
     handler = new CommandHandler();
     move = new MoveCommand();
 }