private Game.ExecutionEvent FinishedCallbackFor(ActionArea data, Game.ExecutionEvent onExecutionFinished) { return(_ => { if (onExecutionFinished != null) { onExecutionFinished(data.action); } }); }
public void Do(Action action, Rectangle area, Game.ExecutionEvent onExecutionStarted = null, Game.ExecutionEvent onExecutionFinishes = null) { this.onExecutionStarted = onExecutionStarted; this.onExecutionFinished = onExecutionFinishes; mover.Move(area, action.getKeepDistance(), new ActionArea(action, area), OnMovementFinished, OnMovementCancelled); }