Last change
on this file since 11593 was
11583,
checked in by kohlia, 7 years ago
|
Near object, near point and at area work!
|
File size:
1.1 KB
|
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 | #include "tools/Timer.h" |
---|
14 | |
---|
15 | struct lua_State; |
---|
16 | |
---|
17 | namespace orxonox |
---|
18 | { |
---|
19 | |
---|
20 | class ScriptableController |
---|
21 | { |
---|
22 | public: |
---|
23 | int runScript(const std::string &file_path); |
---|
24 | |
---|
25 | void setPlayer(PlayerInfo *player); |
---|
26 | void registerWorldEntity(std::string id, WorldEntity *entity); |
---|
27 | void registerControllableEntity(std::string id, ControllableEntity *entity); |
---|
28 | |
---|
29 | WorldEntity *getWorldEntityByID(std::string id) const; |
---|
30 | ControllableEntity *getControllableEntityByID(std::string id) const; |
---|
31 | |
---|
32 | private: |
---|
33 | std::list<std::unique_ptr<ScriptableControllerAPI> > apis_; |
---|
34 | PlayerInfo *player_; |
---|
35 | std::map<std::string, WorldEntity*> worldEntities_; |
---|
36 | std::map<std::string, ControllableEntity*> controllabelEntities_; |
---|
37 | |
---|
38 | void printLuaError(lua_State *lua); |
---|
39 | }; |
---|
40 | |
---|
41 | } |
---|
42 | |
---|
43 | #endif // SCRIPTABLE_CONTROLLER_H |
---|
Note: See
TracBrowser
for help on using the repository browser.