Exemplo n.º 1
0
 protected virtual void OnEndUnsuccessfulTurn(EndTurnEventArgs e)
 {
     if (EndUnsuccessfulTurn != null)
     {
         EndUnsuccessfulTurn(this, e);
     }
 }
Exemplo n.º 2
0
        private void invokeOnEndMove(ref eMessage i_OutputMessage)
        {
            EndTurnEventArgs  endUnsuccessfulTurnArgs = new EndTurnEventArgs();
            GameOverEventArgs gameOverArgs            = new GameOverEventArgs();

            if (playerCanPlay(m_ActivePlayerId))
            {
                if (i_OutputMessage == eMessage.EndTurn || i_OutputMessage == eMessage.MustJumpOverAgain)
                {
                    OnUpdateBoard();
                }
                else
                {
                    endUnsuccessfulTurnArgs.Message = i_OutputMessage;
                    OnEndUnsuccessfulTurn(endUnsuccessfulTurnArgs);
                }
            }
            else
            {
                gameOverArgs.Tie    = !playerCanPlay(opponentId);
                gameOverArgs.Winner = opponentId;
                i_OutputMessage     = eMessage.EndGame;
                OnGameOver(gameOverArgs);
            }
        }