private void UpdateDataByDeadType(MyStatistic.MyStatisticData data, MyStatistic.UnitType deadType, MyStatistic.UnitType attackerType, Units attacker) { switch (deadType) { case MyStatistic.UnitType.Monster: this.UpdateDatabyKillType(data.monsterKill, attackerType, attacker); break; case MyStatistic.UnitType.Hero: this.UpdateDatabyKillType(data.heroKill, attackerType, attacker); break; case MyStatistic.UnitType.Tower: this.UpdateDatabyKillType(data.towerKill, attackerType, attacker); break; } }
public void UpdateData(Units deadUnits, Units attacker) { MyStatistic.MyStatisticData myStatisticData = null; if (attacker == null) { return; } if (attacker.TeamType == TeamType.Neutral) { return; } int teamType = attacker.teamType; if (this._allDatas.ContainsKey(teamType)) { myStatisticData = this._allDatas[teamType]; } if (myStatisticData != null) { MyStatistic.UnitType unitType = this.GetUnitType(deadUnits); MyStatistic.UnitType unitType2 = this.GetUnitType(attacker); this.UpdateDataByDeadType(myStatisticData, unitType, unitType2, attacker); } }