1 | #ifndef SCRIPTABLE_CONTROLLER_API_H |
---|
2 | #define SCRIPTABLE_CONTROLLER_API_H |
---|
3 | |
---|
4 | #include <functional> |
---|
5 | #include "core/CoreIncludes.h" |
---|
6 | |
---|
7 | // TODO Is pos int or double? |
---|
8 | |
---|
9 | struct lua_State; |
---|
10 | |
---|
11 | namespace orxonox |
---|
12 | { |
---|
13 | |
---|
14 | class ScriptableController; |
---|
15 | |
---|
16 | class ScriptableControllerAPI |
---|
17 | { |
---|
18 | public: |
---|
19 | ScriptableControllerAPI(lua_State *lua, ScriptableController *controller); |
---|
20 | ~ScriptableControllerAPI(); |
---|
21 | |
---|
22 | void testOutput(void); |
---|
23 | |
---|
24 | void registerAfterTimeout(std::function<void (void)> callback, int timeout_ms); |
---|
25 | int registerAtNearObject(std::function<void(int, int)> callback, int obj1, int obj2, double distance); |
---|
26 | int registerAtAreaEnter(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz); |
---|
27 | int registerAtAreaLeave(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz); |
---|
28 | int registerAtObjectDestroyed(std::function<void (int)> callback, int obj); |
---|
29 | int registerAtPickup(std::function<void (int)> callback, int pickup_id); |
---|
30 | |
---|
31 | int destroyObject(int obj); |
---|
32 | void removeObject(int obj); |
---|
33 | int setObjectPosition(int obj, double x, double y, double z); |
---|
34 | |
---|
35 | static ScriptableControllerAPI *this_; |
---|
36 | |
---|
37 | private: |
---|
38 | lua_State *lua_; |
---|
39 | ScriptableController *controller_; |
---|
40 | }; |
---|
41 | |
---|
42 | } |
---|
43 | |
---|
44 | #endif // SCRIPTABLE_CONTROLLER_API_H |
---|