public Knight(int x, int y, PieceColorEnum color) { this.CurrentLocation_x = x; this.CurrentLocation_y = y; Type = PieceTypeEnum.Knight; BoardNotation = 'N'; Value = 3; Color = color; }
public Bishop(int x, int y, PieceColorEnum color) { this.Type = PieceTypeEnum.Bishop; this.BoardNotation = 'B'; this.Value = 3; this.Color = color; this.CurrentLocation_x = x; this.CurrentLocation_y = y; }
public Rook(int x, int y, PieceColorEnum color) { this.CurrentLocation_x = x; this.CurrentLocation_y = y; Type = PieceTypeEnum.Rook; BoardNotation = 'R'; Value = 5; Color = color; }
public Queen(int x, int y, PieceColorEnum color) { this.CurrentLocation_x = x; this.CurrentLocation_y = y; Type = PieceTypeEnum.Queen; BoardNotation = 'Q'; Value = 8; Color = color; }
public Pawn(int x, int y, PieceColorEnum color) { this.CurrentLocation_x = x; this.CurrentLocation_y = y; Type = PieceTypeEnum.Pawn; BoardNotation = 'P'; Value = 1; Color = color; }
public King(int x, int y, PieceColorEnum color) { this.CurrentLocation_x = x; this.CurrentLocation_y = y; this.Type = PieceTypeEnum.King; this.BoardNotation = 'K'; this.Value = 1000; this.Color = color; }
public bool IsStaleMate(PieceColorEnum colorToMove) { // side to move has nowhere to move foreach (var piece in this.Instance) { if (piece != null && piece.Color == colorToMove) { var test = piece.AvailableMoves(this); if (test.Any()) { return(false); } } } return(true); }