Ejemplo n.º 1
0
        public void NameShouldReflectFavoredTerrainAndBonus()
        {
            var terrain = new TerrainType("Jungle");
            var fav     = new FavoredTerrain();

            fav.Add(terrain);
            Assert.Equal(fav.DisplayString(), "Favored Terrain (Jungle +2)");
        }
Ejemplo n.º 2
0
        public void Execute(Utility.ComponentContainer components)
        {
            var fav = components.Get <FavoredTerrain>();

            if (fav == null)
            {
                fav = new FavoredTerrain();
                components.Add(fav);
            }
            fav.Add(this.terrainTypeGateway.Where(x => !fav.TerrainTypes.Contains(x)).ChooseOne());
        }
Ejemplo n.º 3
0
        public void SelectsAFavoredEnemyAndAddsTwoToTheBonus()
        {
            var forest = new TerrainType("Forest");
            var fav    = new FavoredTerrain();

            fav.Add(forest);
            var character = new CharacterSheet(CharacterStrategy.Default());

            character.Add(fav);
            var upgrade = new UpgradeFavoredTerrain();

            upgrade.ExecuteStep(character);
            Assert.Equal(fav.Bonus(forest), 4);
        }
Ejemplo n.º 4
0
        public void CanHaveMultipleFavoredEnemies()
        {
            var forest = new TerrainType("Forest");
            var plains = new TerrainType("Plains");

            var fav = new FavoredTerrain();

            fav.Add(forest);
            fav.Add(plains);
            Assert.Contains(forest, fav.TerrainTypes);
            Assert.Contains(plains, fav.TerrainTypes);
            Assert.Equal(fav.Bonus(forest), 2);
            Assert.Equal(fav.Bonus(plains), 2);
            Assert.Equal(fav.DisplayString(), "Favored Terrain (Forest +2, Plains +2)");
        }