#ifndef EDITSCENE_GOAP_RUNNER_HPP
#define EDITSCENE_GOAP_RUNNER_HPP
#pragma once

#include <Ogre.h>
#include <string>
#include <vector>

/**
 * GOAP Runner component.
 *
 * Executes plans from GoapPlannerComponent.
 * For normal actions: runs the action's behavior tree.
 * For smart object actions: pathfinds to the smart object and executes.
 * After plan completion, marks the planner dirty for replanning.
 */
struct GoapRunnerComponent {
	// Current plan execution state
	enum class State {
		Idle, // No plan running
		RunningAction, // Executing a normal action
		MovingToSmartObject, // Pathfinding to a smart object
		ExecutingSmartObject, // Executing smart object action
		PlanComplete // Plan finished, waiting for replan
	};

	State state = State::Idle;

	// Index of current action in the plan
	int currentActionIndex = 0;

	// Name of the currently executing action
	Ogre::String currentActionName;

	// Timer for action execution
	float actionTimer = 0.0f;

	// Entity ID of target smart object (if applicable)
	uint64_t targetSmartObjectId = 0;

	// Active plan actions (copied from planner when plan starts)
	std::vector<Ogre::String> planActions;

	// Whether to auto-replan after completion
	bool autoReplan = true;

	GoapRunnerComponent() = default;
};

#endif // EDITSCENE_GOAP_RUNNER_HPP
