public void ChildFailed(AbstractCondition child) { ConditionVO conditionVo = child.GetConditionVo(); child.Destroy(); this.Failures.Add(conditionVo.Uid); this.events.SendEvent(EventId.VictoryConditionFailure, conditionVo); }
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); }
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; } }
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(); } }
public void ActivateFailureCondition(ConditionVO condition) { this.failureCondition = ConditionFactory.GenerateCondition(condition, this); this.failureCondition.Start(); }
public void ChildUpdated(AbstractCondition child, int delta) { }