public override void Die(IFighter pg) { var killerType = pg.GetType(); var pgType = typeof(Pg); if (killerType == pgType || killerType.IsSubclassOf(pgType)) { var charPg = pg as Pg; // Pg Xp, Gold, Items, etc... charPg.GainExperience(this.XPPremium); // Remove from map } this.Map.Remove(this); }
public void Should_be_correct_winner() { _winner.GetType().Should().Be(typeof(Player)); }
public void CorrectlyGeneratesBattlefield_TeamConfiguration_NoTerrainConfiguration() { TeamConfiguration teamInfo = new TeamConfiguration(new EnemyConfiguration(FighterType.Goblin, 1), new EnemyConfiguration(FighterType.Fairy, 1)); BattlefieldConfiguration battlefieldConfig = new BattlefieldConfiguration(teamInfo); BattleFieldInfo returnedBattleFieldInfo = _factory.GetBattleFieldSetUp(battlefieldConfig); List <IFighter> fighters = returnedBattleFieldInfo.EnemyTeam.Fighters; Assert.AreEqual(2, fighters.Count); IFighter firstFighter = fighters[0]; Assert.True(firstFighter is Goblin, $"first fighter should be a Goblin but was {firstFighter.GetType()}"); Assert.True(firstFighter.Level == 1, "first fighter should be level 1"); IFighter secondFighter = fighters[1]; Assert.True(secondFighter is Fairy, $"second fighter should be a fairy but was {secondFighter.GetType()}"); Assert.True(secondFighter.Level == 1, "second fighter should be level 1"); }