Download LyraStarterGame/Source/LyraGame/Player/LyraPlayerState.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 5.94 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Player/LyraPlayerState.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Player/LyraPlayerState.h
-
curl -L -o LyraPlayerState.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Player/LyraPlayerState.h
5.94 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| struct FLyraVerbMessage; | |
| class AController; | |
| class ALyraPlayerController; | |
| class APlayerState; | |
| class FName; | |
| class UAbilitySystemComponent; | |
| class ULyraAbilitySystemComponent; | |
| class ULyraExperienceDefinition; | |
| class ULyraPawnData; | |
| class UObject; | |
| struct FFrame; | |
| struct FGameplayTag; | |
| /** Defines the types of client connected */ | |
| UENUM() | |
| enum class ELyraPlayerConnectionType : uint8 | |
| { | |
| // An active player | |
| Player = 0, | |
| // Spectator connected to a running game | |
| LiveSpectator, | |
| // Spectating a demo recording offline | |
| ReplaySpectator, | |
| // A deactivated player (disconnected) | |
| InactivePlayer | |
| }; | |
| /** | |
| * ALyraPlayerState | |
| * | |
| * Base player state class used by this project. | |
| */ | |
| UCLASS(MinimalAPI, Config = Game) | |
| class ALyraPlayerState : public AModularPlayerState, public IAbilitySystemInterface, public ILyraTeamAgentInterface | |
| { | |
| GENERATED_BODY() | |
| public: | |
| UE_API ALyraPlayerState(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerState") | |
| UE_API ALyraPlayerController* GetLyraPlayerController() const; | |
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerState") | |
| ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const { return AbilitySystemComponent; } | |
| UE_API virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; | |
| template <class T> | |
| const T* GetPawnData() const { return Cast<T>(PawnData); } | |
| UE_API void SetPawnData(const ULyraPawnData* InPawnData); | |
| //~AActor interface | |
| UE_API virtual void PreInitializeComponents() override; | |
| UE_API virtual void PostInitializeComponents() override; | |
| //~End of AActor interface | |
| //~APlayerState interface | |
| UE_API virtual void Reset() override; | |
| UE_API virtual void ClientInitialize(AController* C) override; | |
| UE_API virtual void CopyProperties(APlayerState* PlayerState) override; | |
| UE_API virtual void OnDeactivated() override; | |
| UE_API virtual void OnReactivated() override; | |
| //~End of APlayerState interface | |
| //~ILyraTeamAgentInterface interface | |
| UE_API virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override; | |
| UE_API virtual FGenericTeamId GetGenericTeamId() const override; | |
| UE_API virtual FOnLyraTeamIndexChangedDelegate* GetOnTeamIndexChangedDelegate() override; | |
| //~End of ILyraTeamAgentInterface interface | |
| static UE_API const FName NAME_LyraAbilityReady; | |
| UE_API void SetPlayerConnectionType(ELyraPlayerConnectionType NewType); | |
| ELyraPlayerConnectionType GetPlayerConnectionType() const { return MyPlayerConnectionType; } | |
| /** Returns the Squad ID of the squad the player belongs to. */ | |
| UFUNCTION(BlueprintCallable) | |
| int32 GetSquadId() const | |
| { | |
| return MySquadID; | |
| } | |
| /** Returns the Team ID of the team the player belongs to. */ | |
| UFUNCTION(BlueprintCallable) | |
| int32 GetTeamId() const | |
| { | |
| return GenericTeamIdToInteger(MyTeamID); | |
| } | |
| UE_API void SetSquadID(int32 NewSquadID); | |
| // Adds a specified number of stacks to the tag (does nothing if StackCount is below 1) | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Teams) | |
| UE_API void AddStatTagStack(FGameplayTag Tag, int32 StackCount); | |
| // Removes a specified number of stacks from the tag (does nothing if StackCount is below 1) | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Teams) | |
| UE_API void RemoveStatTagStack(FGameplayTag Tag, int32 StackCount); | |
| // Returns the stack count of the specified tag (or 0 if the tag is not present) | |
| UFUNCTION(BlueprintCallable, Category=Teams) | |
| UE_API int32 GetStatTagStackCount(FGameplayTag Tag) const; | |
| // Returns true if there is at least one stack of the specified tag | |
| UFUNCTION(BlueprintCallable, Category=Teams) | |
| UE_API bool HasStatTag(FGameplayTag Tag) const; | |
| // Send a message to just this player | |
| // (use only for client notifications like accolades, quest toasts, etc... that can handle being occasionally lost) | |
| UFUNCTION(Client, Unreliable, BlueprintCallable, Category = "Lyra|PlayerState") | |
| UE_API void ClientBroadcastMessage(const FLyraVerbMessage Message); | |
| // Gets the replicated view rotation of this player, used for spectating | |
| UE_API FRotator GetReplicatedViewRotation() const; | |
| // Sets the replicated view rotation, only valid on the server | |
| UE_API void SetReplicatedViewRotation(const FRotator& NewRotation); | |
| private: | |
| UE_API void OnExperienceLoaded(const ULyraExperienceDefinition* CurrentExperience); | |
| protected: | |
| UFUNCTION() | |
| UE_API void OnRep_PawnData(); | |
| protected: | |
| UPROPERTY(ReplicatedUsing = OnRep_PawnData) | |
| TObjectPtr<const ULyraPawnData> PawnData; | |
| private: | |
| // The ability system component sub-object used by player characters. | |
| UPROPERTY(VisibleAnywhere, Category = "Lyra|PlayerState") | |
| TObjectPtr<ULyraAbilitySystemComponent> AbilitySystemComponent; | |
| // Health attribute set used by this actor. | |
| UPROPERTY() | |
| TObjectPtr<const class ULyraHealthSet> HealthSet; | |
| // Combat attribute set used by this actor. | |
| UPROPERTY() | |
| TObjectPtr<const class ULyraCombatSet> CombatSet; | |
| UPROPERTY(Replicated) | |
| ELyraPlayerConnectionType MyPlayerConnectionType; | |
| UPROPERTY() | |
| FOnLyraTeamIndexChangedDelegate OnTeamChangedDelegate; | |
| UPROPERTY(ReplicatedUsing=OnRep_MyTeamID) | |
| FGenericTeamId MyTeamID; | |
| UPROPERTY(ReplicatedUsing=OnRep_MySquadID) | |
| int32 MySquadID; | |
| UPROPERTY(Replicated) | |
| FGameplayTagStackContainer StatTags; | |
| UPROPERTY(Replicated) | |
| FRotator ReplicatedViewRotation; | |
| private: | |
| UFUNCTION() | |
| UE_API void OnRep_MyTeamID(FGenericTeamId OldTeamID); | |
| UFUNCTION() | |
| UE_API void OnRep_MySquadID(); | |
| }; | |