Ejemplo n.º 1
0
 internal static Point getKing(Peice[,] board, PSide side)
 {
     for (int x = 0; x < 8; x++)
     {
         for (int y = 0; y < 8; y++)
         {
             if (board[x, y] != null && board[x, y].MySide == side && board[x, y].MyType == Peices.PType.King) { return new Point(x, y); }
         }
     }
     throw new Exception("Searched for king on board for " + side.ToString() + " side, not present");
 }
Ejemplo n.º 2
0
 internal static Point getKing(Peice[,] board, PSide side)
 {
     for (int x = 0; x < 8; x++)
     {
         for (int y = 0; y < 8; y++)
         {
             if (board[x, y] != null && board[x, y].MySide == side && board[x, y].MyType == Peices.PType.King)
             {
                 return(new Point(x, y));
             }
         }
     }
     throw new Exception("Searched for king on board for " + side.ToString() + " side, not present");
 }
Ejemplo n.º 3
0
        public void OnEndGame(PSide side, ChessGame.EndGames endType)
        {
            PlaySound(Sounds.endgame);
            switch (endType)
            {
            case (ChessGame.EndGames.Checkmate): { MessageBox.Show(null, side.ToString() + " has been checkmated!", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }

            case (ChessGame.EndGames.Draw): { MessageBox.Show(null, "Game drawn, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }

            case (ChessGame.EndGames.Stalemate): { MessageBox.Show(null, "StaleMate, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }
            }

            btn_reset.Enabled = true;
        }
Ejemplo n.º 4
0
        public void OnEndGame(PSide side, ChessGame.EndGames endType)
        {
            PlaySound(Sounds.endgame);
            switch(endType)
            {
                case (ChessGame.EndGames.Checkmate): { MessageBox.Show(null, side.ToString() + " has been checkmated!", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }
                case (ChessGame.EndGames.Draw): { MessageBox.Show(null, "Game drawn, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }
                case (ChessGame.EndGames.Stalemate): { MessageBox.Show(null, "StaleMate, 50/50", "Game over", MessageBoxButtons.OK, MessageBoxIcon.Information); break; }
            }

            btn_reset.Enabled = true;
        }