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

#pragma once
#include "ISCW_UObject.h"

#include <memory>
#include <set>
#include <string>

using std::set;
using std::shared_ptr;
using std::wstring;

namespace Sourcify
{
	class ISCW_AActor;
	class ISCW_FProperty;

	// Mirrors EComponentCreationMethod in Engine/Classes/Components/ActorComponent.h
	enum class SCW_EComponentCreationMethod : uint8_t
	{
		/** A component that is part of a native class. */
		Native,
		/** A component that is created from a template defined in the Components section of the Blueprint. */
		SimpleConstructionScript,
		/**A dynamically created component, either from the UserConstructionScript or from a Add Component node in a Blueprint event graph. */
		UserConstructionScript,
		/** A component added to a single Actor instance via the Component section of the Actor's details panel. */
		Instance,
	};

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

		virtual SCW_EComponentCreationMethod CreationMethod() const = 0;

		virtual void DestroyComponent(bool bPromoteChildren = false) = 0;

		virtual shared_ptr<ISCW_AActor> GetOwner() const = 0;

		virtual void GetUCSModifiedProperties(set<shared_ptr<const ISCW_FProperty>>& ModifiedProperties) const = 0;

		virtual bool IsCreatedByConstructionScript() const = 0;

		virtual bool IsRegistered() const = 0;

		virtual void RegisterComponent() = 0;

		virtual void UnregisterComponent() = 0;
	};

	using ISCW_UActorComponentConstPtr = shared_ptr<const ISCW_UActorComponent>;
	using ISCW_UActorComponentPtr = shared_ptr<ISCW_UActorComponent>;
} // namespace Sourcify