Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2006, 7:55:59 PM (18 years ago)
Author:
bensch
Message:

orxonox/script_engine: namespace OrxScript introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/Script.h

    r7645 r7653  
    88#include "scriptable.h"
    99
     10namespace OrxScript
     11{
    1012
    11 struct Scrptbl
    12 {
    13   Scriptable* scriptable;
    14   int scriptableRef;
    15 };
     13  struct Scrptbl
     14  {
     15    Scriptable* scriptable;
     16    int scriptableRef;
     17  };
    1618
    17 class LuaScript
    18 {
     19  class LuaScript
     20  {
    1921  public:
    2022    LuaScript ();
     
    2628    /* ------------------ Script related Functions ------------------ */
    2729
    28    // Compile script into Virtual Machine
     30    // Compile script into Virtual Machine
    2931    bool compileFile (const std::string& strFilename);
    3032    bool compileBuffer (unsigned char *pbBuffer, size_t szLen);
    3133
    32    // Register function with Lua in the this table
     34    // Register function with Lua in the this table
    3335    int registerFunction (const std::string& strFuncName);
    3436
    3537
    36    // Selects a Lua Script function to call
     38    // Selects a Lua Script function to call
    3739    bool selectScriptFunction (const std::string& strFuncName);
    3840    void addParam (int iInt);
     
    4042    void addParam (char *string);
    4143
    42    // Runs the loaded script
     44    // Runs the loaded script
    4345    bool run (int nReturns = 0);
    4446
    45    // Checks on Virtual Machine script
     47    // Checks on Virtual Machine script
    4648    bool scriptHasFunction (const std::string& strScriptName);
    4749
    48    // Method indexing check
     50    // Method indexing check
    4951    int methods (void) { return methodCount; }
    5052
    5153
    52    // When the script calls a class method, this is called
     54    // When the script calls a class method, this is called
    5355    virtual int scriptCalling (LuaVirtualMachine& vm, int iFunctionNumber) = 0;
    5456
    55    // When the script function has returns
     57    // When the script function has returns
    5658    virtual void handleReturns (LuaVirtualMachine& vm, const std::string& strFunc) = 0;
    5759
     
    6062    /* ------------------- Handle external Objects ------------------ */
    6163
    62    void removeFromScript(int referenceToScriptable){}
    63    int addScriptableToScript(Scriptable* scriptbl,const std::string& name);  // name= name the scriptable goes by in lua
    64    int addFunctionToScriptable(const std::string& strFuncName, int toScriptable, int lastMethodIndex);
     64    void removeFromScript(int referenceToScriptable){}
     65    int addScriptableToScript(Scriptable* scriptbl,const std::string& name);  // name= name the scriptable goes by in lua
     66    int addFunctionToScriptable(const std::string& strFuncName, int toScriptable, int lastMethodIndex);
    6567
    66    //Handle the Scriptable List
    67    Scriptable* getScriptableByReference(int scrptblRef);
    68    int getReferenceByScriptable(Scriptable* scriptable);
    69    bool addScriptableToList(Scriptable* scriptbl, int scriptableRef);
    70    bool removeScriptableFromList(Scriptable* scriptable);
    71    bool removeScriptableFromList(int scriptable);
     68    //Handle the Scriptable List
     69    Scriptable* getScriptableByReference(int scrptblRef);
     70    int getReferenceByScriptable(Scriptable* scriptable);
     71    bool addScriptableToList(Scriptable* scriptbl, int scriptableRef);
     72    bool removeScriptableFromList(Scriptable* scriptable);
     73    bool removeScriptableFromList(int scriptable);
    7274
    7375
     
    8587    std::string functionName;
    8688    std::list<Scrptbl> scriptableList;
    87 };
     89  };
    8890
     91}
    8992
    9093#endif // __LUA_SCRIPT_BASE_H__
Note: See TracChangeset for help on using the changeset viewer.