RealtimeStyleTransferRuntime/Source/LyraGame/GameFeatures/LyraGameFeaturePolicy.h

68 lines
2.3 KiB
C
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
2022-09-13 07:18:28 +00:00
#include "Containers/Array.h"
#include "Containers/UnrealString.h"
2022-05-23 18:41:30 +00:00
#include "GameFeatureStateChangeObserver.h"
2022-09-13 07:18:28 +00:00
#include "GameFeaturesProjectPolicies.h"
#include "UObject/Object.h"
#include "UObject/ObjectPtr.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraGameFeaturePolicy.generated.h"
2022-09-13 07:18:28 +00:00
class FName;
2022-05-23 18:41:30 +00:00
class UGameFeatureData;
2022-09-13 07:18:28 +00:00
struct FPrimaryAssetId;
2022-05-23 18:41:30 +00:00
/**
* Manager to keep track of the state machines that bring a game feature plugin into memory and active
* This class discovers plugins either that are built-in and distributed with the game or are reported externally (i.e. by a web service or other endpoint)
*/
UCLASS(MinimalAPI, Config = Game)
class ULyraGameFeaturePolicy : public UDefaultGameFeaturesProjectPolicies
{
GENERATED_BODY()
public:
LYRAGAME_API static ULyraGameFeaturePolicy& Get();
ULyraGameFeaturePolicy(const FObjectInitializer& ObjectInitializer);
//~UGameFeaturesProjectPolicies interface
virtual void InitGameFeatureManager() override;
virtual void ShutdownGameFeatureManager() override;
2022-09-13 07:18:28 +00:00
virtual TArray<FPrimaryAssetId> GetPreloadAssetListForGameFeature(const UGameFeatureData* GameFeatureToLoad, bool bIncludeLoadedAssets = false) const override;
2022-05-23 18:41:30 +00:00
virtual bool IsPluginAllowed(const FString& PluginURL) const override;
virtual const TArray<FName> GetPreloadBundleStateForGameFeature() const override;
virtual void GetGameFeatureLoadingMode(bool& bLoadClientData, bool& bLoadServerData) const override;
//~End of UGameFeaturesProjectPolicies interface
private:
UPROPERTY(Transient)
TArray<TObjectPtr<UObject>> Observers;
};
// checked
UCLASS()
class ULyraGameFeature_HotfixManager : public UObject, public IGameFeatureStateChangeObserver
{
GENERATED_BODY()
public:
virtual void OnGameFeatureLoading(const UGameFeatureData* GameFeatureData, const FString& PluginURL) override;
};
// checked
UCLASS()
class ULyraGameFeature_AddGameplayCuePaths : public UObject, public IGameFeatureStateChangeObserver
{
GENERATED_BODY()
public:
virtual void OnGameFeatureRegistering(const UGameFeatureData* GameFeatureData, const FString& PluginName, const FString& PluginURL) override;
virtual void OnGameFeatureUnregistering(const UGameFeatureData* GameFeatureData, const FString& PluginName, const FString& PluginURL) override;
};