[11519] | 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 | |
---|
[11549] | 22 | void testOutput(std::function<void(std::string)> callback); |
---|
[11519] | 23 | |
---|
[11562] | 24 | void orxPrint(std::string msg); |
---|
[11549] | 25 | void registerAfterTimeout(std::function<void (void)> callback, double timeout); |
---|
[11519] | 26 | int registerAtNearObject(std::function<void(int, int)> callback, int obj1, int obj2, double distance); |
---|
| 27 | int registerAtAreaEnter(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz); |
---|
| 28 | int registerAtAreaLeave(std::function<void (int)> callback, int obj, int x, int y, int z, int dx, int dy, int dz); |
---|
| 29 | int registerAtObjectDestroyed(std::function<void (int)> callback, int obj); |
---|
| 30 | int registerAtPickup(std::function<void (int)> callback, int pickup_id); |
---|
| 31 | |
---|
| 32 | int destroyObject(int obj); |
---|
| 33 | void removeObject(int obj); |
---|
| 34 | int setObjectPosition(int obj, double x, double y, double z); |
---|
| 35 | |
---|
| 36 | private: |
---|
| 37 | lua_State *lua_; |
---|
| 38 | ScriptableController *controller_; |
---|
| 39 | }; |
---|
| 40 | |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | #endif // SCRIPTABLE_CONTROLLER_API_H |
---|