RealtimeStyleTransferRuntime/Plugins/GameSettings/Source/Private/DataSource/GameSettingDataSourceDynami...

42 lines
1.2 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "DataSource/GameSettingDataSourceDynamic.h"
2022-09-13 07:18:28 +00:00
2022-05-23 18:41:30 +00:00
#include "Engine/LocalPlayer.h"
2022-09-13 07:18:28 +00:00
#include "Misc/AssertionMacros.h"
2022-05-23 18:41:30 +00:00
//--------------------------------------
// FGameSettingDataSourceDynamic
//--------------------------------------
FGameSettingDataSourceDynamic::FGameSettingDataSourceDynamic(const TArray<FString>& InDynamicPath)
: DynamicPath(InDynamicPath)
{
}
bool FGameSettingDataSourceDynamic::Resolve(ULocalPlayer* InLocalPlayer)
{
return DynamicPath.Resolve(InLocalPlayer);
}
FString FGameSettingDataSourceDynamic::GetValueAsString(ULocalPlayer* InLocalPlayer) const
{
FString OutStringValue;
const bool bSuccess = PropertyPathHelpers::GetPropertyValueAsString(InLocalPlayer, DynamicPath, OutStringValue);
ensure(bSuccess);
return OutStringValue;
}
void FGameSettingDataSourceDynamic::SetValue(ULocalPlayer* InLocalPlayer, const FString& InStringValue)
{
const bool bSuccess = PropertyPathHelpers::SetPropertyValueFromString(InLocalPlayer, DynamicPath, InStringValue);
ensure(bSuccess);
}
FString FGameSettingDataSourceDynamic::ToString() const
{
return DynamicPath.ToString();
}