Пример #1
0
        private void model_Moving(object sender, CancelMoveEventArgs e)
        {
            // no talking during loading
            if (isModelLoadingMoves)
            {
                return;
            }

            // say the move if it is engine turn
            if (oppInfo != null && oppInfo.AITurn)
            {
                synth.SpeakAsync(String.Format(moveSpeechTemplate, Utils.GetNotation(e.Move.From), Utils.GetNotation(e.Move.To)));
            }
        }
        private void model_GoingBack(object sender, CancelMoveEventArgs e)
        {
            // do not allow any modifications to the game board during a move animation
            if (IsAnimating)
            {
                e.Cancel = true;
                return;
            }

            // select the piece which is about to move back
            if (piecePos != e.Move.To)
            {
                DrawSelection(e.Move.To);
            }
        }
        private void model_GoingForward(object sender, CancelMoveEventArgs e)
        {
            // do not allow any modifications to the game board during a move animation
            if (IsAnimating)
            {
                e.Cancel = true;
                return;
            }

            // select the piece which is about to move
            if (piecePos != e.Move.From)
            {
                DrawSelection(e.Move.From);
            }

            showMoveAnimation = false;
        }
        private void model_Moving(object sender, CancelMoveEventArgs e)
        {
            // model is loading the moves from a game, the board will be updated at the end
            if (isModelLoadingMoves)
            {
                return;
            }

            // do not allow any modifications to the game board during a move animation
            if (IsAnimating)
            {
                e.Cancel = true;
                return;
            }

            // select the piece which is about to move
            if (piecePos != e.Move.From)
            {
                DrawSelection(e.Move.From);
            }
        }
Пример #5
0
 /// <summary>
 /// Raises the GoingBack event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnGoingBack(CancelMoveEventArgs e)
 {
     GoingBack?.Invoke(this, e);
 }
Пример #6
0
 /// <summary>
 /// Raises the GoingForward event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnGoingForward(CancelMoveEventArgs e)
 {
     GoingForward?.Invoke(this, e);
 }
Пример #7
0
 /// <summary>
 /// Raises the Moving event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnMoving(CancelMoveEventArgs e)
 {
     Moving?.Invoke(this, e);
 }