Ejemplo n.º 1
0
        protected virtual void OnMoveExecuting(MoveExecutingEventArgs e)
        {
            var handler = this.MoveExecuting;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 2
0
        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
                });
            }
        }