/**
 * @file ogre_stub.h
 * @brief Minimal Ogre stub for standalone tests.
 *
 * Provides just enough Ogre type aliases to compile the
 * ActionDatabase, GoapBlackboard, GoapGoal, GoapAction,
 * and BehaviorTree components without the full Ogre SDK.
 *
 * Only for use in standalone tests (action_db_lua_test).
 */

#ifndef OGRE_STUB_H
#define OGRE_STUB_H

#include <string>
#include <vector>
#include <cstdint>
#include <unordered_map>

namespace Ogre
{

// String is just std::string
using String = std::string;

// Minimal Vector3 for GoapBlackboard
struct Vector3 {
	float x, y, z;
	Vector3()
		: x(0)
		, y(0)
		, z(0)
	{
	}
	Vector3(float x_, float y_, float z_)
		: x(x_)
		, y(y_)
		, z(z_)
	{
	}
	static const Vector3 ZERO;

	// Member operator== needed by std::pair::operator== when comparing
	// unordered_map<string, Vector3> in GoapBlackboard::operator==
	bool operator==(const Vector3 &other) const
	{
		return x == other.x && y == other.y && z == other.z;
	}
};

inline const Vector3 Vector3::ZERO(0, 0, 0);

// Minimal LogManager stub (used by LuaActionApi)
class LogManager {
public:
	static LogManager &getSingleton()
	{
		static LogManager instance;
		return instance;
	}

	class Stream {
	public:
		template <typename T> Stream &operator<<(const T &)
		{
			return *this;
		}
	};

	Stream stream()
	{
		return Stream();
	}
};

// OgreAssert macro (used by LuaEntityApi.hpp)
#ifndef OgreAssert
#define OgreAssert(expr, msg)                                            \
	do {                                                             \
		if (!(expr)) {                                           \
			fprintf(stderr, "OgreAssert failed: %s\n", msg); \
			assert(expr);                                    \
		}                                                        \
	} while (0)
#endif

} // namespace Ogre

#endif // OGRE_STUB_H
