Detect Game End
samuelpilz opened this issue · comments
Samuel Pilz commented
The server should detect if the game has ended and send that info to the client.
Samuel Pilz commented
@fendor Where to include the information that the game has ended?
Possibilities: (please make suggestions)
for sending info to client, it may be sensible to create an own view GameOverView
- flag in gameState (makes illigal state representable)
- update Signature of
updateState
to include Game-Over as possible return type
fendor commented
Are you against different messages for different information?
For example, I was thinking to refactor the whole communication process to something like that:
data ServerMessage
= GameView ...
| GameOver ...
| InvalidMove ...
| StartGame ...
data ClientMessage
= MoveTo ...
| WhoseTurnIsIt
| Reconnect ...
| GetView
Samuel Pilz commented
This is implemented in the branch game-over-state
. A pull request will close this issue