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

#include "SCW_FEdGraphTerminalType.h"
#include "EdGraph/EdGraphPin.h"
#include "SCW_UObject.h"
#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_FEdGraphTerminalType::SCW_FEdGraphTerminalType(FEdGraphTerminalType* InEdGraphTerminalType) : EdGraphTerminalType(InEdGraphTerminalType)
{

}

bool SCW_FEdGraphTerminalType::ISCW_Equals(ISCW_FEdGraphTerminalTypeConstPtr Other) const
{
	return *EdGraphTerminalType == *dynamic_cast<const SCW_FEdGraphTerminalType*>(Other.get())->ToFEdGraphTerminalType();
}

ISCW_UObjectPtr SCW_FEdGraphTerminalType::GetTerminalSubCategoryObject() const
{
	return EdGraphTerminalType->TerminalSubCategoryObject.IsValid() ? FSourcifyCoreUEWrapper::Get().Wrap(*EdGraphTerminalType->TerminalSubCategoryObject) : nullptr;
}

void SCW_FEdGraphTerminalType::SetTerminalSubCategoryObject(ISCW_UObjectPtr InObjectPtr) const
{
	EdGraphTerminalType->TerminalSubCategoryObject = InObjectPtr ? dynamic_cast<SCW_UObject*>(InObjectPtr.get())->ToUObjectRawPtr() : nullptr;
}

FEdGraphTerminalType* SCW_FEdGraphTerminalType::ToFEdGraphTerminalType() const
{
	return EdGraphTerminalType;
}

ISCW_FEdGraphTerminalTypePtr SCW_FEdGraphTerminalType::ToFEdGraphTerminalTypePtr()
{
	return GetSharedThisAs<SCW_FEdGraphTerminalType>();
}

ISCW_FEdGraphTerminalTypeConstPtr SCW_FEdGraphTerminalType::ToFEdGraphTerminalTypePtr() const
{
	return GetSharedThisAs<SCW_FEdGraphTerminalType>();
}