//----------------- //getter public Board GetBoard() { if (currentPiece == null) { return(board); } Board tempBoard = new Board(board); if (currentPiece != null) { //draws Piece on the board foreach (Piece current in currentPiece.Blocks()) { tempBoard[current] = currentPiece.getColor(); } } return(tempBoard); }
public Board GetNextPiece() { Board output = new Board(); //handle nextPiece not beeing set if (nextPiece == null) { output[Tuple.Create(0, 0)] = '.'; return(output); } foreach (Piece current in nextPiece.Blocks()) { int x = current.Item1 - nextPiece.getPosition().Item1; int y = current.Item2 - nextPiece.getPosition().Item2; output[Tuple.Create(x, y)] = nextPiece.getColor(); } return(output); }