ALimenGameplayManager
Overview
ALimenGameplayManager is an abstract, blueprintable class derived from AInfo. It provides a framework for managing gameplay logic associated with specific game modes or contexts. The class includes methods for initializing, binding game modes, registering actors, and handling notifications. Derived classes should implement game-specific logic using the provided virtual functions and Blueprint extension points.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| ActorsRegistrations | Private | A map of gameplay tag to registration function for actors. |
| GameModeWeakPtr | Protected | A weak pointer to the associated game mode. |
| bHasInitialized | Private | Indicates whether the manager has been initialized. |
Functions
Return Type | Signature | Description |
|---|---|---|
| GetGameplayManager(UObject* WorldContextObject, TSubclassOf ManagerClass) | Retrieves a gameplay manager instance of the specified class from the given world context. |
| GetGameplayManager(UObject* WorldContextObject) | Retrieves an instance of the specified gameplay manager class for the given world context. |
| Constructor | Initializes a new instance of |
| Override | Called after all components have been initialized. |
| Public | Binds the specified GameMode instance to this gameplay manager. |
| Override | Notifies registered actors about a specific event or tag. |
| Public | Checks whether the gameplay manager has been initialized. |
| Public | Retrieves the GameMode associated with this Gameplay Manager. |
| Override | Registers actors based on gameplay tags. |
| Public | Adds or replaces a registration function for a specific tag. |
| AddOrReplaceRegistration(const FGameplayTag& Id, const TFunction<void(T*)>& RegistrationFunction) | Template version of |
| AddOrReplaceRegistration(const FGameplayTag& Id, TWeakObjectPtr * OutPtr) | |
| AddOrReplaceRegistration(const FGameplayTag& Id, ObjectType* Object, TMemFunPtrType<false, ObjectType, void(RegisteredActorType*)>::Type RegistrationFunction) | Template version of |
| Override | Starts the gameplay manager logic. |
| Override | Determines whether this instance of the gameplay manager can start. |
| BP_Start() | Blueprint event triggered when the gameplay manager is initialized and its logic has started. |
Usage & Implementation Notes
The class uses a weak pointer for the game mode to avoid strong references that could prevent garbage collection.
The
PostInitializeComponentsmethod ensures the manager is initialized correctly or destroyed if it cannot start.The
RegisterActorsmethod can be overridden by derived classes to register specific actors based on gameplay tags.The
AddOrReplaceRegistrationmethods provide flexibility in registering and managing actor notifications.