RealtimeStyleTransferRuntime/Source/LyraGame/GameFeatures/GameFeatureAction_WorldActi...

45 lines
1.4 KiB
C
Raw 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/Map.h"
2022-05-23 18:41:30 +00:00
#include "GameFeatureAction.h"
#include "GameFeaturesSubsystem.h"
2022-09-13 07:18:28 +00:00
#include "Misc/AssertionMacros.h"
#include "Misc/CoreMiscDefines.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "GameFeatureAction_WorldActionBase.generated.h"
2022-09-13 07:18:28 +00:00
class FDelegateHandle;
2022-05-23 18:41:30 +00:00
class UGameInstance;
2022-09-13 07:18:28 +00:00
class UObject;
struct FGameFeatureActivatingContext;
struct FGameFeatureDeactivatingContext;
struct FGameFeatureStateChangeContext;
2022-05-23 18:41:30 +00:00
struct FWorldContext;
/**
* Base class for GameFeatureActions that wish to do something world specific.
*/
UCLASS(Abstract)
class UGameFeatureAction_WorldActionBase : public UGameFeatureAction
{
GENERATED_BODY()
public:
//~ Begin UGameFeatureAction interface
virtual void OnGameFeatureActivating(FGameFeatureActivatingContext& Context) override;
virtual void OnGameFeatureDeactivating(FGameFeatureDeactivatingContext& Context) override;
//~ End UGameFeatureAction interface
private:
void HandleGameInstanceStart(UGameInstance* GameInstance, FGameFeatureStateChangeContext ChangeContext);
/** Override with the action-specific logic */
virtual void AddToWorld(const FWorldContext& WorldContext, const FGameFeatureStateChangeContext& ChangeContext) PURE_VIRTUAL(UGameFeatureAction_WorldActionBase::AddToWorld,);
private:
TMap<FGameFeatureStateChangeContext, FDelegateHandle> GameInstanceStartHandles;
};