Implement the ability for a Pedestrian to save their state/history, and for it to be restored from disk/database, whatever.
A shutdown hook should do the trick. Save the list of pedestrians, with their paths, current direction, etc.
Actually, forget the shutdown hook. Here's the design I'd rather see:
1. A "Save" button that allows users to save manually
2. A "Load" button
3. A "Quit" button. If the user hasn't saved, then they are asked if they would like to save at this point. Regardless if they save or not, "Quit" exits the game as its last action.
4. Save the "time of day" as well.
References #20 - "Save/load for Pedestrians"
The save and load functions are implemented, and unit tests in place. However, I need to do some live, functional testing to confirm before considering this closed.
References #20 - Basic save/load methods are in place and tested. Nee…
…d to add UI elements and actualy saving/loading of Pedestrians.
Closes #20 - Confirmed saving and loading of pedestrians between runn…
…ings of the game.
Simplified the design. There's a "Quit" button. When you press it, the state is saved (with all the pedestrians). The file for 4k Pedestrians is only 188k on disk - very small.
There's no asking if the user wants to save - it's automatic. We can worry about state loading and choosing later. The rest really isn't all that important.