#ifndef EDITSCENE_GOAP_GOAL_HPP
#define EDITSCENE_GOAP_GOAL_HPP
#pragma once

#include "GoapBlackboard.hpp"
#include <Ogre.h>

/**
 * A GOAP goal definition.
 *
 * Goals are selected based on priority and validity.
 * The target blackboard defines the desired world state.
 * The condition string provides additional runtime validity checks
 * using a simple expression language against blackboard values.
 */
struct GoapGoal {
	Ogre::String name;
	int priority = 1;

	// Target blackboard state to achieve
	GoapBlackboard target;

	// Optional condition expression (e.g. "health > 20 && hunger > 50")
	// If empty, the goal is always considered for validity checking
	Ogre::String condition;

	GoapGoal() = default;

	explicit GoapGoal(const Ogre::String &name_, int priority_ = 1)
		: name(name_)
		, priority(priority_)
	{
	}

	// Check if the goal is already satisfied by the given blackboard
	bool isSatisfied(const GoapBlackboard &blackboard) const;

	// Check if the goal is valid for the given blackboard
	// (condition evaluates to true and goal is not already satisfied)
	bool isValid(const GoapBlackboard &blackboard) const;
};

#endif // EDITSCENE_GOAP_GOAL_HPP
