Пример #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.ExitCollection.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.ExitCollection.AddExit("south", new Exit("you see a mound of paper to the south", gregsoffice));
     gregsoffice.ExitCollection.AddExit("north", new Exit("you see a bleak place to the north", t127));
     thePlayer.CurrentLocation = t127;
     handler = new CommandHandler();
     move = new MoveCommand();
 }
Пример #4
0
        public NonPlayerCharacterCollection RemoveCharacter(Location location)
        {
            NonPlayerCharacterCollection newList = new NonPlayerCharacterCollection();

            foreach (NonPlayerCharacter npc in location.CharacterList.Values)
                if (npc.LifePoints>1)
                {
                    newList.Add(npc.Name, npc);
                }

            return newList;
        }
Пример #5
0
 public void init()
 {
     t127 = new Location("a lecture theatre", "T127");
     gregsoffice = new Location("a spinning vortex of terror", "Greg's Office");
 }
Пример #6
0
        private void CreateLocations()
        {
            startUp =
                new Location("an office with paper strewn everywhere, how anyone works effectively here is a mystery",
                    "Julies Office");
            lounge =
                new Location("an open space containing comfortable looking couches and artwork of dubious quality",
                    "Airport Lounge");

            Shop shop = new Shop("Some shop", "Shop");

            t127 = new Location("a lecture theatre", "T127");
            gregsOffice = new Location("a spinning vortex of terror", "Greg's Office");
            evansCave = new Shop("a crowded room full of technology related stuff", "Crazy Evan's Discount Technology");

            startUp.ExitCollection.AddExit("south", new Exit("you see an open space to the south", lounge));
            startUp.ExitCollection.AddExit("west", new Exit("you see a terrifying office to the west", gregsOffice));
            startUp.ExitCollection.AddExit("north", new Exit("you see a bleak place to the north", t127));

            lounge.ExitCollection.AddExit("north", new Exit("you see a mound of paper to the north", startUp));
            lounge.ExitCollection.AddExit("northwest", new Exit("you see a terrifying office to the northwest", gregsOffice));
            startUp.ExitCollection.AddExit("east", new Exit("you see a shop in the east", shop));
            shop.ExitCollection.AddExit("west", new Exit("you see a mound of paper to the west", startUp));

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

            gregsOffice.ExitCollection.AddExit("east", new Exit("you see a mound of paper to the east", startUp));
            gregsOffice.ExitCollection.AddExit("southeast", new Exit("you see an open space to the southeast", lounge));
            gregsOffice.ExitCollection.AddExit("west",
                new Exit("you see shiny stuff to the west.. it looks outdated, retro even", evansCave));

            evansCave.ExitCollection.AddExit("east", new Exit("you see a terrifying office to the east", gregsOffice));

            Key gregKey = new Key("gregkey", 10, 5, "Key Greg's office");
            Key dummyKey = new Key("dummykey",5, 5, "Dumb key");
            shop.Items.AddItem( gregKey);
            shop.Items.AddItem(dummyKey);
            gregsOffice.Locked = true;
            gregKey.Location = gregsOffice;
            lounge.CharacterList.Add("Fred", new NonPlayerCharacter("Fred"));
        }
Пример #7
0
 public Key(int worth, int weight, String description)
     : base(worth, weight, description)
 {
     this.location = null;
 }
Пример #8
0
 public Key()
 {
     this.location = null;
 }
Пример #9
0
 public Exit(String description, Location destination)
 {
     Description = description;
     Destination = destination;
 }