private void SetSideData(SpousesBattleRecordSide side, IBattleCombatant battleCombatant, BasicCharacterObject character, int remain, int killCount, int killed, int wounder, int wounded) { if (null != side) { side.Remain += remain; side.KillCount += killCount; side.Killed += killed; side.Wounded += wounded; side.RunAway += wounder; SpousesBattleRecordParty party = side.GetPartyByUniqueId(battleCombatant.GetHashCode() + ""); if (null == party) { party = new SpousesBattleRecordParty(battleCombatant.GetHashCode() + ""); party.Name = battleCombatant.Name.ToString(); side.Parties.Add(party); } party.Remain += remain; party.KillCount += killCount; party.Killed += killed; party.Wounded += wounded; party.RunAway += wounder; SpousesBattleRecordCharacter battleRecordCharacter = party.GetBattleRecordCharacter(character); if (null == battleRecordCharacter) { battleRecordCharacter = new SpousesBattleRecordCharacter(character); party.Characters.Add(battleRecordCharacter); } battleRecordCharacter.Remain += remain; battleRecordCharacter.KillCount += killCount; battleRecordCharacter.Killed += killed; battleRecordCharacter.Wounded += wounded; battleRecordCharacter.RunAway += wounder; } }
public void ResetData() { lastHero = null; lastKillCount = 0; attackerSide = null; defenderSide = null; attackerBanner = null; defenderBanner = null; spousesBattleRecord = null; TempHeroStatisticRecordDic.Clear(); }
public void RecordBattleData(BattleSideEnum side, IBattleCombatant battleCombatant, BasicCharacterObject character, int remain, int killed, int killCount, int wounder, int wounded) { if (null != (character as CharacterObject)) { RecordHeroBattleStatistic((CharacterObject)character, killCount); } if (side == BattleSideEnum.Attacker) { if (null == attackerSide) { Banner banner = null; if (null != attackerBanner) { banner = attackerBanner; } else if (null != MobileParty.MainParty.MapEvent) { banner = MobileParty.MainParty.MapEvent.AttackerSide.LeaderParty.Banner; } attackerSide = new SpousesBattleRecordSide(GameTexts.FindText("str_battle_result_army", "attacker").ToString(), banner); } SetSideData(attackerSide, battleCombatant, character, remain, killCount, killed, wounder, wounded); } else { if (null == defenderSide) { Banner banner = null;; if (null != defenderBanner) { banner = defenderBanner; } else if (null != MobileParty.MainParty.MapEvent) { banner = MobileParty.MainParty.MapEvent.DefenderSide.LeaderParty.Banner; } defenderSide = new SpousesBattleRecordSide(GameTexts.FindText("str_battle_result_army", "defender").ToString(), banner); } SetSideData(defenderSide, battleCombatant, character, remain, killCount, killed, wounder, wounded); } }
public void FillHistorySide(SpousesBattleRecordSide side) { this._side = side; this.Score.UpdateScores(side.Name, side.Remain, side.KillCount, side.Wounded, side.RunAway, side.Killed, 0); this.Parties.Clear(); if (side.Parties.Count > 0) { side.Parties.ForEach(obj => { if (null != obj) { Parties.Add(new BattleHistorySPPartyVM(obj)); } }); } if (null != side.Banner) { BannerCode bannerCode = BannerCode.CreateFrom(side.Banner); this.BannerVisual = new ImageIdentifierVM(bannerCode, true); this.BannerVisualSmall = new ImageIdentifierVM(bannerCode, false); } }