public override List <Tile> GetPossibleMoves(List <Tile> tiles) { var result = Rook.GetPossibleMoves(this.tile.x, this.tile.y, this.color, tiles); result.AddRange(Bishop.GetPossibleMoves(this.tile.x, this.tile.y, this.color, tiles)); result.Remove(this.tile); return(result); }
public FigureChoiceWindow(Point startPosition, FigureColor clr) { InitializeComponent(); this.Size = new System.Drawing.Size(2 * sqSize, 2 * sqSize); this.Location = startPosition; arr = new Figure[4]; arr[0] = new Queen(clr); arr[1] = new Rock(clr); arr[2] = new Knight(clr); arr[3] = new Bishop(clr); }
public CoreMatrix() { sMatrix = new Figure[8, 8]; #if !TEST //WHITE sMatrix[0, 7] = new Rock(FigureColor.WHITE); sMatrix[7, 7] = new Rock(FigureColor.WHITE); sMatrix[6, 7] = new Knight(FigureColor.WHITE); sMatrix[1, 7] = new Knight(FigureColor.WHITE); sMatrix[2, 7] = new Bishop(FigureColor.WHITE); sMatrix[5, 7] = new Bishop(FigureColor.WHITE); sMatrix[4, 7] = new King(FigureColor.WHITE); sMatrix[3, 7] = new Queen(FigureColor.WHITE); for (int i = 0; i < 8; i++) { sMatrix[i, 6] = new Pawn(FigureColor.WHITE); } //BLACK sMatrix[0, 0] = new Rock(FigureColor.BLACK); sMatrix[7, 0] = new Rock(FigureColor.BLACK); sMatrix[6, 0] = new Knight(FigureColor.BLACK); sMatrix[1, 0] = new Knight(FigureColor.BLACK); sMatrix[2, 0] = new Bishop(FigureColor.BLACK); sMatrix[5, 0] = new Bishop(FigureColor.BLACK); sMatrix[4, 0] = new King(FigureColor.BLACK); sMatrix[3, 0] = new Queen(FigureColor.BLACK); for (int i = 0; i < 8; i++) { sMatrix[i, 1] = new Pawn(FigureColor.BLACK); } #endif #if TEST //WHITE sMatrix[0, 7] = new Rock(FigureColor.WHITE); sMatrix[7, 7] = new Rock(FigureColor.WHITE); sMatrix[4, 7] = new King(FigureColor.WHITE); for (int i = 0; i < 8; i++) { sMatrix[i, 6] = new Pawn(FigureColor.WHITE); } //BLACK sMatrix[0, 0] = new Rock(FigureColor.BLACK); sMatrix[7, 0] = new Rock(FigureColor.BLACK); sMatrix[6, 0] = new Knight(FigureColor.BLACK); sMatrix[1, 0] = new Knight(FigureColor.BLACK); sMatrix[2, 0] = new Bishop(FigureColor.BLACK); sMatrix[5, 0] = new Bishop(FigureColor.BLACK); sMatrix[4, 0] = new King(FigureColor.BLACK); sMatrix[3, 0] = new Queen(FigureColor.BLACK); for (int i = 0; i < 8; i++) { sMatrix[i, 1] = new Pawn(FigureColor.BLACK); } #endif KingBlack = new Position(4, 0); KingWhite = new Position( 4, 7); }