Ejemplo n.º 1
0
 public void postDeserializeInitialization()
 {
     sm_tempStringList.Clear();
     foreach (KeyValuePair <string, TournamentUpgradeInstance> pair in this.NormalUpgrades)
     {
         string key = pair.Key;
         TournamentUpgradeInstance instance = pair.Value;
         if ((string.IsNullOrEmpty(key) || (instance.TotalCount <= 0)) || !App.Binder.ConfigMeta.TOURNAMENT_UPGRADES.ContainsKey(key))
         {
             sm_tempStringList.Add(key);
         }
     }
     for (int i = 0; i < sm_tempStringList.Count; i++)
     {
         this.NormalUpgrades.Remove(sm_tempStringList[i]);
     }
     sm_tempStringList.Clear();
     foreach (KeyValuePair <string, TournamentUpgradeInstance> pair2 in this.EpicUpgrades)
     {
         string str2 = pair2.Key;
         TournamentUpgradeInstance instance2 = pair2.Value;
         if ((string.IsNullOrEmpty(str2) || (instance2.TotalCount <= 0)) || !App.Binder.ConfigMeta.TOURNAMENT_UPGRADES.ContainsKey(str2))
         {
             sm_tempStringList.Add(str2);
         }
     }
     for (int j = 0; j < sm_tempStringList.Count; j++)
     {
         this.EpicUpgrades.Remove(sm_tempStringList[j]);
     }
     sm_tempStringList.Clear();
     this.clear();
     this.addPlayerUpgradesToQuickLookup(true);
 }
Ejemplo n.º 2
0
 public void addNormalUpgradeToQuickLookup(TournamentUpgradeInstance tui, [Optional, DefaultParameterValue(true)] bool triggerQuickLookupRefresh)
 {
     if (!this.m_perkInstanceToUpgradeMap.ContainsKey(tui.SharedPerkInstance))
     {
         TournamentUpgrade upgrade = App.Binder.ConfigMeta.TOURNAMENT_UPGRADES[tui.TournamentUpgradeId];
         this.m_perkInstanceToUpgradeMap.Add(tui.SharedPerkInstance, upgrade);
     }
     if (!this.m_uniqueUpgrades.Contains(tui.TournamentUpgradeId))
     {
         this.m_uniqueUpgrades.Add(tui.TournamentUpgradeId);
     }
     base.addQuickLookupPerkInstance(tui.SharedPerkInstance, triggerQuickLookupRefresh);
 }
Ejemplo n.º 3
0
 public void initializeWithExternalUpgrades(List <TournamentEntry> tournamentEntries)
 {
     this.clear();
     this.addPlayerUpgradesToQuickLookup(false);
     for (int i = 0; i < tournamentEntries.Count; i++)
     {
         TournamentEntry entry = tournamentEntries[i];
         if (entry.PlayerId != this.Player._id)
         {
             foreach (KeyValuePair <string, TournamentUpgradeInstance> pair in entry.NormalUpgrades)
             {
                 if (!this.ExternalNormalUpgrades.ContainsKey(pair.Key))
                 {
                     this.ExternalNormalUpgrades.Add(pair.Key, new TournamentUpgradeInstance(pair.Value));
                 }
                 else
                 {
                     TournamentUpgradeInstance local1 = this.ExternalNormalUpgrades[pair.Key];
                     local1.TotalCount += pair.Value.TotalCount;
                     TournamentUpgradeInstance local2 = this.ExternalNormalUpgrades[pair.Key];
                     local2.TotalModifier += pair.Value.TotalModifier;
                 }
             }
             foreach (KeyValuePair <string, TournamentUpgradeInstance> pair2 in entry.EpicUpgrades)
             {
                 if (!this.ExternalEpicUpgrades.ContainsKey(pair2.Key))
                 {
                     this.ExternalEpicUpgrades.Add(pair2.Key, new TournamentUpgradeInstance(pair2.Value));
                 }
                 else
                 {
                     TournamentUpgradeInstance local3 = this.ExternalEpicUpgrades[pair2.Key];
                     local3.TotalCount += pair2.Value.TotalCount;
                     TournamentUpgradeInstance local4 = this.ExternalEpicUpgrades[pair2.Key];
                     local4.TotalModifier += pair2.Value.TotalModifier;
                 }
             }
         }
     }
     this.addExternalUpgradesToQuickLookup(false);
     base.refreshQuickLookup();
 }
 public TournamentUpgradeInstance(TournamentUpgradeInstance another)
 {
     this.TournamentUpgradeId = another.TournamentUpgradeId;
     this.TotalCount          = another.TotalCount;
     this.TotalModifier       = another.TotalModifier;
 }