so I am slightly confused: The board is a double array of
PieceType entries with
null indicating an empty field. Now obviously pieces can not be stored on the board permanently because once a row gets deleted the pieces get destroyed (In particular you can’t call
removePiece on the remains of an
L piece for example, that would make no sense). The exception to that should be the current piece which is “falling”. Once it hits the ground it “dissolves” into a part of the board.
So is there any limit on adding or removing pieces? The way I understand it the game flow is modeled by adding a falling piece and then to simulate falling and rotating by removing it and either placing a copy one field below or a rotation on the same field. In particular all valid sequences of adding and removing (symbolized by
- here) should be of the form
+(-+)*, i.e. you always start by adding something and move/rotate it by removing/readding it.