Can someone explain me in details what exactly this code do?
I would appreciate it!
I would appreciate it!
Code:
public static Composite Cast(string spell, UnitSelectionDelegate onUnit, Selection<bool> reqs = null)
{
return
new Decorator(
ret => (onUnit != null && onUnit(ret) != null && (reqs == null || reqs(ret)) && AbilityManager.CanCast(spell, onUnit(ret))),
new PrioritySelector(
new Action(delegate {
Logging.Write(">> Casting << " + spell);
return RunStatus.Failure; }),
new Action(ret => AbilityManager.Cast(spell, onUnit(ret))))
);
}