/// <summary> /// Apply the effects contained in this collection with a single Targetable target /// </summary> /// <param name="target">The target targetable</param> /// <param name="context">The Cast context for the Effects to run</param> /// <returns>This collection itself</returns> public EffectCollection Run(Targetable target, Cast context = null) { foreach (Effect effect in _effects) { effect.SetContext(context); effect.Apply(target); } return(this); }
public override bool Check(Targetable target) { foreach (Condition condition in _conditions) { condition.SetContext(Context); if (!condition.Check(target)) { return(false); } } return(true); }
/// <summary> /// Applies this effect on the specified non character targetable /// </summary> /// <param name="target">Targetable.</param> public virtual void Apply(Targetable target) { }
public EffectArgs(Effect effect, Targetable target) { Effect = effect; Target = new TargetUnion(target); }
public override void Apply(Targetable target) { Run(target, Context); base.Apply(target); }
public void Add(Targetable target) { _targetables.Add(target); }
public TargetUnion(Targetable targetable) : this() { Targetable = targetable; Type = TargetType.Targetable; }
/// <summary> /// Check whether a condition is met under the context with the specified target. /// </summary> /// <param name="target">The Targetable.</param> public virtual bool Check(Targetable target) { return(true); }