OLS/Source/ols/Public/Player/OLSPlayerState.h

54 lines
1.4 KiB
C++

// © 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<FLifetimeProperty>& 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 <class T>
const T* GetPawnData() const;
void SetPawnData(const class UOLSPawnPrimaryDataAsset* pawnData);
protected:
UFUNCTION()
void OnRep_PawnData();
protected:
UPROPERTY(ReplicatedUsing = OnRep_PawnData)
TObjectPtr<const class UOLSPawnPrimaryDataAsset> PawnData = nullptr;
};