Пример #1
0
        public void ChildFailed(AbstractCondition child)
        {
            ConditionVO conditionVo = child.GetConditionVo();

            child.Destroy();
            this.Failures.Add(conditionVo.Uid);
            this.events.SendEvent(EventId.VictoryConditionFailure, conditionVo);
        }
Пример #2
0
        public void ChildSatisfied(AbstractCondition child)
        {
            if (child == this.failureCondition)
            {
                return;
            }
            ConditionVO conditionVo = child.GetConditionVo();

            child.Destroy();
            this.Successes.Add(conditionVo.Uid);
            this.events.SendEvent(EventId.VictoryConditionSuccess, conditionVo);
        }
Пример #3
0
 public void CancelCurrentConditions()
 {
     if (this.currentVictoryConditions != null)
     {
         for (int i = 0; i < this.currentVictoryConditions.Count; i++)
         {
             this.currentVictoryConditions[i].Destroy();
         }
     }
     this.currentVictoryConditions = null;
     this.Successes.Clear();
     this.Failures.Clear();
     if (this.failureCondition != null)
     {
         this.failureCondition.Destroy();
         this.failureCondition = null;
     }
 }
Пример #4
0
        public void ActivateConditionSet(List <ConditionVO> voSet)
        {
            this.CancelCurrentConditions();
            this.Successes = new List <string>();
            this.Failures  = new List <string>();
            this.currentVictoryConditions = new List <AbstractCondition>();
            AbstractCondition abstractCondition = null;

            for (int i = 0; i < voSet.Count; i++)
            {
                abstractCondition = ConditionFactory.GenerateCondition(voSet[i], this);
                this.currentVictoryConditions.Add(abstractCondition);
                abstractCondition.Start();
            }
            for (int j = voSet.Count; j < 3; j++)
            {
                abstractCondition = ConditionFactory.GenerateCondition(abstractCondition.GetConditionVo(), this);
                this.currentVictoryConditions.Add(abstractCondition);
                abstractCondition.Start();
            }
        }
Пример #5
0
 public void ActivateFailureCondition(ConditionVO condition)
 {
     this.failureCondition = ConditionFactory.GenerateCondition(condition, this);
     this.failureCondition.Start();
 }
Пример #6
0
 public void ChildUpdated(AbstractCondition child, int delta)
 {
 }