I am making my first app in android, and am trying to deal with how to save changes the user makes to certain object variables in an interactive fiction game.
In the game, there are three main classes: Room, Item, and Player. Each class contains many attributes (i.e. booleans, strings, and lists) and these attributes can change throughout the course of the game as the player interacts with them, such as if a door is open/closed, or if an unlit lantern is used with a match, it becomes a lit lantern, with changed attributes. As of now, I've placed all the objects within the main activity class, and changed attributes simply by coding something like "shedDoor.isopen = false" within various methods. That's worked fine until now.
I ignored dealing with any kind of save function as I'm a beginner and assumed it would be simple to implement, but now that I've nearly completed the game I realize it's much more difficult to deal with than I thought.
So, my question is, "What is the best way to store my game data so that changes persist even after the app is killed?" I plan to have a load and save button for the user to bring them back to their place in the game, as well as a new game button if they want to start over from the beginning. I've looked at sharedPreferences, but I'm not sure that would work with multiple classes of different data types.
My intuition leads me to believe that making an SQLite database would be a way to go, but I would have to overhaul a lot of my coding to implement that and wanted to get some more expert advice before starting such a big undertaking.
As always, thanks for helping a beginner.