ALimenObjective
Overview
ALimenObjective is an abstract class that manages objective data, binds to a player controller and pawn, and handles various lifecycle events related to objectives. It provides functionality for starting, completing, resetting, and loading objectives.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FName | UniqueName | EditDefaultsOnly | The unique name of the objective. |
FText | Title | EditDefaultsOnly | The title of the objective. |
FText | Description | EditDefaultsOnly | The description of the objective. |
TObjectPtr | BoundPlayerController | Private | The player controller to which the objective is bound. |
TObjectPtr | BoundPawn | Private | The pawn to which the objective is bound. |
FObjectiveData | ObjectiveData | SaveGame | The current state and data of the objective. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | operator=(const FObjectiveData& Other) | Assignment operator for |
void | BindToPlayer(APlayerController* PlayerController, APawn* Pawn) | Binds the objective to a player controller and pawn. |
void | BindToCurrentPlayer() | Binds the objective to the current player controller. |
const FObjectiveData& | GetObjectiveData() const | Returns the current state of the objective data. |
APlayerController* | GetBoundPlayerController() const | Returns the bound player controller. |
APawn* | GetBoundPawn() const | Returns the bound pawn. |
void | LoadObjectiveForPlayer(APlayerController* PlayerController, APawn* Pawn, const FObjectiveData& NewData) | Loads objective data for a player. |
bool | IsCompleted() const | Checks if the objective is completed. |
const FObjectiveData& | GetData() const | Returns the current state of the objective data. |
void | ResetObjective() | Resets the objective to its initial state. |
bool | ShouldSaveData() const | Determines if the objective data should be saved. |
bool | ShouldLoadData() const | Determines if the objective data should be loaded. |
void | PreDataSaved() | Called before saving the objective data. |
void | PostDataSaved() | Called after saving the objective data. |
void | PreDataLoaded() | Called before loading the objective data. |
void | PostDataLoaded() | Called after loading the objective data. |
FName | GetUniqueDeterministicId() const | Returns a unique, deterministic ID for the objective. |
void | CompleteObjective() | Completes the objective and notifies bound player controller and pawn. |
void | Start() override | Initializes the objective with default values. |
Usage & Implementation Notes
The
BindToPlayerfunction prevents starting the same objective twice.The
CompleteObjectivefunction updates the objective state to completed and notifies relevant delegates.The
ResetObjectivefunction resets the objective data and clears bindings.The class implements
ILimenSaveObjectInterfacefor saving and loading objective data.