public Board(string[] gridLines) { _cursor = new Cursor(Board.GridLength); _grid = GridBuilder.CreateGrid(gridLines); PieceSelection = NullPieceSelection.GetInstance(); _view = new BoardView(this); IsFlipped = false; }
private Board(Piece[,] grid) { _cursor = new Cursor(Board.GridLength); _grid = GridBuilder.CloneGrid(grid); PieceSelection = NullPieceSelection.GetInstance(); _view = new BoardView(this); IsFlipped = false; }
private void _selectCursorPiece(PieceColor currentPlayer) { var coordinates = _cursor.getCoordinates(); var piece = _grid[coordinates.Item1, coordinates.Item2]; var isCurrentPlayerPiece = piece.Color == currentPlayer; if (isCurrentPlayerPiece) { var validMoveOptions = _filterValidMoves(piece); PieceSelection = new PieceSelection(piece, validMoveOptions); } else { PieceSelection = NullPieceSelection.GetInstance(); } }