#include "Inventory.hpp"
#include "../ui/ComponentRegistration.hpp"
#include "../ui/InventoryEditor.hpp"

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