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

#pragma once

#include <functional>
#include "ISCW_AActor.h"
#include "ISCW_EngineVersionComparison.h"
#include "ISCW_FArrayProperty.h"
#include "ISCW_FBoolProperty.h"
#include "ISCW_FByteProperty.h"
#include "ISCW_FClassProperty.h"
#include "ISCW_FComponentKey.h"
#include "ISCW_FDelegateProperty.h"
#include "ISCW_FDoubleProperty.h"
#include "ISCW_FEnumProperty.h"
#include "ISCW_FFloatProperty.h"
#include "ISCW_FGraphNodeCreator.h"
#include "ISCW_FInterfaceProperty.h"
#include "ISCW_FMapProperty.h"
#include "ISCW_FMetaData.h"
#include "ISCW_FMulticastDelegateProperty.h"
#include "ISCW_FNameProperty.h"
#include "ISCW_FNumericProperty.h"
#include "ISCW_FObjectProperty.h"
#include "ISCW_FObjectPropertyBase.h"
#include "ISCW_FProperty.h"
#include "ISCW_FSetProperty.h"
#include "ISCW_FSlowTask.h"
#include "ISCW_FSoftClassProperty.h"
#include "ISCW_FSoftObjectProperty.h"
#include "ISCW_FStrProperty.h"
#include "ISCW_FStructProperty.h"
#include "ISCW_FSubobjectDataHandle.h"
#include "ISCW_FTextProperty.h"
#include "ISCW_FWeakObjectProperty.h"
#include "ISCW_UActorComponent.h"
#include "ISCW_UBlueprint.h"
#include "ISCW_UBlueprintGeneratedClass.h"
#include "ISCW_UClass.h"
#include "ISCW_UEdGraphNode.h"
#include "ISCW_UField.h"
#include "ISCW_UFunction.h"
#include "ISCW_UGeneralProjectSettings.h"
#include "ISCW_UK2Node_AddComponent.h"
#include "ISCW_UK2Node_CallFunction.h"
#include "ISCW_UK2Node_FunctionEntry.h"
#include "ISCW_UK2Node_FunctionResult.h"
#include "ISCW_UK2Node_FunctionTerminator.h"
#include "ISCW_UK2Node_MacroInstance.h"
#include "ISCW_UK2Node_Variable.h"
#include "ISCW_UObject.h"
#include "ISCW_UPackage.h"
#include "ISCW_USceneComponent.h"
#include "ISCW_UScriptStruct.h"
#include "ISCW_USCS_Node.h"
#include "ISCW_USimpleConstructionScript.h"
#include "ISCW_UStruct.h"
#include "ISCW_UUserDefinedEnum.h"
#include "ISCW_UUserDefinedStruct.h"
#include "ISCW_UUserDefinedStructEditorData.h"
#include "ISCW_UWidgetBlueprint.h"
#include "ISCW_UWidgetBlueprintGeneratedClass.h"
#include "ISCW_UWorld.h"
#include <map>
#include <memory>
#include <string>
#include <vector>

using std::function;
using std::map;
using std::set;
using std::shared_ptr;
using std::vector;
using std::wstring;

#ifndef SCW_INDEX_NONE
#define SCW_INDEX_NONE (-1)
#endif

namespace Sourcify
{
	/** Mirror TFieldIterator construction flags in UnrealType.h*/
	enum class ISCW_EFieldIterationFlags : uint8_t
	{
		None = 0,
		IncludeSuper = 1 << 0,		// Include super class
		IncludeDeprecated = 1 << 1,	// Include deprecated properties
		IncludeInterfaces = 1 << 2,	// Include interfaces

		IncludeAll = IncludeSuper | IncludeDeprecated | IncludeInterfaces,

		Default = IncludeSuper | IncludeDeprecated
	};

	enum class SCW_EBlueprintCompileOptions : uint32_t
	{
		None = 0x0,

		/** This flag has several effects, but its behavior is to 'make things work' when regenerating a blueprint on load */
		IsRegeneratingOnLoad = 0x1,
		/** Skips garbage collection at the end of compile, useful if caller will collect garbage themselves */
		SkipGarbageCollection = 0x2,
		/** Prevents intermediate products from being garbage collected, useful for debugging macro/node expansion */
		SaveIntermediateProducts = 0x4,
		/** Indicates that the skeleton is up to date, and therefore the skeleton compile pass can be skipped */
		SkeletonUpToDate = 0x8,
		/** Indicates this is a batch compile and that BroadcastCompiled and BroadcastBlueprintCompiled should be skipped */
		BatchCompile = 0x10,
		/** Skips saving blueprints even if save on compile is enabled */
		SkipSave = 0x20,
		/** Skips creating a reinstancer and running reinstancing routines - useful if calling code is performing reinstancing */
		SkipReinstancing = 0x40,
		/** Simply regenerates the skeleton class */
		RegenerateSkeletonOnly = 0x80,
		/** Skips class-specific validation of the default object - in some cases we may not have a fully-initialized CDO after reinstancing */
		SkipDefaultObjectValidation = 0x100,
		/** Skips Find-in-Blueprint search data update - in some cases (e.g. creating new assets) this is being deferred until after compilation */
		SkipFiBSearchMetaUpdate = 0x200,
		/** Allow the delta serialization during FBlueprintCompileReinstancer::CopyPropertiesForUnrelatedObjects */
		UseDeltaSerializationDuringReinstancing = 0x400,
		/** Skips the new variable defaults detection - in some cases we do not want to use the defaults from the generated class such as during a reparent */
		SkipNewVariableDefaultsDetection = 0x800,
		/** Directs reinstancing to find and replace external references to the regenerated CDO during reference replacement - in general, this is not needed */
		IncludeCDOInReferenceReplacement = 0x1000,
	};

	inline SCW_EBlueprintCompileOptions operator|(SCW_EBlueprintCompileOptions A, SCW_EBlueprintCompileOptions B)
	{
		return static_cast<SCW_EBlueprintCompileOptions>(static_cast<uint32_t>(A) | static_cast<uint32_t>(B));
	}

	inline SCW_EBlueprintCompileOptions& operator|=(SCW_EBlueprintCompileOptions& A, SCW_EBlueprintCompileOptions B)
	{
		A = A | B;
		return A;
	}

	// Mirrors EWorldType in EngineTypes.h
	enum class SCW_EWorldType : uint8_t
	{
		/** An untyped world, in most cases this will be the vestigial worlds of streamed in sub-levels */
		None,

		/** The game world */
		Game,

		/** A world being edited in the editor */
		Editor,

		/** A Play In Editor world */
		PIE,

		/** A preview world for an editor tool */
		EditorPreview,

		/** A preview world for a game */
		GamePreview,

		/** A minimal RPC world for a game */
		GameRPC,

		/** An editor world that was loaded but not currently being edited in the level editor */
		Inactive
	};

	// Mirrors ERHIFeatureLevel in RHIFeatureLevel.h
	enum class SCW_ERHIFeatureLevel : uint32_t
	{
		/** Feature level defined by the core capabilities of OpenGL ES2. Deprecated */
		ES2_REMOVED,

		/** Feature level defined by the core capabilities of OpenGL ES3.1 & Metal/Vulkan. */
		ES3_1,

		/**
		 * Feature level defined by the capabilities of DX10 Shader Model 4.
		 * SUPPORT FOR THIS FEATURE LEVEL HAS BEEN ENTIRELY REMOVED.
		 */
		SM4_REMOVED,

		/**
		 * Feature level defined by the capabilities of DX11 Shader Model 5.
		 *   Compute shaders with shared memory, group sync, UAV writes, integer atomics
		 *   Indirect drawing
		 *   Pixel shaders with UAV writes
		 *   Cubemap arrays
		 *   Read-only depth or stencil views (eg read depth buffer as SRV while depth test and stencil write)
		 * Tessellation is not considered part of Feature Level SM5 and has a separate capability flag.
		 */
		SM5,

		/**
		 * Feature level defined by the capabilities of DirectX 12 hardware feature level 12_2 with Shader Model 6.5
		 *   Raytracing Tier 1.1
		 *   Mesh and Amplification shaders
		 *   Variable rate shading
		 *   Sampler feedback
		 *   Resource binding tier 3
		 */
		SM6,

		Num
	};

	enum class SCW_ClassToLookFor : uint32_t
	{
		None = 0,
		UActorComponent
	};

	enum class SCW_EReloadPackagesInteractionMode : uint8_t
	{
		/** Interactive, ask the user what to do */
		Interactive,

		/** Non-interactive, assume a positive response */
		AssumePositive,

		/** Non-interactive, assume a negative response */
		AssumeNegative,
	};

	enum class SCW_UE_LOG_Category : uint32_t
	{
		LogSourcifyBPPostProcess = 0,
		LogSourcifyCore,
		LogSourcifyCoreModule,
		LogSourcifyCoreModuleUtilities,
		LogSourcifyLicenseManager
	};

	enum class SCW_ELogVerbosity : uint8_t
	{
		/** Not used */
		NoLogging		= 0,

		/** Always prints a fatal error to console (and log file) and crashes (even if logging is disabled) */
		Fatal,

		/** 
		 * Prints an error to console (and log file). 
		 * Commandlets and the editor collect and report errors. Error messages result in commandlet failure.
		 */
		Error,

		/** 
		 * Prints a warning to console (and log file).
		 * Commandlets and the editor collect and report warnings. Warnings can be treated as an error.
		 */
		Warning,

		/** Prints a message to console (and log file) */
		Display,

		/** Prints a message to a log file (does not print to console) */
		Log,

		/** 
		 * Prints a verbose message to a log file (if Verbose logging is enabled for the given category, 
		 * usually used for detailed logging) 
		 */
		Verbose,

		/** 
		 * Prints a verbose message to a log file (if VeryVerbose logging is enabled, 
		 * usually used for detailed logging that would otherwise spam output) 
		 */
		VeryVerbose
	};

	/**
	 * Enumerates supported message dialog category types.
	 */
	enum class SCW_EAppMsgCategory : uint8_t
	{
		Warning,
		Error,
		Success,
		Info,
	};

	/**
	 * Enumerates supported message dialog button types.
	 */
	enum class SCW_EAppMsgType : uint8_t
	{
		Ok,
		YesNo,
		OkCancel,
		YesNoCancel,
		CancelRetryContinue,
		YesNoYesAllNoAll,
		YesNoYesAllNoAllCancel,
		YesNoYesAll
	};

	/**
	* Enumerates message dialog return types.
	*/
	enum class SCW_EAppReturnType : uint8_t
	{
		No,
		Yes,
		YesAll,
		NoAll,
		Cancel,
		Ok,
		Retry,
		Continue
	};

#if ISCW_UE_VERSION_NEWER_THAN_OR_EQUAL(5, 7, 0)
	enum class SCW_EFindObjectFlags
	{
		None,

		/** Whether to require an exact match with the passed in class */
		ExactClass
	};
#endif

	class ISCW_UnrealEngine
	{
	public:

		virtual ~ISCW_UnrealEngine() = default;

		virtual int32_t Algo_LevenshteinDistance(const wstring& StrA, const wstring& StrB) const = 0;

		virtual void EditorUtilities_CopySingleProperty(ISCW_UObjectConstPtr InSourceObject, ISCW_UObjectPtr InTargetObject, ISCW_FPropertyConstPtr InProperty) const = 0;

		virtual ISCW_UActorComponentPtr EditorUtilities_FindMatchingComponentInstance(ISCW_UActorComponentPtr SourceComponent, ISCW_AActorPtr TargetActor) const = 0;

		virtual void FBlueprintNamespaceUtilities_GetDefaultImportsForObject(ISCW_UObjectConstPtr InObject, set<wstring>& OutNamespaces) const = 0;

		virtual void FBlueprintEditorUtils_PurgeNullGraphs(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual bool FBlueprintEditorUtils_SupportsConstructionScript(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual ISCW_FComponentKeyPtr FComponentKey(ISCW_UBlueprintPtr Blueprint, ISCW_UK2Node_AddComponentPtr UCSNode) const = 0;

		virtual ISCW_FComponentKeyPtr FComponentKey(ISCW_USCS_NodePtr SCSNode) const = 0;

		virtual wstring FGuid_NewGuid()	const = 0;

		// Based on FindObjectWithOuter in UObjectHash.h
		virtual ISCW_UObjectPtr FindObjectWithOuter(ISCW_UObjectConstPtr Outer, SCW_ClassToLookFor ClassToLookFor = SCW_ClassToLookFor::None, wstring NameToLookFor = L"None"/*NAME_None*/) const = 0;

		virtual void FStructureEditorUtils_CompileStructure(ISCW_UUserDefinedStructPtr Struct) const = 0;

		// Uses GWorld internally and does not allow specifying an output device
		virtual void GEngine_Exec(const wchar_t* Command/*, FOutputDevice& Ar*/) const = 0;

		virtual ISCW_UGeneralProjectSettingsConstPtr GetDefault_UGeneralProjectSettings() const = 0;
		
		virtual void GetDerivedClasses(ISCW_UClassConstPtr ClassToLookFor, vector<ISCW_UClassPtr>& Results, bool bRecursive = true) const = 0;

		virtual bool IsChildOf_UActorComponent(ISCW_UClassConstPtr InClassPtr) const = 0;

		virtual bool IsChildOf_UWidget(ISCW_UClassConstPtr InClassPtr) const = 0;

		virtual vector<ISCW_FPropertyPtr> TFieldIterator_GetFProperties(const ISCW_UStructConstPtr Struct, ISCW_EFieldIterationFlags InIterationFlags = ISCW_EFieldIterationFlags::Default) const = 0;

		virtual vector<ISCW_FObjectPropertyPtr> TFieldRange_FObjectProperties(ISCW_UStructConstPtr InStructPtr, ISCW_EFieldIterationFlags InIterationFlags = ISCW_EFieldIterationFlags::Default) const = 0;

		virtual vector<ISCW_UFunctionPtr> TFieldRange_UFunctions(ISCW_UStructConstPtr InStructPtr, ISCW_EFieldIterationFlags InIterationFlags = ISCW_EFieldIterationFlags::Default) const = 0;
		
		virtual bool FDesktopPlatformModule_GenerateProjectFiles(const wstring& RootDir, const wstring& ProjectFileName) const = 0;

		virtual bool FAssetRegistryModule_GetRegistry_GetReferencers(const wstring& PackageName, vector<ISCW_UObjectPtr>& OutReferencers) const = 0;

		virtual void FAssetRegistryModule_SearchAllAssets(bool bSynchronousSearch) const = 0;

		virtual ISCW_UEdGraphPtr FBlueprintEditorUtils_FindUserConstructionScript(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual int32_t FBlueprintEditorUtils_GetChildrenOfBlueprint(ISCW_UBlueprintConstPtr Blueprint, vector<ISCW_UBlueprintPtr>& OutChildren) const = 0;

		virtual bool FBlueprintEditorUtils_IsDataOnlyBlueprint(ISCW_UBlueprintConstPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_ConformCallsToParentFunctions(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_ConformImplementedEvents(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_ConformImplementedInterfaces(ISCW_UBlueprintPtr Blueprint) const = 0;
	
		virtual void FBlueprintEditorUtils_MarkBlueprintAsModified(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_MarkBlueprintAsStructurallyModified(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_PostEditChangeBlueprintActors(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual bool FBlueprintEditorUtils_PropertyValueToString_UObject(ISCW_FPropertyConstPtr Property, ISCW_UObjectPtr Object, wstring& OutString) const = 0;

		virtual void FBlueprintEditorUtils_RefreshAllNodes(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_RemoveInterface(ISCW_UBlueprintPtr Blueprint, const wstring& InterfaceClassPathName, bool bPreserveFunctions = false) const = 0;

		virtual void FBlueprintEditorUtils_RemoveVariableNodes(ISCW_UBlueprintPtr Blueprint, const wstring& Name) const = 0;

		virtual void FBlueprintEditorUtils_RenameFunctionReferences(ISCW_UBlueprintPtr Blueprint, ISCW_UClassPtr FunctionClass, const wstring& OldFuncName, const wstring& NewFuncName) const = 0;

		virtual void FBlueprintEditorUtils_RenameGraph(ISCW_UEdGraphPtr Graph, const wstring& NewName) const = 0;

		virtual void FBlueprintEditorUtils_UpdateOutOfDateCompositeNodes(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual void FBlueprintEditorUtils_UpdateTransactionalFlags(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual wstring FCommandLine_Get() const = 0;

		virtual vector<vector<wstring>> FCsvParser_GetRows(const wstring& CsvContent) const = 0;

		virtual bool FFileHelper_SaveStringToFile(wstring String, const wchar_t* Filename) const = 0;

		virtual bool FFileHelper_LoadFileToString(wstring& Result, const wchar_t* Filename) const = 0;

		virtual ISCW_FGraphNodeCreator_UK2Node_EventPtr FGraphNodeCreator_UK2Node_Event(ISCW_UEdGraphPtr Graph) const = 0;

		virtual ISCW_FGraphNodeCreator_UK2Node_CreateDelegatePtr FGraphNodeCreator_UK2Node_CreateDelegate(ISCW_UEdGraphPtr Graph) const = 0;

		virtual ISCW_FObjectPropertyConstPtr FindFProperty(ISCW_UBlueprintGeneratedClassPtr Owner, const wstring& FieldName) const = 0;

		virtual ISCW_FObjectPropertyConstPtr FindFProperty(ISCW_UClassPtr Owner, const wstring& FieldName) const = 0;

#if ISCW_UE_VERSION_NEWER_THAN_OR_EQUAL(5, 7, 0)
		virtual ISCW_UObjectPtr FindObject(ISCW_UObjectPtr Outer, const wstring& Name, SCW_EFindObjectFlags Flags = SCW_EFindObjectFlags::None) const = 0;
#else
		virtual ISCW_UObjectPtr FindObject(ISCW_UObjectPtr Outer, const wstring& Name, bool ExactClass = false) const = 0;
#endif

#if ISCW_UE_VERSION_NEWER_THAN_OR_EQUAL(5, 7, 0)
		virtual ISCW_UEnumPtr FindObject_UEnum(ISCW_UObjectPtr Outer, const wstring& Name, SCW_EFindObjectFlags Flags = SCW_EFindObjectFlags::None) const = 0;
#else
		virtual ISCW_UEnumPtr FindObject_UEnum(ISCW_UObjectPtr Outer, const wstring& Name, bool ExactClass = false) const = 0;
#endif

		virtual bool FKismetEditorUtilities_CompileBlueprint(ISCW_UBlueprintPtr Blueprint, SCW_EBlueprintCompileOptions Options) const = 0;

		virtual void FKismetEditorUtilities_UpgradeCosmeticallyStaleBlueprint(ISCW_UBlueprintPtr Blueprint) const = 0;

		virtual wstring FName_NameToDisplayString(const wstring& Name, bool bIsBool) const = 0;

		virtual void FPlatformMisc_RequestExit(bool Force) const = 0;

		virtual bool GConfig_IsKnownConfigName(const wstring& ConfigName) const = 0;

		virtual bool ILiveCoding_IsEnabledForSession() const = 0;

		virtual bool ILiveCoding_Compile() const = 0;

		virtual void ISourceControlProvider_NotifySourceControl(const vector<wstring>& Files) const = 0;

		virtual void* FMemory_Malloc(size_t Size, size_t Alignment = 0) const = 0;

		virtual void FMemory_Free(void* Original) const = 0;

		virtual void* FMemory_Realloc(void* Original, size_t Size, size_t Alignment = 0) const = 0;

		virtual wstring FModuleManager_GetModuleFilename(const wstring& ModuleName) const = 0;

		virtual vector<ISCW_UClassPtr> TObjectIterator_GetClasses(SCW_EObjectFlags AdditionalExclusionFlags = SCW_EObjectFlags::RF_ClassDefaultObject, bool bIncludeDerivedClasses = true) const = 0;

		virtual vector<ISCW_UEnumPtr> TObjectIterator_GetEnums(SCW_EObjectFlags AdditionalExclusionFlags = SCW_EObjectFlags::RF_ClassDefaultObject, bool bIncludeDerivedClasses = true) const = 0;

		virtual vector<ISCW_UObjectPtr> TObjectIterator_GetObjects(SCW_EObjectFlags AdditionalExclusionFlags = SCW_EObjectFlags::RF_ClassDefaultObject, bool bIncludeDerivedClasses = true) const = 0;

		virtual vector<ISCW_UStructPtr> TObjectIterator_GetStructs(SCW_EObjectFlags AdditionalExclusionFlags = SCW_EObjectFlags::RF_ClassDefaultObject, bool bIncludeDerivedClasses = true) const = 0;

		virtual bool FPaths_FileExists(const wstring& InPath) = 0;

		virtual wstring FPaths_ConvertRelativePathToFull(const wstring& InPath) const = 0;

		virtual wstring FPaths_GameSourceDir() const = 0;

		virtual wstring FPaths_GetBaseFilename(const wstring& InPath, bool bRemovePath = true) const = 0;

		virtual wstring FPaths_GetExtension(const wstring& InPath) const = 0;

		virtual wstring FPaths_GetPath(const wstring& InPath) const = 0;

		virtual wstring FPaths_GetProjectFilePath() const = 0;

		virtual wstring FPaths_ProjectSavedDir() const = 0;

		virtual bool FPaths_MakePathRelativeTo(wstring& InOutPath, const wstring& InRelativeTo) const = 0;

		virtual void FPaths_NormalizeDirectoryName(wstring& InOutPath) const = 0;

		virtual void FPaths_NormalizeFilename(wstring& InOutPath) const = 0;

		virtual wstring FPaths_RootDir() const = 0;

		virtual bool FPlatformFileManager_GetPlatformFile_DirectoryExists(const wstring& InPath) const = 0;

		virtual bool FPlatformFileManager_GetPlatformFile_FileExists(const wstring& InFile) const = 0;
		
		virtual bool FPlatformFileManager_GetPlatformFile_IterateDirectory(const wstring& InPath, function<bool(const wchar_t*, bool)> Visitor) const = 0;

		virtual bool FPlatformFileManager_GetPlatformFile_IterateDirectoryRecursively(const wstring& InPath, std::function<bool(const wchar_t*, bool)> Visitor) const = 0;

		virtual bool FPlatformFileManager_GetPlatformFile_SetReadOnly(const wstring& InFile, bool bNewReadOnlyValue) const = 0;
		
		virtual bool FSourceCodeNavigation_FindModulePath(const wstring& ModuleName, wstring& OutPath) = 0;

		virtual ISCW_FSlowTaskPtr FSlowTask_New(int32_t InAmountOfWork, const wstring& InDefaultMessage = L"", bool bInEnabled = true) const = 0;
				
		virtual wstring FTopLevelAssetPath_ToString(ISCW_UFieldConstPtr Field) = 0;

		virtual ISCW_UPackagePtr GetTransientPackage() const = 0;

		virtual bool IsValid(ISCW_UObjectConstPtr Test) const = 0;

		// Do not call directly - instead use SOURCIFY_CORE_UE_LOG macro
		virtual void LogMacros_UE_LOG(SCW_UE_LOG_Category Category, SCW_ELogVerbosity Verbosity, const wstring& Message, const wstring Filename = L"", const int32_t LineNumber = -1) const = 0;

		virtual ISCW_UBlueprintPtr LoadObject_UBlueprint(ISCW_UObjectPtr Outer, const wstring& Path) const = 0;

		virtual ISCW_UObjectPtr LoadObject_UObject(ISCW_UObjectPtr Outer, const wstring& Path) const = 0;

		virtual wstring MakeUniqueObjectName(ISCW_UObjectPtr Outer, ISCW_UClassPtr Class, const wstring& BaseName) const = 0;

		virtual ISCW_UObjectPtr NewObject_UObject(ISCW_UObjectPtr Outer, ISCW_UClassPtr Class, const wstring& Name = L"", SCW_EObjectFlags Flags = SCW_EObjectFlags::RF_NoFlags) const = 0;

		virtual ISCW_USimpleConstructionScriptPtr NewObject_USimpleConstructionScript(ISCW_UBlueprintGeneratedClassPtr Class, const wstring& Name = L"") const = 0;

		virtual void ObjectTools_ConsolidateObjects(ISCW_UObjectPtr ObjectToConsolidateTo, const vector<ISCW_UObjectPtr>& ObjectsToConsolidate, bool bShowDeleteConfirmation = true) const = 0;

		virtual bool GameProjectUtils_IsValidClassNameForCreation(const wstring& ClassName, const wstring& OutputDirectory, wstring& OutReason) const = 0;

		virtual bool UEditorPerProjectUserSettings_GetAutomaticallyHotReloadNewClasses() const = 0;

		virtual void UEngine_CopyPropertiesForUnrelatedObjects(ISCW_UObjectPtr SourceObject, ISCW_UObjectPtr DestinationObject) const = 0;

		virtual wstring UGeneralProjectSettings_GetProjectName() const = 0;

// UMetaData is deprecated as of 5.6, use FMetaData instead.
#if ISCW_UE_VERSION_OLDER_THAN(5, 6, 0)
		virtual map<wstring, wstring> UMetaData_GetMapForObject(ISCW_UObjectConstPtr Object) const = 0;
		virtual wstring UMetaData_GetRemappedKeyName(const wstring& Key) const = 0;
#else
		virtual map<wstring, wstring> FMetaData_GetMapForObject(ISCW_UObjectConstPtr Object) const = 0;
		virtual wstring FMetaData_GetRemappedKeyName(const wstring& Key) const = 0;
#endif // FMetaData is used in 5.6 and later

		virtual bool UPackageTools_ReloadPackages(vector<ISCW_UPackagePtr> Packages, wstring& ErrorMessage, SCW_EReloadPackagesInteractionMode Mode) const = 0;

		virtual void USubobjectDataSubsystem_ChangeSubobjectClass(ISCW_FSubobjectDataHandlePtr SubobjectDataHandle, ISCW_UClassPtr NewClass) const = 0;

		virtual void USubobjectDataSubsystem_GatherSubobjectData(ISCW_UObjectPtr Context, vector<ISCW_FSubobjectDataHandlePtr>& OutArray) const = 0;

		// NOTE: Commenting out params we don't use
		virtual ISCW_UWorldPtr UWorld_CreateWorld(const SCW_EWorldType InWorldType, bool bInformEngineOfWorld, wstring WorldName = L"none", ISCW_UPackagePtr InWorldPackage = nullptr, bool bAddToRoot = true, SCW_ERHIFeatureLevel InFeatureLevel = SCW_ERHIFeatureLevel::Num/*, const InitializationValues* InIVS = nullptr, bool bInSkipInitWorld = false*/) const = 0;

		virtual ISCW_UClassPtr UWorld_StaticClass() const = 0;

		virtual bool GLOBAL_GetGFlushRenderingCommandsOnPreEditChange() const = 0;

		virtual void GLOBAL_SetGFlushRenderingCommandsOnPreEditChange(bool bInFlushRenderingCommandsOnPreEditChange) const = 0;

		virtual SCW_EAppReturnType FMessageDialog_Open(SCW_EAppMsgType MessageType, const wstring& Message) = 0;
		virtual SCW_EAppReturnType FMessageDialog_Open(SCW_EAppMsgType MessageType, const wstring& Message, const wstring& Title) = 0;
		virtual SCW_EAppReturnType FMessageDialog_Open(SCW_EAppMsgCategory MessageCategory, SCW_EAppMsgType MessageType, const wstring& Message) = 0;
		virtual SCW_EAppReturnType FMessageDialog_Open(SCW_EAppMsgCategory MessageCategory, SCW_EAppMsgType MessageType, const wstring& Message, const wstring& Title) = 0;

		// If the given asset has an editor tab currently open, closes it and immediately reopens it.
		// This forces a full reconstruction of the editor (e.g. SDataTableEditor) so it reads the
		// current in-memory asset state rather than displaying stale cached data.
		virtual void GEditor_CloseAndReopenAssetEditor(ISCW_UObjectPtr Asset) = 0;

		virtual shared_ptr<ISCW_UnrealEngine> ToUnrealEnginePtr() = 0;
		virtual shared_ptr<const ISCW_UnrealEngine> ToUnrealEnginePtr() const = 0;
	};

	using ISCW_UnrealEnginePtr = shared_ptr<ISCW_UnrealEngine>;

} // namespace Sourcify