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

54 lines
1.3 KiB
C
Raw Normal View History

2025-01-04 16:41:49 +00:00
// © 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"
2025-01-04 16:41:49 +00:00
/**
* 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;
2025-01-04 16:41:49 +00:00
//~ Begin AActor interface
virtual void PostInitializeComponents() override;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
2025-01-04 16:41:49 +00:00
//~ 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;
2025-01-09 23:05:57 +00:00
void SetPawnData(const class UOLSPawnDataAsset* pawnData);
protected:
UFUNCTION()
void OnRep_PawnData();
protected:
UPROPERTY(ReplicatedUsing = OnRep_PawnData)
2025-01-09 23:05:57 +00:00
TObjectPtr<const class UOLSPawnDataAsset> PawnData = nullptr;
2025-01-04 16:41:49 +00:00
};