public override void ApplyEffects(Agent pAgent, Effector.EPhase phase) { for (int i = 0; i < this.m_effectors.Count; ++i) { Effector.EffectorConfig effector = this.m_effectors[i]; effector.Execute(pAgent); } }
public virtual void ApplyEffects(Agent pAgent, Effector.EPhase phase) { if (this.m_effectors == null || this.m_effectors.Count == 0) { return; } if (this.m_both_effectors == 0) { if (phase == Effector.EPhase.E_SUCCESS && this.m_success_effectors == 0) { return; } if (phase == Effector.EPhase.E_FAILURE && this.m_failure_effectors == 0) { return; } } for (int i = 0; i < this.m_effectors.Count; ++i) { Effector pEffector = this.m_effectors[i]; if (pEffector != null) { Effector.EPhase ph = pEffector.Phase; if (phase == Effector.EPhase.E_BOTH || ph == Effector.EPhase.E_BOTH || ph == phase) { pEffector.Evaluate(pAgent); } } } return; }