Files
UnrealEngineUWP/Engine/Source/Runtime/ClientPilot/Private/ClientPilotBlackboard.cpp
Chris Gagnon 8fc25ea18e Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 4676797 by Chris Gagnon in Dev-Editor branch]
2019-01-02 14:54:39 -05:00

68 lines
1.4 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "ClientPilotBlackboard.h"
void UClientPilotBlackboard::InitializeFromProfile(FString ProfileCategoryAndName)
{
}
FString UClientPilotBlackboard::GetStringValue(FString KeyName)
{
FString RetVal = TEXT("");
if (Blackboard.Contains(KeyName))
{
RetVal = Blackboard[KeyName];
}
return RetVal;
}
FVector UClientPilotBlackboard::GetVectorValue(FString KeyName)
{
FVector RetVal;
if (Blackboard.Contains(KeyName))
{
RetVal.InitFromString(*Blackboard[KeyName]);
}
return RetVal;
}
float UClientPilotBlackboard::GetFloatValue(FString KeyName)
{
float RetVal = 0.f;
if (Blackboard.Contains(KeyName))
{
RetVal = FCString::Atof(*Blackboard[KeyName]);
}
return RetVal;
}
int UClientPilotBlackboard::GetIntValue(FString KeyName)
{
int RetVal = 0;
if (Blackboard.Contains(KeyName))
{
RetVal = FCString::Atoi(*Blackboard[KeyName]);
}
return RetVal;
}
void UClientPilotBlackboard::AddOrUpdateValue(FString KeyName, float Value)
{
Blackboard.Emplace(KeyName, FString::SanitizeFloat(Value));
}
void UClientPilotBlackboard::AddOrUpdateValue(FString KeyName, int Value)
{
Blackboard.Emplace(KeyName, FString::FromInt(Value));
}
void UClientPilotBlackboard::AddOrUpdateValue(FString KeyName, FString Value)
{
Blackboard.Emplace(KeyName, Value);
}
void UClientPilotBlackboard::AddOrUpdateValue(FString KeyName, FVector Value)
{
Blackboard.Emplace(KeyName, Value.ToString());
}