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

#include "SCW_UK2Node_EditablePinBase.h"

#include "SCW_FUserPinInfo.h"
#include "K2Node_EditablePinBase.h"
#include "SourcifyCoreUEWrapperModule.h"


using namespace Sourcify;

SCW_UK2Node_EditablePinBase::SCW_UK2Node_EditablePinBase(UK2Node_EditablePinBase* InK2Node_EditablePinBase) : SCW_UK2Node(InK2Node_EditablePinBase), K2Node_EditablePinBase(InK2Node_EditablePinBase)
{

}

void SCW_UK2Node_EditablePinBase::ClearUserDefinedPins() const
{
	K2Node_EditablePinBase->UserDefinedPins.Empty();
}

bool SCW_UK2Node_EditablePinBase::GetIsEditable() const
{
	return K2Node_EditablePinBase->bIsEditable;
}

vector<ISCW_FUserPinInfoPtr> SCW_UK2Node_EditablePinBase::GetUserDefinedPins() const
{
	vector<ISCW_FUserPinInfoPtr> UserDefinedPins;
	for (TSharedPtr<FUserPinInfo> UserPinInfo : K2Node_EditablePinBase->UserDefinedPins)
	{
		UserDefinedPins.push_back(FSourcifyCoreUEWrapper::Get().Wrap(*UserPinInfo.Get()));
	}
	return UserDefinedPins;
}

void SCW_UK2Node_EditablePinBase::SetIsEditable(bool InIsEditable)
{
	K2Node_EditablePinBase->bIsEditable = InIsEditable;
}
		
UK2Node_EditablePinBase* SCW_UK2Node_EditablePinBase::ToUK2Node_EditablePinBase() const
{
	return K2Node_EditablePinBase;
}
