Esempio n. 1
0
        /// <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);
 }
Esempio n. 3
0
 /// <summary>
 /// Applies this effect on the specified non character targetable
 /// </summary>
 /// <param name="target">Targetable.</param>
 public virtual void Apply(Targetable target)
 {
 }
Esempio n. 4
0
 public EffectArgs(Effect effect, Targetable target)
 {
     Effect = effect;
     Target = new TargetUnion(target);
 }
Esempio n. 5
0
 public override void Apply(Targetable target)
 {
     Run(target, Context);
     base.Apply(target);
 }
Esempio n. 6
0
 public void Add(Targetable target)
 {
     _targetables.Add(target);
 }
Esempio n. 7
0
 public TargetUnion(Targetable targetable) : this()
 {
     Targetable = targetable;
     Type       = TargetType.Targetable;
 }
Esempio n. 8
0
 /// <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);
 }