5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
7#include "PlayerStateComponentBase.generated.h"
12UCLASS(ClassGroup=(
Custom), meta=(BlueprintSpawnableComponent))
13class BASEHELPERS_API UPlayerStateComponentBase :
public UActorComponent
18 UPlayerStateComponentBase();
21 T* GetPlayerState()
const
23 static_assert(TPointerIsConvertibleFromTo<T, APlayerState>::Value,
"'T' template parameter to GetPlayerState must be derived from APlayerState");
24 return Cast<T>(GetOwner());
27 T* GetPlayerStateChecked()
const
29 static_assert(TPointerIsConvertibleFromTo<T, APlayerState>::Value,
"'T' template parameter to GetPlayerStateChecked must be derived from APlayerState");
30 return CastChecked<T>(GetOwner());
40 static_assert(TPointerIsConvertibleFromTo<T, APawn>::Value,
"'T' template parameter to GetPawn must be derived from APawn");
41 return GetPlayerStateChecked<APlayerState>()->GetPawn<T>();
44 T* GetGameInstance()
const
46 static_assert(TPointerIsConvertibleFromTo<T, UGameInstance>::Value,
"'T' template parameter to GetGameInstance must be derived from UGameInstance");
47 AActor*
Owner = GetOwner();
48 return Owner ?
Owner->GetGameInstance<T>() : nullptr;
51 T* GetGameInstanceChecked()
const
53 static_assert(TPointerIsConvertibleFromTo<T, UGameInstance>::Value,
"'T' template parameter to GetGameInstance must be derived from UGameInstance");
54 AActor*
Owner = GetOwner();
56 T* GameInstance =
Owner->GetGameInstance<T>();
62 bool HasAuthority()
const;
65 class FTimerManager& GetWorldTimerManager()
const;
68 virtual void BeginPlay()
override;
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13