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

#pragma once

#include "ISCW_FBPInterfaceDescription.h"
#include "ISCW_FBPVariableDescription.h"
#include "ISCW_UObject.h"
#include "ISCW_UBlueprintGeneratedClass.h"
#include "ISCW_UEdGraph.h"
#include <memory>
#include <string>
#include <vector>

using std::shared_ptr;
using std::vector;
using std::wstring;

namespace Sourcify
{
	class ISCW_UInheritableComponentHandler;

	enum class SCW_EBlueprintType : int32_t
	{
		/** Normal blueprint. */
		BPTYPE_Normal,
		/** Blueprint that is const during execution (no state graph and methods cannot modify member variables). */
		BPTYPE_Const,
		/** Blueprint that serves as a container for macros to be used in other blueprints. */
		BPTYPE_MacroLibrary,
		/** Blueprint that serves as an interface to be implemented by other blueprints. */
		BPTYPE_Interface,
		/** Blueprint that handles level scripting. */
		BPTYPE_LevelScript,
		/** Blueprint that serves as a container for functions to be used in other blueprints. */
		BPTYPE_FunctionLibrary,
		BPTYPE_MAX
	};

	/**
	 * Enumerates states a blueprint can be in.
	 */
	enum class SCW_EBlueprintStatus : uint8_t
	{
		/** Blueprint is in an unknown state. */
		BS_Unknown,
		/** Blueprint has been modified but not recompiled. */
		BS_Dirty,
		/** Blueprint tried but failed to be compiled. */
		BS_Error,
		/** Blueprint has been compiled since it was last modified. */
		BS_UpToDate,
		/** Blueprint is in the process of being created for the first time. */
		BS_BeingCreated,
		/** Blueprint has been compiled since it was last modified. There are warnings. */
		BS_UpToDateWithWarnings,
		BS_MAX,
	};

	class ISCW_UBlueprint : public virtual ISCW_UObject
	{
	public:
		virtual ~ISCW_UBlueprint() = default;

		virtual void DeleteComponentTemplates() const = 0;

		virtual void DeleteNewVariables() const = 0;

		virtual ISCW_UBlueprintGeneratedClassPtr GeneratedClass() const = 0;

		virtual void GetAllGraphs(vector<ISCW_UEdGraphPtr>& OutGraphs) const = 0;

		virtual SCW_EBlueprintType GetBlueprintType() const = 0;

		virtual wstring GetBlueprintNamespace() const = 0;

		virtual vector<ISCW_UActorComponentPtr> GetComponentTemplates() const = 0;

		virtual bool GetDeprecate() const = 0;
		
		virtual bool GetGenerateConstClass() const = 0;
		
		virtual bool GetGenerateAbstractClass() const = 0;
		
		virtual vector<wstring> GetHideCategories() const = 0;
		
		virtual vector<ISCW_UEdGraphPtr> GetEventGraphs() const = 0;
		
		virtual vector<ISCW_UEdGraphPtr> GetFunctionGraphs() const = 0;
		
		virtual vector<ISCW_FBPInterfaceDescriptionPtr> GetImplementedInterfaces() const = 0;

		virtual shared_ptr<ISCW_UInheritableComponentHandler> GetInheritableComponentHandler(bool bCreateIfNotFound) const = 0;

		virtual ISCW_UClassPtr GetParentClass() const = 0;

		virtual SCW_EBlueprintStatus GetStatus() const = 0;
		
		virtual vector<ISCW_FBPVariableDescriptionPtr> NewVariables() const = 0;

		virtual shared_ptr<ISCW_UBlueprint> ToUBlueprintPtr() = 0;
		
		virtual shared_ptr<const ISCW_UBlueprint> ToUBlueprintPtr() const = 0;

		virtual vector<ISCW_UEdGraphPtr> GetUbergraphPages() const = 0;

		virtual void SetSimpleConstructionScript(shared_ptr<class ISCW_USimpleConstructionScript> SCS) const = 0;

		virtual shared_ptr<class ISCW_USimpleConstructionScript> SimpleConstructionScript() const = 0;

		virtual void SetParentClass(ISCW_UClassPtr Parent) const = 0;
		
	};

	using ISCW_UBlueprintConstPtr = shared_ptr<const ISCW_UBlueprint>;
	using ISCW_UBlueprintPtr = shared_ptr<ISCW_UBlueprint>;
} // namespace Sourcify