Package com.csse3200.game.persistence
Class Persistence
java.lang.Object
com.csse3200.game.persistence.Persistence
Class for loading and saving the user profile / savefile.
Save files should be in the format <profilename>$<unixtime>$<slot>.json
.
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new user profile.fetch()
Fetch saves organized by slot.Load a user profile from a savefile.static void
Save the current user profile to a specific slot.
-
Method Details
-
load
Load a user profile from a savefile.- Parameters:
save
- the savefile object- Returns:
- the profile and the slot
-
create
Create a new user profile.- Parameters:
profileName
- the name of the profile, or null to use the default nameslot
- the slot to save the profile to- Returns:
- the profile and the slot
-
fetch
Fetch saves organized by slot.- Returns:
- the list of savefiles
-
save
Save the current user profile to a specific slot.- Parameters:
slot
- the slot to save the profile toprofile
- the profile to save
-