Class SessionManager
java.lang.Object
edu.ntnu.idi.idatt.storage.SessionManager
Class for managing user sessions.
Utilizes gson serialization and deserialization to manage player and game state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanloadSession(String playerName) Method for loading a user session by player name.static voidnewSession(Player player, Exchange exchange) Method for setting new session.static voidMethod to remove current session.static voidMethod for saving current session.
-
Constructor Details
-
SessionManager
public SessionManager()
-
-
Method Details
-
newSession
-
saveSession
public static void saveSession()Method for saving current session.- Throws:
RuntimeException- on failed save.
-
loadSession
Method for loading a user session by player name.- Returns:
- if session was found or not.
-
removeSession
public static void removeSession()Method to remove current session.- Throws:
RuntimeException- on failed removal.
-