#ifndef EDITSCENE_ACTION_DATABASE_SINGLETON_EDITOR_HPP
#define EDITSCENE_ACTION_DATABASE_SINGLETON_EDITOR_HPP
#pragma once

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

/**
 * Editor for the ActionDatabase singleton.
 *
 * Unlike ActionDatabaseEditor (which edits the ActionDatabaseComponent on a
 * scene entity), this editor works directly on the global ActionDatabase
 * singleton.  It is opened from the editor menu and renders in its own
 * ImGui window.
 */
class ActionDatabaseSingletonEditor {
public:
	ActionDatabaseSingletonEditor() = default;

	/**
	 * Render the singleton editor window.
	 * Call this inside an ImGui frame.
	 *
	 * @param open  Pointer to bool controlling window visibility.
	 */
	void render(bool *open);

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

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

#endif // EDITSCENE_ACTION_DATABASE_SINGLETON_EDITOR_HPP
