Ejemplo n.º 1
0
 public ChessMove(int fromIndex, int toIndex, ChessPiece pieceMoved, ChessPiece pieceTaken = null)
 {
     this.FromIndex = fromIndex;
     this.ToIndex = toIndex;
     this.PieceMoved = pieceMoved;
     this.PieceTaken = pieceTaken;
 }
Ejemplo n.º 2
0
        private int GetValueOfPiece(ChessPiece piece)
        {
            if (piece == null)
            {
                return 0;
            }

            int multiplier = 1;
            if (piece.Colour == ChessColour.Black)
            {
                multiplier = -1;
            }

            return multiplier * PieceValues[piece.GetType()];
        }
Ejemplo n.º 3
0
 public BoardLocation(ChessColour color, ChessPiece piece = null)
 {
     this._colour = color;
     this.Piece = piece;
 }
Ejemplo n.º 4
0
 private void ChangeChessPiece(int row, int column, ChessPiece chessPiece)
 {
     this.Locations[row * 8 + column].Piece = chessPiece;
 }