public Rook(bool isWhite, Board board) { ChessBoard = board; Team = isWhite; InPlay = true; if (isWhite) { if (ChessBoard.GetCountOfType(this.GetType(), Team) < 1) { Position = new Pair(0, 0); } else if (ChessBoard.GetCountOfType(this.GetType(), Team) < 2) Position = new Pair(0, 7); } else { if (ChessBoard.GetCountOfType(this.GetType(), Team) < 1) { Position = new Pair(7, 0); } else if (ChessBoard.GetCountOfType(this.GetType(), Team) < 2) Position = new Pair(7, 7); } }
public Bishop(bool isWhite, Board board) { ChessBoard = board; Team = isWhite; InPlay = true; if (isWhite) { if (ChessBoard.GetCountOfType(this.GetType(), Team) == 0) { Position = new Pair(0, 2); } else if (ChessBoard.GetCountOfType(this.GetType(), Team) == 1) Position = new Pair(0, 5); } else { if (ChessBoard.GetCountOfType(this.GetType(), Team) == 0) { Position = new Pair(7, 2); } else if (ChessBoard.GetCountOfType(this.GetType(), Team) == 1) Position = new Pair(7, 5); } }
public Knight(bool isWhite, Board board) { ChessBoard = board; Team = isWhite; InPlay = true; if (isWhite) { if (ChessBoard.GetCountOfType(this.GetType(), Team) == 0) { Position = new Pair(0, 1); } else Position = new Pair(0, 6); } else { if (ChessBoard.GetCountOfType(this.GetType(), Team) == 0) { Position = new Pair(7, 1); } else Position = new Pair(7, 6); } }
public Pawn(bool isWhite, Board board) { ChessBoard = board; InPlay = true; Team = isWhite; if (isWhite) { int PawnsAlreadyOnBoard = ChessBoard.GetCountOfType(this.GetType(), Team); Position = new Pair(WhiteVerticalStart, PawnsAlreadyOnBoard); } else { int PawnsAlreadyOnBoard = ChessBoard.GetCountOfType(this.GetType(), Team); Position = new Pair(BlackVerticalStart, PawnsAlreadyOnBoard); } }