joshuaauerbachwatson / unigame

The core client layer for apps that use the unigame server, covering the game-agnostic aspects
0 stars 0 forks source link

Allow the game handle to control the player count range and "solitaire" mode #18

Closed joshuaauerbachwatson closed 1 month ago

joshuaauerbachwatson commented 1 month ago

The current player count stepper runs from 1 to 6 (a trivial change from anyCards range which was 1 to 4. This is regardless of what game is being played, even though some games have minimum or maximum number of players.

It is proposed that the player count stepper should consult the GameHandle which will supply the range of settings.

It is also proposed that games that allow 1 player would essentially be tolerating a "solitaire mode." In solitaire mode, there is no player search and the communicator is not started. The "Connect" button would be replaced by a "Start Playing" button which would just take you to the Setup screen.

joshuaauerbachwatson commented 1 month ago

I've implemented the GameHandle field governing the possible range of numPlayers. I also allowed setupView to be nil, which suppresses the setup phase entirely. Implementing a solitaire mode remains to be done. Also, this change won't be tested until I start using the capability in anyCards.

joshuaauerbachwatson commented 1 month ago

Solitaire mode has been implemented and the changes were verified by updating anyCards to the latest GameHandle. It all appears to work (at least well enough for the moment).