/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */
#include "GraphEditor/InworldGraphFactory.h"
#include "Graph/Assets/InworldGraphAsset.h"
#include "Kismet2/KismetEditorUtilities.h"
#include "Graph/InworldGraph.h"

#define LOCTEXT_NAMESPACE "InworldGraphFactory"


UInworldGraphFactory::UInworldGraphFactory()
{
	bCreateNew = true;
	bEditAfterNew = true;
	SupportedClass = UInworldGraphAsset::StaticClass();
}

UObject* UInworldGraphFactory::FactoryCreateNew(
	UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
	UInworldGraphAsset* GraphAsset = NewObject<UInworldGraphAsset>(InParent, Class, Name, Flags | RF_Transactional);
	GraphAsset->CreateRuntimeGraph(UInworldGraph::StaticClass());	
	return GraphAsset;
}

#undef LOCTEXT_NAMESPACE
