#include "EventHandler.hpp"
#include "../ui/ComponentRegistration.hpp"
#include "../ui/EventHandlerEditor.hpp"

REGISTER_COMPONENT_GROUP("Event Handler", "Game", EventHandlerComponent,
			 EventHandlerEditor)
{
	registry.registerComponent<EventHandlerComponent>(
		"Event Handler", "Game",
		std::make_unique<EventHandlerEditor>(),
		// Adder
		[](flecs::entity e) {
			if (!e.has<EventHandlerComponent>())
				e.set<EventHandlerComponent>({});
		},
		// Remover
		[](flecs::entity e) {
			if (e.has<EventHandlerComponent>())
				e.remove<EventHandlerComponent>();
		});
}
