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

#include "SCW_ULevel.h"
#include "Engine/Level.h"
#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_ULevel::SCW_ULevel(ULevel* InLevel) : SCW_UObject(InLevel), Level(InLevel)
{

}

ULevel* SCW_ULevel::ToULevel() const
{
	return Level;
}

ISCW_ULevelPtr SCW_ULevel::ToULevelPtr()
{
	return GetSharedThisAs<SCW_ULevel>();
}

ISCW_ULevelConstPtr SCW_ULevel::ToULevelPtr() const
{
	return GetSharedThisAs<SCW_ULevel>();
}

ISCW_ULevelScriptBlueprintPtr SCW_ULevel::GetLevelScriptBlueprint() const
{
	return Level->LevelScriptBlueprint ? FSourcifyCoreUEWrapper::Get().Wrap(*Level->LevelScriptBlueprint) : nullptr;
}