A board manager structure might be useful for both server and client.
Board manager stores unlimited amount of boards. Each board should run in parallel.
It also should be capable of returning current board's state:
Occupied cells
Current piece
Held piece
Incoming garbage
Stats (APM, PPS, etc)
...
By default each board is disabled, which means that the match is not started yet. And the match may be started at any time when the manager receives a particular command.
An outdated and commented example can be found here
A board manager structure might be useful for both server and client.
Board manager stores unlimited amount of boards. Each board should run in parallel.
It also should be capable of returning current board's state:
By default each board is disabled, which means that the match is not started yet. And the match may be started at any time when the manager receives a particular command.
An outdated and commented example can be found here