Ejemplo 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);
        }
Ejemplo n.º 2
0
 public override bool Check(Targetable target)
 {
     foreach (Condition condition in _conditions)
     {
         condition.SetContext(Context);
         if (!condition.Check(target))
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo 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)
 {
 }
Ejemplo n.º 4
0
 public EffectArgs(Effect effect, Targetable target)
 {
     Effect = effect;
     Target = new TargetUnion(target);
 }
Ejemplo n.º 5
0
 public override void Apply(Targetable target)
 {
     Run(target, Context);
     base.Apply(target);
 }
Ejemplo n.º 6
0
 public void Add(Targetable target)
 {
     _targetables.Add(target);
 }
Ejemplo n.º 7
0
 public TargetUnion(Targetable targetable) : this()
 {
     Targetable = targetable;
     Type       = TargetType.Targetable;
 }
Ejemplo 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);
 }