From bd1a66887f00e186ab86a5195ebb3271ea732b38 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 5 Feb 2021 20:20:21 -0500 Subject: Created script system --- src/script_system.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/script_system.h (limited to 'src/script_system.h') diff --git a/src/script_system.h b/src/script_system.h new file mode 100644 index 0000000..2832576 --- /dev/null +++ b/src/script_system.h @@ -0,0 +1,32 @@ +#ifndef SCRIPT_SYSTEM_H_FD8A95B3 +#define SCRIPT_SYSTEM_H_FD8A95B3 + +#include +#include +#include +#include +#include "system.h" + +class Game; + +class ScriptSystem : public System { +public: + + static constexpr SystemKey Key = SystemKey::Script; + + explicit ScriptSystem(Game& game); + + void tick(double dt) override; + + void runScript(std::string name); + +private: + + Game& game_; + sol::state engine_; + std::unique_ptr runner_; + std::unique_ptr callable_; + std::set loadedScripts_; +}; + +#endif /* end of include guard: SCRIPT_SYSTEM_H_FD8A95B3 */ -- cgit 1.4.1