Download LyraStarterGame/Source/LyraGame/Teams/LyraTeamCreationComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.03 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Teams/LyraTeamCreationComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Teams/LyraTeamCreationComponent.h
-
curl -L -o LyraTeamCreationComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Teams/LyraTeamCreationComponent.h
2.03 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class ULyraExperienceDefinition; | |
| class ALyraTeamPublicInfo; | |
| class ALyraTeamPrivateInfo; | |
| class ALyraPlayerState; | |
| class AGameModeBase; | |
| class APlayerController; | |
| class ULyraTeamDisplayAsset; | |
| UCLASS(Blueprintable) | |
| class ULyraTeamCreationComponent : public UGameStateComponent | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraTeamCreationComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| //~UObject interface | |
| virtual EDataValidationResult IsDataValid(class FDataValidationContext& Context) const override; | |
| //~End of UObject interface | |
| //~UActorComponent interface | |
| virtual void BeginPlay() override; | |
| //~End of UActorComponent interface | |
| private: | |
| void OnExperienceLoaded(const ULyraExperienceDefinition* Experience); | |
| protected: | |
| // List of teams to create (id to display asset mapping, the display asset can be left unset if desired) | |
| UPROPERTY(EditDefaultsOnly, Category = Teams) | |
| TMap<uint8, TObjectPtr<ULyraTeamDisplayAsset>> TeamsToCreate; | |
| UPROPERTY(EditDefaultsOnly, Category=Teams) | |
| TSubclassOf<ALyraTeamPublicInfo> PublicTeamInfoClass; | |
| UPROPERTY(EditDefaultsOnly, Category=Teams) | |
| TSubclassOf<ALyraTeamPrivateInfo> PrivateTeamInfoClass; | |
| protected: | |
| virtual void ServerCreateTeams(); | |
| virtual void ServerAssignPlayersToTeams(); | |
| /** Sets the team ID for the given player state. Spectator-only player states will be stripped of any team association. */ | |
| virtual void ServerChooseTeamForPlayer(ALyraPlayerState* PS); | |
| private: | |
| void OnPlayerInitialized(AGameModeBase* GameMode, AController* NewPlayer); | |
| void ServerCreateTeam(int32 TeamId, ULyraTeamDisplayAsset* DisplayAsset); | |
| /** returns the Team ID with the fewest active players, or INDEX_NONE if there are no valid teams */ | |
| int32 GetLeastPopulatedTeamID() const; | |
| }; | |