#include "CustomBlueprintsEditor.h"

class UClass* characterClass = nullptr;
class UClass* abilityTriggerClass = nullptr;
class UClass* abilityGroupClass = nullptr;
class UClass* projectileClass = nullptr;
class UClass* modifierClass = nullptr;
class UClass* libClass = nullptr;

void LoadDependencies()
{
	libClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.Lib");
	characterClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.NetworkCharacter");
	abilityGroupClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.AbilityEventGroup");
	abilityTriggerClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.AbilityTriggerBase");
	projectileClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.ProjectileBase");
	modifierClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.Modifier");
	//printf("\nhoi %p\n%p\n%p\n%p\n%p\n%p\n", libClass, characterClass, abilityGroupClass, abilityTriggerClass, projectileClass, modifierClass);
}

class FCustomBlueprintsEditor : public IModuleInterface
{
public:
	/** IModuleInterface implementation */
	virtual void StartupModule() override
	{
		auto module = FModuleManager::LoadModuleChecked<IModuleInterface>("UnrealProject");
		FModuleManager& moduleManager = FModuleManager::Get();
		bool ok = moduleManager.DoesLoadedModuleHaveUObjects(L"UnrealProject");

		LoadDependencies();
		// Class'/Script/UnrealProject.Lib'
		// Class'/Script/UnrealProject.AbilityEventGroup'
		// Class'/Script/UnrealProject.AbilityTriggerBase'
		// Class'/Script/UnrealProject.ProjectileBase'
		// Class'/Script/UnrealProject.Modifier'

	}
	virtual void ShutdownModule() override
	{
	}
private:
};

IMPLEMENT_MODULE(FCustomBlueprintsEditor, CustomBlueprintsEditor)