public ChessPlayer(ChessGame game, ChessPlayerColour colour, int direction, IGameplayAI ai) { this.Game = game; this.Colour = colour; this.Direction = direction; this.AI = ai; }
public ChessPiece(ChessBoard board, ChessPlayerColour colour, ChessPieceType type, ChessLocation location, int direction) { this.Board = board; this.Colour = colour; this.PieceType = type; this.Location = location; this.Direction = direction; }
private void ResetPlayerPieces(ChessPlayerColour colour, int direction) { int baseY = direction > 0 ? 0 : 7; this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.King, new ChessLocation(4, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Queen, new ChessLocation(3, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Bishop, 1, new ChessLocation(2, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Bishop, 2, new ChessLocation(5, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Knight, 1, new ChessLocation(1, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Knight, 2, new ChessLocation(6, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Rook, 1, new ChessLocation(0, baseY), direction)); this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Rook, 2, new ChessLocation(7, baseY), direction)); for (int i = 0; i <= 7; i++) { this.Pieces.Add(new ChessPiece(this, colour, ChessPieceType.Pawn, i + 1, new ChessLocation(i, baseY + direction), direction)); } }
public ChessPiece(ChessBoard board, ChessPlayerColour colour, ChessPieceType type, int number, ChessLocation location, int direction) : this(board, colour, type, location, direction) { this._number = number; }