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

#include "SCW_FSlowTask.h"
#include "Misc/SlowTask.h"
#include "SourcifyCoreUEWrapperModule.h"

using namespace Sourcify;

SCW_FSlowTask::SCW_FSlowTask(FSlowTask* InSlowTask) : SlowTask(InSlowTask)
{

}

FSlowTask* SCW_FSlowTask::ToFSlowTask() const
{
	return SlowTask.Get();
}

ISCW_FSlowTaskPtr SCW_FSlowTask::ToFSlowTaskPtr()
{
	return GetSharedThisAs<SCW_FSlowTask>();
}

ISCW_FSlowTaskConstPtr SCW_FSlowTask::ToFSlowTaskPtr() const
{
	return GetSharedThisAs<SCW_FSlowTask>();
}

void SCW_FSlowTask::Initialize()
{
	SlowTask->Initialize();
}

void SCW_FSlowTask::Destroy()
{
	SlowTask->Destroy();
}

void SCW_FSlowTask::MakeDialog(bool bShowCancelButton, bool bAllowInPIE)
{
	SlowTask->MakeDialog(bShowCancelButton, bAllowInPIE);
}

void SCW_FSlowTask::EnterProgressFrame(float ExpectedWorkThisFrame, const wstring& Text)
{
	SlowTask->EnterProgressFrame(ExpectedWorkThisFrame, FText::FromString(Text.c_str()));
}