Beispiel #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;
 }
Beispiel #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()];
        }
Beispiel #3
0
 public BoardLocation(ChessColour color, ChessPiece piece = null)
 {
     this._colour = color;
     this.Piece = piece;
 }
Beispiel #4
0
 private void ChangeChessPiece(int row, int column, ChessPiece chessPiece)
 {
     this.Locations[row * 8 + column].Piece = chessPiece;
 }