39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFeatureAction.h"
|
|
#include "GameFeaturesSubsystem.h"
|
|
|
|
#include "OLSGameFeatureAction_WorldActionBase.generated.h"
|
|
|
|
/**
|
|
* Base class for GameFeatureActions that wish to do something world specific.
|
|
*/
|
|
UCLASS(Abstract)
|
|
class OLS_API UOLSGameFeatureAction_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(
|
|
UOLSGameFeatureAction_WorldActionBase::AddToWorld);
|
|
|
|
private:
|
|
|
|
TMap<FGameFeatureStateChangeContext, FDelegateHandle> GameInstanceStartHandles;
|
|
};
|