stevenocchipinti / poosnooker

0 stars 0 forks source link

Shuffle players #14

Closed stevenocchipinti closed 6 years ago

stevenocchipinti commented 6 years ago

This feature was traditionally used in two cases:

It would be fairly easy to do automatically once a game ends but maybe not for the before case because there is not really a "before the game starts" state, I would probably need to check the game state to make sure no one has any scores yet. In other words a rule like:

Shuffle players only works if all players have no score events following a "game over" event

This is because the "game over" events are added to the history array and not cleared at the end of the game.

Perhaps I need to filter out old games from the history array at read time so:

This could be done in two places:

Alternatively I could allow it at any point throughout the game, but that could potentially disadvantage players who get swapped to follow an aggressive player. The system should probably keep this to luck of the draw.