Line | |
---|
1 | #ifndef SCRIPTABLE_CONTROLLER_H |
---|
2 | #define SCRIPTABLE_CONTROLLER_H |
---|
3 | |
---|
4 | #include <lua.hpp> |
---|
5 | #include <string> |
---|
6 | #include <list> |
---|
7 | #include <map> |
---|
8 | #include <memory> |
---|
9 | #include "scriptable_controller_api.h" |
---|
10 | #include "core/CoreIncludes.h" |
---|
11 | #include "worldentities/WorldEntity.h" |
---|
12 | #include "worldentities/ControllableEntity.h" |
---|
13 | |
---|
14 | struct lua_State; |
---|
15 | |
---|
16 | namespace orxonox |
---|
17 | { |
---|
18 | |
---|
19 | class ScriptableController |
---|
20 | { |
---|
21 | public: |
---|
22 | int runScript(const std::string &file_path); |
---|
23 | |
---|
24 | void registerWorldEntity(int id, WorldEntity *obj); |
---|
25 | void registerControllableEntity(int id, ControllableEntity *obj); |
---|
26 | |
---|
27 | WorldEntity *getWorldEntityByID(int id) const; |
---|
28 | ControllableEntity *getControllableEntityByID(int id) const; |
---|
29 | |
---|
30 | private: |
---|
31 | std::list<std::unique_ptr<ScriptableControllerAPI> > apis_; |
---|
32 | ControllableEntity *player_; // TODO |
---|
33 | std::map<int, WorldEntity*> worldEntities_; |
---|
34 | std::map<int, ControllableEntity*> controllabelEntities_; |
---|
35 | |
---|
36 | void printLuaError(lua_State *lua); |
---|
37 | }; |
---|
38 | |
---|
39 | } |
---|
40 | |
---|
41 | #endif // SCRIPTABLE_CONTROLLER_H |
---|
Note: See
TracBrowser
for help on using the repository browser.