Skip to content


Save/load for Pedestrians #20

jefflunt opened this Issue · 3 comments

1 participant


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.

@jefflunt jefflunt added a commit that referenced this issue
@jefflunt 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.
@jefflunt jefflunt added a commit that referenced this issue
@jefflunt References #20 - Basic save/load methods are in place and tested. Nee…
…d to add UI elements and actualy saving/loading of Pedestrians.
@jefflunt jefflunt closed this in 3df08f8

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.