#ifndef EDITSCENE_ACTION_DATABASE_EDITOR_HPP
#define EDITSCENE_ACTION_DATABASE_EDITOR_HPP
#pragma once

#include "ComponentEditor.hpp"
#include "../components/ActionDatabase.hpp"

/**
 * Editor for ActionDatabaseComponent.
 *
 * Allows editing the global list of GOAP actions and goals.
 * Edits the component data and syncs to the ActionDatabase singleton.
 */
class ActionDatabaseEditor : public ComponentEditor<ActionDatabaseComponent> {
public:
	const char *getName() const override
	{
		return "Action Database";
	}

protected:
	bool renderComponent(flecs::entity entity,
			     ActionDatabaseComponent &db) override;

private:
	void renderActions(ActionDatabaseComponent &db);
	void renderGoals(ActionDatabaseComponent &db);
	void renderActionEditor(GoapAction &action);
	void renderGoalEditor(GoapGoal &goal);
	bool renderBitNames();

	int m_selectedAction = -1;
	int m_selectedGoal = -1;
};

#endif // EDITSCENE_ACTION_DATABASE_EDITOR_HPP
