ALimenSaveableHintsManager
Overview
ALimenSaveableHintsManager inherits from ALimenHintsManager and implements the ILimenSaveObjectInterface. It manages the saving and loading of hint classes, ensuring that only relevant hints are persisted between sessions. The manager handles the lifecycle events for data persistence and initializes hints upon loading saved data.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TArray | SavedHintClasses | SaveGame | Array of soft class paths representing the hint classes to be saved. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | BeginPlay() | Initializes the manager and saves hints if game data has not been loaded yet. |
bool | ShouldLoadData() const | Always returns true, indicating that data should always be loaded. |
void | PreDataSaved() | No-op function. |
bool | ShouldSaveData() const | Always returns true, indicating that data should always be saved. |
void | PostDataLoaded() | Loads saved hints and sets up stale hint removal. |
FName | GetUniqueDeterministicId() const | Returns |
void | PostDataSaved() | No-op function. |
void | PreDataLoaded() | No-op function. |
void | LoadSavedHints() | Loads saved hint classes and initializes hints, setting up a lambda to remove stale hints when dismissed. |
void | SaveHints() | Saves the current hint classes by converting them to soft class paths and initializing hints. |
void | SetupRemoveStaleHints() | Sets up a lambda to remove stale hints from |
Usage & Implementation Notes
The manager ensures that only hints with saved data are initialized, preventing unnecessary initialization of hints that were not previously saved.
The use of soft class paths (
FSoftClassPath) allows for the persistence of hint classes without requiring them to be loaded into memory at all times.The lambda functions added to
OnHintDismissedensure that stale hints are removed from the save data when they are dismissed, maintaining consistency between the saved and active states.