|
|
|
|
| #pragma once
|
|
|
| #include "Subsystems/WorldSubsystem.h"
|
|
|
| #include "LyraTeamSubsystem.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| class AActor;
|
| class ALyraPlayerState;
|
| class ALyraTeamInfoBase;
|
| class ALyraTeamPrivateInfo;
|
| class ALyraTeamPublicInfo;
|
| class FSubsystemCollectionBase;
|
| class ULyraTeamDisplayAsset;
|
| struct FFrame;
|
| struct FGameplayTag;
|
|
|
| DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnLyraTeamDisplayAssetChangedDelegate, const ULyraTeamDisplayAsset*, DisplayAsset);
|
|
|
| USTRUCT()
|
| struct FLyraTeamTrackingInfo
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| UPROPERTY()
|
| TObjectPtr<ALyraTeamPublicInfo> PublicInfo = nullptr;
|
|
|
| UPROPERTY()
|
| TObjectPtr<ALyraTeamPrivateInfo> PrivateInfo = nullptr;
|
|
|
| UPROPERTY()
|
| TObjectPtr<ULyraTeamDisplayAsset> DisplayAsset = nullptr;
|
|
|
| UPROPERTY()
|
| FOnLyraTeamDisplayAssetChangedDelegate OnTeamDisplayAssetChanged;
|
|
|
| public:
|
| void SetTeamInfo(ALyraTeamInfoBase* Info);
|
| void RemoveTeamInfo(ALyraTeamInfoBase* Info);
|
| };
|
|
|
|
|
| UENUM(BlueprintType)
|
| enum class ELyraTeamComparison : uint8
|
| {
|
|
|
| OnSameTeam,
|
|
|
|
|
| DifferentTeams,
|
|
|
|
|
| InvalidArgument
|
| };
|
|
|
|
|
| UCLASS(MinimalAPI)
|
| class ULyraTeamSubsystem : public UWorldSubsystem
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| UE_API ULyraTeamSubsystem();
|
|
|
|
|
| UE_API virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
| UE_API virtual void Deinitialize() override;
|
|
|
|
|
|
|
| UE_API bool RegisterTeamInfo(ALyraTeamInfoBase* TeamInfo);
|
|
|
|
|
| UE_API bool UnregisterTeamInfo(ALyraTeamInfoBase* TeamInfo);
|
|
|
|
|
|
|
| UE_API bool ChangeTeamForActor(AActor* ActorToChange, int32 NewTeamId);
|
|
|
|
|
| UE_API int32 FindTeamFromObject(const UObject* TestObject) const;
|
|
|
|
|
| UE_API const ALyraPlayerState* FindPlayerStateFromActor(const AActor* PossibleTeamActor) const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintPure=false, Category=Teams, meta=(Keywords="Get"))
|
| UE_API void FindTeamFromActor(const UObject* TestActor, bool& bIsPartOfTeam, int32& TeamId) const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintPure=false, Category=Teams, meta=(ExpandEnumAsExecs=ReturnValue))
|
| UE_API ELyraTeamComparison CompareTeams(const UObject* A, const UObject* B, int32& TeamIdA, int32& TeamIdB) const;
|
|
|
|
|
| UE_API ELyraTeamComparison CompareTeams(const UObject* A, const UObject* B) const;
|
|
|
|
|
| UE_API bool CanCauseDamage(const UObject* Instigator, const UObject* Target, bool bAllowDamageToSelf = true) const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Teams)
|
| UE_API void AddTeamTagStack(int32 TeamId, FGameplayTag Tag, int32 StackCount);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Teams)
|
| UE_API void RemoveTeamTagStack(int32 TeamId, FGameplayTag Tag, int32 StackCount);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Teams)
|
| UE_API int32 GetTeamTagStackCount(int32 TeamId, FGameplayTag Tag) const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Teams)
|
| UE_API bool TeamHasTag(int32 TeamId, FGameplayTag Tag) const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Teams)
|
| UE_API bool DoesTeamExist(int32 TeamId) const;
|
|
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Teams)
|
| UE_API ULyraTeamDisplayAsset* GetTeamDisplayAsset(int32 TeamId, int32 ViewerTeamId);
|
|
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = Teams)
|
| UE_API ULyraTeamDisplayAsset* GetEffectiveTeamDisplayAsset(int32 TeamId, UObject* ViewerTeamAgent);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintPure=false, Category=Teams)
|
| UE_API TArray<int32> GetTeamIDs() const;
|
|
|
|
|
| UE_API void NotifyTeamDisplayAssetModified(ULyraTeamDisplayAsset* ModifiedAsset);
|
|
|
|
|
| UE_API FOnLyraTeamDisplayAssetChangedDelegate& GetTeamDisplayAssetChangedDelegate(int32 TeamId);
|
|
|
| private:
|
| UPROPERTY()
|
| TMap<int32, FLyraTeamTrackingInfo> TeamMap;
|
|
|
| FDelegateHandle CheatManagerRegistrationHandle;
|
| };
|
|
|
| #undef UE_API
|
|
|