protected virtual void OnMoveExecuting(MoveExecutingEventArgs e) { var handler = this.MoveExecuting; if (handler != null) { handler(this, e); } }
private void ExecuteMove(Move move) { var movingEventArgs = new MoveExecutingEventArgs { Move = move }; this.OnMoveExecuting(movingEventArgs); if (!movingEventArgs.Cancel) { move.Execute(new GameContext(this)); this.OnMoveExecuted(new MoveExecutedEventArgs { Move = move }); } }