#include "Item.hpp"
#include "../ui/ComponentRegistration.hpp"
#include "../ui/ItemEditor.hpp"

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