Adding scripts

This commit is contained in:
Vladislav Khorev committed 2026-04-03 19:46:43 +03:00
1 parent 995e2c8e5b
commit 63c9d7b35b
9 files changed
+432480 -9

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#pragma once
#include <string>
#include <memory>
// Forward-declare the heavy pybind11 type so including this header stays cheap.
namespace pybind11 { class scoped_interpreter; }
namespace ZL {
class Game;
class ScriptEngine {
public:
ScriptEngine();
~ScriptEngine();
// Must be called once, after the Game's NPCs are ready.
void init(Game* game);
// Execute a Python script file. Logs errors to stderr.
void runScript(const std::string& path);
private:
std::unique_ptr<pybind11::scoped_interpreter> interpreter;
};
} // namespace ZL