public override void DealEffects(Unit target, Unit source) { DelayedEffect delayedEffect = new DelayedEffect((Unit targ, Unit sour) => target.ChangeHealth((GetDamage() * (-1)), source, this), source.globalPositionalData, 1, UnitType.EnemyUnit, true, GetAreaOfEffect(source.GetMapPosition(), source.GetDirection()), source); NewDelayedEffectEvent.Invoke(delayedEffect); delayedEffect = new DelayedEffect((Unit targ, Unit sour) => source.Disable(1), source.globalPositionalData, 0, UnitType.EnemyUnit, true, new List <Unit> { source }, source); NewDelayedEffectEvent.Invoke(delayedEffect); }
// EnqueueDelayedEffect takes a DelayedEffect object and adds it to its storage // This function adds the object to the front, because when evaluating the List it starts from the back protected void EnqueueDelayedEffect(DelayedEffect effect) { delayedEffects.Insert(0, effect); }