joshuaauerbachwatson / anyCards

Multi-person card game with no built-in rules
Apache License 2.0
0 stars 0 forks source link

App is flaky attempting to play a second game after ending with lost player #51

Open joshuaauerbachwatson opened 2 months ago

joshuaauerbachwatson commented 2 months ago

If a game ends and you respond to the lost player message, the app should return to a "virgin" state where it's possible to start a new game. What I noticed instead was:

  1. Although the remaining player was leader, he did not have a setup button until after he opened the find players dialog.
  2. It seemed that he had lost the ability to save setups, possibly because some remnants of former private cards were left around?
joshuaauerbachwatson commented 1 month ago

The root of the problem is the number of things that have to be reset and the number of interdependencies between them, causing the prepareNewGame function to be quite fragile. What you would really like is for the entire game-playing view controller to reload and re-initialize. This might be possible but is tricky right now because ViewController is the root view controller of the app. I think it would be much more possible to do it that way if the UI were reorganized down the lines of issue joshuaauerbachwatson/unigame-core#5 so that some sort of nav tab view would be the root and the game playing view would then be capable of a complete reload. In fact, I might not want to tackle that issue until after issue joshuaauerbachwatson/unigame-core#6, which is likely to change quite a number of assumptions.