blob: 2832576f65aa11c4e5aea0f4163136ecac33d36f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef SCRIPT_SYSTEM_H_FD8A95B3
#define SCRIPT_SYSTEM_H_FD8A95B3
#include <sol/sol.hpp>
#include <memory>
#include <set>
#include <string>
#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<sol::thread> runner_;
std::unique_ptr<sol::coroutine> callable_;
std::set<std::string> loadedScripts_;
};
#endif /* end of include guard: SCRIPT_SYSTEM_H_FD8A95B3 */
|