Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
 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;
     }
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public ChessPiece(Piece unit, Color color, ChessSquare s)
 {
     m_square = s;
     s.SetChessPiece(this);
 }