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

#include "SCW_UUserDefinedStruct.h"
#include "Runtime/Launch/Resources/Version.h"

// UserDefinedStruct.h was moved to StructUtils/UserDefinedStruct.h in UE5.5
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
#include "StructUtils/UserDefinedStruct.h"
#else
#include "Engine/UserDefinedStruct.h"
#endif

#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_UUserDefinedStruct::SCW_UUserDefinedStruct(UUserDefinedStruct* InUserDefinedStruct) : SCW_UScriptStruct(InUserDefinedStruct), UserDefinedStruct(InUserDefinedStruct)
{

}

UUserDefinedStruct* SCW_UUserDefinedStruct::ToUUserDefinedStruct() const
{
	return UserDefinedStruct;
}

ISCW_UUserDefinedStructPtr SCW_UUserDefinedStruct::ToUUserDefinedStructPtr()
{
	return GetSharedThisAs<SCW_UUserDefinedStruct>();
}

ISCW_UUserDefinedStructConstPtr SCW_UUserDefinedStruct::ToUUserDefinedStructPtr() const
{
	return GetSharedThisAs<SCW_UUserDefinedStruct>();
}

ISCW_UObjectPtr SCW_UUserDefinedStruct::GetEditorData() const
{
	return FSourcifyCoreUEWrapper::Get().Wrap(*UserDefinedStruct->EditorData);
}