public Pawn(Piece p, Color c, ChessSquare s) : base(Piece.ePAWN, c, s) { if (c == Color.eWHITE) { m_image = ChessGame.Properties.Resources.Pawn_White; } else { m_image = ChessGame.Properties.Resources.Pawn_Black; } }
public King(Color c, ChessSquare s) : base(Piece.eKING, c, s) { if (c == Color.eWHITE) { m_image = ChessGame.Properties.Resources.King_White; } else { m_image = ChessGame.Properties.Resources.King_Black; } }
public bishop(Color c, ChessSquare s) : base(Piece.eBISHOP, c, s) { if (c == Color.eWHITE) { m_image = ChessGame.Properties.Resources.Bishop_White; } else { m_image = ChessGame.Properties.Resources.Bishop_Black; } }
public Knight(Piece p, Color c, ChessSquare s) : base(Piece.eKNIGHT, c, s) { if (c == Color.eWHITE) { m_image = ChessGame.Properties.Resources.Knight_White; } else { m_image = ChessGame.Properties.Resources.Knight_Black; } }
public Rook(Piece p, Color c, ChessSquare s) : base(Piece.eROOK, c, s) { if (c == Color.eWHITE) { m_image = ChessGame.Properties.Resources.Rook_White; } else { m_image = ChessGame.Properties.Resources.Rook_Black; } }
public ChessBoard(System.Windows.Forms.PictureBox[,] pictureBoxes) { for (int r = 0; r < 8; r++) { for (int c = 0; c < 8; c++) { m_b[r, c] = new ChessSquare(r + 1, c + 1, pictureBoxes[r, c]); System.Console.WriteLine(m_b[r, c]); } } me = this; }
public override ChessSquare[] GetSquares() { ChessBoard b = ChessBoard.GetBoard(); ChessSquare[] move = new ChessSquare[8]; if (m_square.GetColumn() > 1) { move[0] = b.GetSquare(m_square.GetRow(), m_square.GetColumn() - 1); } move[0] = b.GetSquare(m_square.GetRow(), m_square.GetColumn() - 1); move[1] = b.GetSquare(m_square.GetRow(), m_square.GetColumn() + 1); move[2] = b.GetSquare(m_square.GetRow() - 1, m_square.GetColumn() - 1); move[3] = b.GetSquare(m_square.GetRow() - 1, m_square.GetColumn() + 1); move[4] = b.GetSquare(m_square.GetRow() + 1, m_square.GetColumn() + 1); move[5] = b.GetSquare(m_square.GetRow() + 1, m_square.GetColumn() - 1); move[6] = b.GetSquare(m_square.GetRow() + 1, m_square.GetColumn()); move[7] = b.GetSquare(m_square.GetRow() - 1, m_square.GetColumn()); return(null); }
public ChessPiece(Piece unit, Color color, ChessSquare s) { m_square = s; s.SetChessPiece(this); }