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

#include "SCW_UBlackboardData.h"
#include "BehaviorTree/BlackboardData.h"
#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_UBlackboardData::SCW_UBlackboardData(UBlackboardData* InBlackboardData) : SCW_UDataAsset(InBlackboardData), BlackboardData(InBlackboardData)
{

}

UBlackboardData* SCW_UBlackboardData::ToUBlackboardData() const
{
	return BlackboardData;
}

ISCW_UBlackboardDataPtr SCW_UBlackboardData::ToUBlackboardDataPtr()
{
	return GetSharedThisAs<SCW_UBlackboardData>();
}

ISCW_UBlackboardDataConstPtr SCW_UBlackboardData::ToUBlackboardDataPtr() const
{
	return GetSharedThisAs<SCW_UBlackboardData>();
}

vector<ISCW_FBlackboardEntryPtr> SCW_UBlackboardData::GetKeys() const
{
	vector<ISCW_FBlackboardEntryPtr> result;
	for (FBlackboardEntry& entry : BlackboardData->Keys)
	{
		result.push_back(FSourcifyCoreUEWrapper::Get().Wrap(entry));
	}
	return result;
}