|
Nelaric Unreal Gameplay
Gameplay framework API
|
Optional pawn base implementing the initialization contract. More...
#include <PawnInitStateComponent.h>
Public Member Functions | |
| virtual GAMEPLAYRUNTIME_API bool | IsInitApplicable () const override |
| Participates by default; override for conditional applicability. | |
| virtual GAMEPLAYRUNTIME_API bool | TryChangeInitState () final override |
| Commits at most one adjacent preparation step when the derived gate passes. | |
| virtual GAMEPLAYRUNTIME_API bool | CanEnterReady () final override |
| Runs DataInitialized preparation until it succeeds in this generation. | |
| virtual GAMEPLAYRUNTIME_API bool | CommitReadyWithoutNotification () override |
| Writes Ready without callbacks after the coordinator checks the group. | |
| virtual GAMEPLAYRUNTIME_API void | NotifyReadyCommitted (const Nelaric::FInitStateSnapshot &Previous) override |
| Announces a committed Ready transition after the group commits. | |
| GAMEPLAYRUNTIME_API void | RequestInitRefresh () |
| Requests another local coordinator pass after context changes. | |
| virtual GAMEPLAYRUNTIME_API Nelaric::EInitState | GetInitState () const override |
| Returns the state owned by this component. | |
| virtual GAMEPLAYRUNTIME_API Nelaric::FInitGeneration | GetInitGeneration () const override |
| Returns the current attempt identity owned by this component. | |
| virtual GAMEPLAYRUNTIME_API bool | HasTerminalInitFailure () const override |
| Returns whether this attempt has failed permanently. | |
| GAMEPLAYRUNTIME_API bool | CanApplyInitResult (const UWorld *ExpectedWorld, Nelaric::FInitGeneration ExpectedGeneration) const |
| Checks whether an asynchronous result may update this attempt. | |
| virtual GAMEPLAYRUNTIME_API void | InvalidateInitGeneration () override |
| Invalidates old work, resets state, and announces the new attempt. | |
| virtual GAMEPLAYRUNTIME_API void | MarkTerminalInitFailure () override |
| Records terminal failure and announces it to the world. | |
| Public Member Functions inherited from UNelaricPawnComponent | |
| GAMEPLAYRUNTIME_API APawn * | GetPawn () const |
| Gets the pawn that directly owns this component. | |
| template<typename T> | |
| T * | GetPawn () const |
| Gets the owning pawn as a specific pawn type. | |
| GAMEPLAYRUNTIME_API AController * | GetController () const |
| Gets the pawn's current controller on this machine. | |
| template<typename T> | |
| T * | GetController () const |
| Gets the current controller as a specific controller type. | |
| GAMEPLAYRUNTIME_API APlayerController * | GetPlayerController () const |
| Gets the current controller when it is a player controller. | |
| template<typename T> | |
| T * | GetPlayerController () const |
| Gets the player controller as a specific player controller. | |
| GAMEPLAYRUNTIME_API APlayerState * | GetPlayerState () const |
| Gets player state directly from the owning pawn. | |
| template<typename T> | |
| T * | GetPlayerState () const |
| Gets the pawn's player state as a specific player state type. | |
| GAMEPLAYRUNTIME_API bool | IsLocallyControlled () const |
| Queries the pawn's native local-control semantics. | |
| GAMEPLAYRUNTIME_API bool | IsPlayerControlled () const |
| Queries the pawn's native player-control semantics. | |
Static Public Member Functions | |
| static GAMEPLAYRUNTIME_API UPawnInitStateComponent * | ResolveInitResult (const TWeakObjectPtr< UPawnInitStateComponent > &WeakComponent, const UWorld *ExpectedWorld, Nelaric::FInitGeneration ExpectedGeneration) |
| Resolves a game-thread asynchronous completion for a live attempt. | |
Protected Member Functions | |
| virtual GAMEPLAYRUNTIME_API bool | CanEntryDataAvailable () |
| Acquires this component's data while Registered. | |
| virtual GAMEPLAYRUNTIME_API bool | CanEntryDataInitialized () |
| Initializes this component's available data. | |
| virtual GAMEPLAYRUNTIME_API bool | CanEntryReady () |
| Performs final local preparation before the Ready check. | |
| virtual GAMEPLAYRUNTIME_API void | OnInitReady () |
| Starts gameplay after the entire readiness group entered Ready. | |
| virtual GAMEPLAYRUNTIME_API void | OnInitGenerationInvalidated (const Nelaric::FInitStateSnapshot &Previous) |
| Stops work and gameplay belonging to an invalidated attempt. | |
| virtual GAMEPLAYRUNTIME_API void | CancelInitGenerationWork () |
| Cancels work and removes listeners for an invalidated attempt. | |
Optional pawn base implementing the initialization contract.
Use CanEntry for preparation and OnInitReady for gameplay. The first three return true when their work is complete. Pending stages retry after RequestInitRefresh. Calls use the game thread.
| GAMEPLAYRUNTIME_API bool UPawnInitStateComponent::CanApplyInitResult | ( | const UWorld * | ExpectedWorld, |
| Nelaric::FInitGeneration | ExpectedGeneration ) const |
Checks whether an asynchronous result may update this attempt.
After dispatching a callback to the game thread, resolve its weak component reference and call this with the captured world and generation. Cancellation may not stop work already in flight.
| ExpectedWorld | World captured when work began. |
| ExpectedGeneration | Generation captured when work began. |
|
protectedvirtual |
Cancels work and removes listeners for an invalidated attempt.
Called after the generation changes and before state resets.
|
protectedvirtual |
Acquires this component's data while Registered.
Retry-safe work may run again after a refresh. Defaults to true.
|
protectedvirtual |
Initializes this component's available data.
Retry-safe work may run again after a refresh. Defaults to true.
|
protectedvirtual |
Performs final local preparation before the Ready check.
Retry-safe work may run again until true, then remains complete for this generation. Defaults to true. Gameplay requires Ready.
|
overridevirtual |
Announces a committed Ready transition after the group commits.
| Previous | Snapshot captured before the Ready commit. |
Implements IInitStateParticipantInterface.
|
protectedvirtual |
Stops work and gameplay belonging to an invalidated attempt.
The generation has changed. The old state remains readable. Preparation resumes through the coordinator after the reset.
| Previous | Snapshot before invalidation. |
|
protectedvirtual |
Starts gameplay after the entire readiness group entered Ready.
Called once per Ready entry, after every group member commits.
| GAMEPLAYRUNTIME_API void UPawnInitStateComponent::RequestInitRefresh | ( | ) |
Requests another local coordinator pass after context changes.
Call from a replicated gameplay-data arrival event, such as OnRep, after updating local data used by readiness checks.
|
static |
Resolves a game-thread asynchronous completion for a live attempt.
| WeakComponent | Component captured weakly when work began. |
| ExpectedWorld | World captured when work began. |
| ExpectedGeneration | Generation captured when work began. |