Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/script_engine/src/lib/script_engine/script_manager.h @ 8155

Last change on this file since 8155 was 8155, checked in by snellen, 18 years ago

this won't compile

File size: 1.3 KB
Line 
1#ifndef _SCRIPT_MANAGER_H
2#define _SCRIPT_MNAGER_H
3
4#include <list>
5#include <string>
6
7#include "script.h"
8#include "base_object.h"
9#include "luaincl.h"
10#include "loading/load_param.h"
11
12
13//!< Contains the name of a lua script file  and a list of all objects that the script needs
14struct LuaScript
15{
16  std::string name;
17  std::list<std::string> objectList;
18  Script script;
19};
20
21class ScriptManager //: public BaseObject
22{
23 public:
24   ScriptManager();
25   ~ScriptManager();
26
27  inline static ScriptManager* getInstance();
28
29  virtual void loadParams(const TiXmlElement* root);
30  void setWorld(std::string& world){currentWorld = world;}
31
32  void tick(float timestep);
33
34  void initScripts(); // initializes all scripts
35
36 private:
37
38   void  init();
39   void  createScriptList(TiXmlElement* scripts);
40   void  setCurrentScriptFile(std::string& file);
41   void  addObjectToScript(std::string& object, LuaScript& script);
42
43   bool fileIsInScriptList(std::string& file);
44   bool objectIsInObjectList(std::string& object,const LuaScript& script);
45
46
47   static ScriptManager*      singletonRef;   //!< Reference to this class
48   std::list<LuaScript>       scriptList;     //!< The list of all scripts that the current world needs
49   std::string                currentWorld;
50   LuaScript                  currentScript;  //!< For temorary use
51
52
53
54};
55#endif
Note: See TracBrowser for help on using the repository browser.