예제 #1
0
        private static void InitializeDungeons()
        {
            Dungeon firstDungeon = new Dungeon("ZombieLake",
                new HashSet<Character>()
                {
                    new DamageDealer("DeadCrusader", 1),
                    new DamageDealer("ZombieSoldier", 1),
                    new DamageDealer("DragonZombie", 1),
                },
                new Collection<Item>()
                {
                    new Potion("HealPotion"),
                    new Potion("PoisonPotion"),
                });

            Dungeon secondDungeon = new Dungeon("InsectBeehive",
                new HashSet<Character>()
                {
                    new DamageDealer("GiantSpider", 1),
                    new DamageDealer("LadyOfTheCrypt", 1),
                    new DamageDealer("Larva", 1),
                },
                new Collection<Item>()
                {
                    new Potion("Heal Potion"),
                });
            Dungeon thirdDungeon = new Dungeon("SpiderNest",
               new HashSet<Character>()
                {
                    new DamageDealer("GiantSpider", 1),
                    new DamageDealer("LadyOfTheCrypt", 1),
                    new DamageDealer("BlackWidow", 1),
                },
               new Collection<Item>()
                {
                    new Potion("Heal Potion"),
                });
            Dungeon fourthDungeon = new Dungeon("SpiritForest",
               new HashSet<Character>()
                {
                    new DamageDealer("Ghost", 1),
                    new DamageDealer("Wraith", 1),
                    new DamageDealer("Banshee", 1),
                },
               new Collection<Item>()
                {
                    new Potion("Heal Potion"),
                });

            firstDungeon.AddExit(secondDungeon, thirdDungeon);
            secondDungeon.AddExit(firstDungeon, fourthDungeon);
            thirdDungeon.AddExit(firstDungeon, fourthDungeon);
            fourthDungeon.AddExit(secondDungeon, thirdDungeon);

            entranceLocation = firstDungeon;
        }
예제 #2
0
 public void ChangeLocation(Location newLocation)
 {
     // TODO: Validation of newLocation (is it reachable)
     this.currentLocation = newLocation;
 }
예제 #3
0
        public void HandleChangeLocation(string locationName)
        {
            var location = FindObjectByName(this.currentLocation.Exits, locationName);

            this.currentLocation = (Location)location;
        }
예제 #4
0
 public GameManager()
 {
     currentLocation = World.Init();
 }