space-game001/src/ScriptEngine.h
2026-05-09 23:31:49 +03:00

38 lines
881 B
C++

#pragma once
#include <string>
#include <memory>
namespace ZL {
class Location;
class Inventory;
class ScriptEngine {
public:
ScriptEngine();
~ScriptEngine();
// Must be called once, after the Game's NPCs are ready.
void init(Location* game, Inventory* inventory, const std::string& scriptPath);
// Execute a Lua script file. Logs errors to stderr.
void runScript(const std::string& path);
void callItemPickupCallback(const std::string& objectName);
void callActivateFunction(const std::string& functionName);
void callNpcInteractCallback(int npcIndex);
void callTriggerEnterCallback(const std::string& zoneId);
void callTriggerExitCallback(const std::string& zoneId);
void callCutsceneCompleteCallback(const std::string& cutsceneId);
private:
struct Impl;
std::unique_ptr<Impl> impl;
};
} // namespace ZL