protected virtual void OnTransferStatistics( PlayerMobile pm, PvPProfileHistoryEntry profileStats, PvPProfileHistoryEntry battleStats) { if (!Ranked || profileStats == null || battleStats == null) { return; } profileStats.Battles += battleStats.Battles; profileStats.Wins += battleStats.Wins; profileStats.Losses += battleStats.Losses; profileStats.Kills += battleStats.Kills; profileStats.Deaths += battleStats.Deaths; profileStats.Resurrections += battleStats.Resurrections; profileStats.DamageTaken += battleStats.DamageTaken; profileStats.DamageDone += battleStats.DamageDone; profileStats.HealingTaken += battleStats.HealingTaken; profileStats.HealingDone += battleStats.HealingDone; foreach (var kvp in battleStats.MiscStats) { profileStats[kvp.Key] += kvp.Value; } }
protected virtual void OnTransferStatistics(PvPProfile profile, PvPProfileHistoryEntry stats) { if (Ranked && profile != null && stats != null) { stats.AddTo(profile.Statistics, true); } }
private void TransferStatistics(PlayerMobile pm, PvPProfileHistoryEntry e) { var profile = AutoPvP.EnsureProfile(pm); OnTransferStatistics(profile, e); OnTransferPoints(profile, e.Points); }
public virtual PvPProfileHistoryEntry EnsureEntry(PvPSeason season, bool replace = false) { PvPProfileHistoryEntry entry; if (!Entries.TryGetValue(season.Number, out entry) || entry == null || replace) { Entries[season.Number] = entry = new PvPProfileHistoryEntry(season.Number); } return(entry); }
public PvPProfileHistoryEntry GetStatistics(PlayerMobile pm) { var e = Statistics.GetValue(pm); if (e == null && IsMember(pm)) { Statistics[pm] = e = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number); } return(e); }
public PvPProfileHistoryEntry EnsureStatistics(PlayerMobile pm, bool replace) { PvPProfileHistoryEntry entry; if (!Statistics.TryGetValue(pm, out entry) || entry == null || replace) { Statistics[pm] = entry = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number); } StatisticsCache[pm] = entry; return(entry); }
public void TransferStatistics(PlayerMobile pm) { if (!Ranked) { Statistics.Remove(pm); return; } PvPProfile profile = AutoPvP.EnsureProfile(pm); PvPProfileHistoryEntry entry = EnsureStatistics(pm); OnTransferStatistics(pm, profile.Statistics, entry); Statistics.Remove(pm); }
public virtual void Deserialize(GenericReader reader) { int version = reader.ReadInt(); switch (version) { case 0: Entries = reader.ReadBlockDictionary( r => { PvPProfileHistoryEntry e = r.ReadTypeCreate <PvPProfileHistoryEntry>(r); return(new KeyValuePair <int, PvPProfileHistoryEntry>(e.Season, e)); }); break; } }
public PvPProfileHistoryEntry EnsureStatistics(PlayerMobile pm, bool replace) { PvPProfileHistoryEntry entry; if (!Statistics.TryGetValue(pm, out entry)) { Statistics.Add(pm, entry = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number)); } else if (entry == null || replace) { Statistics[pm] = entry = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number); } if (!StatisticsCache.ContainsKey(pm)) { StatisticsCache.Add(pm, entry); } else { StatisticsCache[pm] = entry; } return(entry); }
public PvPStatistics(PlayerMobile m, PvPProfileHistoryEntry entry) { Player = m; Entry = entry; }