// Copyright (c) 2024 Codemongous LLC. All Rights Reserved.

#include "SCW_FBPVariableDescription.h"
#include "Engine/Blueprint.h"
#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_FBPVariableDescription::SCW_FBPVariableDescription(FBPVariableDescription* InBPVariableDescription) : BPVariableDescription(InBPVariableDescription)
{

}

FBPVariableDescription* SCW_FBPVariableDescription::ToFBPVariableDescription() const
{
	return BPVariableDescription;
}

wstring SCW_FBPVariableDescription::DefaultValue() const
{
	return TCHAR_TO_WCHAR(*BPVariableDescription->DefaultValue);
}

void SCW_FBPVariableDescription::SetDefaultValue(const wstring& InDefaultValue)
{
	BPVariableDescription->DefaultValue = InDefaultValue.c_str();
}

SCW_FGuid SCW_FBPVariableDescription::GetVarGuid() const
{
	SCW_FGuid Guid;
	Guid.A = BPVariableDescription->VarGuid.A;
	Guid.B = BPVariableDescription->VarGuid.B;
	Guid.C = BPVariableDescription->VarGuid.C;
	Guid.D = BPVariableDescription->VarGuid.D;
	return Guid;
}

ISCW_FEdGraphPinTypePtr SCW_FBPVariableDescription::GetVarType() const
{
	return FSourcifyCoreUEWrapper::Get().Wrap(BPVariableDescription->VarType);
}

wstring SCW_FBPVariableDescription::VarName() const
{
	return TCHAR_TO_WCHAR(*BPVariableDescription->VarName.ToString());
}
