#ifndef EDITSCENE_ACTION_DEBUG_EDITOR_HPP
#define EDITSCENE_ACTION_DEBUG_EDITOR_HPP
#pragma once

#include "ComponentEditor.hpp"
#include "../components/ActionDebug.hpp"
#include "../components/ActionDatabase.hpp"
#include "../components/SmartObject.hpp"
#include "../components/GoapPlanner.hpp"

/**
 * Editor for ActionDebug component.
 *
 * Allows inspecting and test-running GOAP actions on a character.
 * Also displays a list of smart object entities and allows testing
 * their actions on the character.
 */
class ActionDebugEditor : public ComponentEditor<ActionDebug> {
public:
	const char *getName() const override
	{
		return "Action Debug";
	}

protected:
	bool renderComponent(flecs::entity entity, ActionDebug &debug) override;

private:
	bool renderBlackboard(ActionDebug &debug);
	void renderActionTester(flecs::entity entity, ActionDebug &debug);
	void renderGoalTester(flecs::entity entity, ActionDebug &debug);
	void renderSmartObjectTester(flecs::entity entity, ActionDebug &debug);
	void renderPlanner(flecs::entity entity, ActionDebug &debug);

	ActionDatabase *findDatabase(flecs::entity entity);
};

#endif // EDITSCENE_ACTION_DEBUG_EDITOR_HPP
