// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action. #pragma once #include "CoreMinimal.h" #include "ModularGameplayActors/OLSModularPlayerState.h" #include "OLSPlayerState.generated.h" /** * AOLSPlayerState * * Base player state class used by this project. */ UCLASS(Config = Game) class OLS_API AOLSPlayerState : public AOLSModularPlayerState { GENERATED_BODY() public: AOLSPlayerState(const FObjectInitializer& objectInitializer); static const FName NAME_OLSAbilityReady; //~ Begin AActor interface virtual void PostInitializeComponents() override; virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; //~ End AActor interface public: UFUNCTION(BlueprintCallable, Category = "OLS|PlayerState") class AOLSPlayerController* GetOLSPlayerController() const; UFUNCTION(BlueprintCallable, Category = "OLS|PlayerState") class UOLSAbilitySystemComponent* GetOLSAbilitySystemComponent() const; template const T* GetPawnData() const; void SetPawnData(const class UOLSPawnDataAsset* pawnData); protected: UFUNCTION() void OnRep_PawnData(); protected: UPROPERTY(ReplicatedUsing = OnRep_PawnData) TObjectPtr PawnData = nullptr; };