Example #1
0
 private void StartCounting()
 {
     this.conditions     = new List <AbstractCondition>();
     this.conditionCount = this.parent.MissionVO.Conditions.Count;
     for (int i = 0; i < this.conditionCount; i++)
     {
         AbstractCondition abstractCondition = ConditionFactory.GenerateCondition(this.parent.MissionVO.Conditions[i], this, this.startingValues[this.parent.MissionVO.Conditions[i].Uid]);
         this.conditions.Add(abstractCondition);
         abstractCondition.Start();
     }
 }
Example #2
0
 public void GetMissionProgress(CampaignMissionVO mission, out int current, out int total)
 {
     if (!this.missions.ContainsKey(mission.Uid))
     {
         current = 0;
         total   = 1;
     }
     current = 0;
     total   = 0;
     for (int i = 0; i < mission.Conditions.Count; i++)
     {
         Dictionary <string, int> counters   = this.missions[mission.Uid].Counters;
         ConditionVO       conditionVO       = mission.Conditions[i];
         int               startingValue     = (counters != null && counters.ContainsKey(conditionVO.Uid)) ? counters[conditionVO.Uid] : 0;
         AbstractCondition abstractCondition = ConditionFactory.GenerateCondition(conditionVO, null, startingValue);
         int               num;
         int               num2;
         abstractCondition.GetProgress(out num, out num2);
         current += num;
         total   += num2;
         abstractCondition.Destroy();
     }
 }