Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9006 in orxonox.OLD for trunk/src/lib/util/executor


Ignore:
Timestamp:
Jul 2, 2006, 2:11:59 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the mountain_lake branche back to the trunk
merged with command:
svn merge -r8799:HEAD https://svn.orxonox.net/orxonox/branches/mountain_lake .

conflicts in script taken from the branche, since they are indentation-problems.

also fixed the delete-bug for the lightning-effect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor_lua.h

    r8894 r9006  
    4444  public:
    4545    /**
    46      * @brief Constructor of a ExecutorXML
    47      * @param function a Function to call
     46   * @brief Constructor of a ExecutorXML
     47   * @param function a Function to call
    4848     */
    4949    ExecutorLua0(void(T::*function)())
    50         : Executor()
     50  : Executor()
    5151    {
    5252      this->functionPointer = function;
     
    9191  public:
    9292    /**
    93      * @brief Constructor of a ExecutorXML
    94      * @param function a Function to call
     93   * @brief Constructor of a ExecutorXML
     94   * @param function a Function to call
    9595     */
    9696    ExecutorLua1(void(T::*function)(type0))
    97         : Executor(ExecutorParamType<type0>())
    98     {
    99       this->functionPointer = function;
    100       this->functorType = Executor_Objective | Executor_NoLoadString;
    101     }
    102 
    103     /**
    104        * @brief executes the Command on BaseObject
    105        * @param object the BaseObject to execute this Executor on
    106        * @param loadString ignored in this case
     97  : Executor(ExecutorParamType<type0>())
     98    {
     99      this->functionPointer = function;
     100      this->functorType = Executor_Objective | Executor_NoLoadString;
     101    }
     102
     103    /**
     104     * @brief executes the Command on BaseObject
     105     * @param object the BaseObject to execute this Executor on
     106     * @param loadString ignored in this case
    107107     */
    108108    virtual void operator()(BaseObject* object, const SubString& = SubString()) const
     
    120120
    121121    /**
    122        * @returns a _new_ Copy of this Executor
     122     * @returns a _new_ Copy of this Executor
    123123     */
    124124    virtual Executor* clone () const
     
    140140  public:
    141141    /**
    142      * @brief Constructor of a ExecutorXML
    143      * @param function a Function to call
     142   * @brief Constructor of a ExecutorXML
     143   * @param function a Function to call
    144144     */
    145145    ExecutorLua2(void(T::*function)(type0, type1))
    146         : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
     146  : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
    147147    {
    148148      this->functionPointer = function;
     
    166166
    167167      (dynamic_cast<T*>(object)->*(functionPointer))(
    168         fromLua<type0>(state, 1),
    169         fromLua<type1>(state, 2) );
     168          fromLua<type0>(state, 1),
     169      fromLua<type1>(state, 2) );
    170170    }
    171171
     
    217217      (dynamic_cast<T*>(object)->*(functionPointer))(
    218218          fromLua<type0>(state, 1),
    219           fromLua<type1>(state, 2),
    220           fromLua<type2>(state, 3) );
     219      fromLua<type1>(state, 2),
     220      fromLua<type2>(state, 3) );
    221221    }
    222222
     
    268268      (dynamic_cast<T*>(object)->*(functionPointer))(
    269269          fromLua<type0>(state, 1),
    270           fromLua<type1>(state, 2),
    271           fromLua<type2>(state, 3),
    272           fromLua<type3>(state, 4) );
     270      fromLua<type1>(state, 2),
     271      fromLua<type2>(state, 3),
     272      fromLua<type3>(state, 4) );
    273273    }
    274274
     
    300300  public:
    301301    /**
    302      * @brief Constructor of a ExecutorXML
    303      * @param function a Function to call
     302   * @brief Constructor of a ExecutorXML
     303   * @param function a Function to call
    304304     */
    305305    ExecutorLua0ret(ret (T::*function)())
    306         : Executor()
     306  : Executor()
    307307    {
    308308      this->functionPointer = function;
     
    329329
    330330    /**
    331                        * @returns a _new_ Copy of this Executor
     331     * @returns a _new_ Copy of this Executor
    332332     */
    333333    virtual Executor* clone () const
     
    349349  public:
    350350    /**
    351      * @brief Constructor of a ExecutorXML
    352      * @param function a Function to call
     351   * @brief Constructor of a ExecutorXML
     352   * @param function a Function to call
    353353     */
    354354    ExecutorLua1ret(ret (T::*function)(type0))
    355         : Executor(ExecutorParamType<type0>())
     355  : Executor(ExecutorParamType<type0>())
    356356    {
    357357      this->functionPointer = function;
     
    375375
    376376      toLua<ret>(state, (dynamic_cast<T*>(object)->*(functionPointer))(
    377                    fromLua<type0>(state, 1)));
     377          fromLua<type0>(state, 1)));
    378378    }
    379379
     
    397397  public:
    398398    /**
    399      * @brief Constructor of a ExecutorXML
    400      * @param function a Function to call
     399   * @brief Constructor of a ExecutorXML
     400   * @param function a Function to call
    401401     */
    402402    ExecutorLua2ret(ret (T::*function)(type0, type1))
    403         : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
     403  : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
    404404    {
    405405      this->functionPointer = function;
     
    423423
    424424      toLua<ret>(state, (dynamic_cast<T*>(object)->*(functionPointer))(
    425                    fromLua<type0>(state, 1),
    426                    fromLua<type1>(state, 2) ));
     425          fromLua<type0>(state, 1),
     426          fromLua<type1>(state, 2) ));
    427427    }
    428428
     
    608608             ExecutorParamType<type2>(), ExecutorParamType<type3>(),
    609609             ExecutorParamType<type4>(), ExecutorParamType<type5>())
    610     {
    611       this->functionPointer = function;
    612       this->functorType = Executor_Objective | Executor_NoLoadString;
    613     }
    614 
    615     /**
    616      * @brief executes the Command on BaseObject
    617      * @param object the BaseObject to execute this Executor on
    618      * @param loadString ignored in this case
    619      */
    620     virtual void operator()(BaseObject* object, const SubString& = SubString()) const
    621     {
    622       PRINTF(1)("no usefull executor\n");
    623     }
    624 
    625     virtual void operator()(BaseObject* object, int& count, void* values) const
    626     {
    627       lua_State* state = (lua_State*)values;
    628       count = 1;
    629 
    630       toLua<ret>(state, (dynamic_cast<T*>(object)->*(functionPointer))(
    631           fromLua<type0>(state, 1),
    632           fromLua<type1>(state, 2),
    633           fromLua<type2>(state, 3),
    634           fromLua<type3>(state, 4),
    635           fromLua<type4>(state, 5),
    636           fromLua<type5>(state, 6) ));
    637     }
    638 
    639     /**
    640      * @returns a _new_ Copy of this Executor
    641      */
    642     virtual Executor* clone () const
    643     {
    644       return new ExecutorLua6ret<T, ret, type0, type1, type2, type3, type4, type5>(this->functionPointer);
    645     }
     610             {
     611               this->functionPointer = function;
     612               this->functorType = Executor_Objective | Executor_NoLoadString;
     613             }
     614
     615    /**
     616              * @brief executes the Command on BaseObject
     617              * @param object the BaseObject to execute this Executor on
     618              * @param loadString ignored in this case
     619     */
     620             virtual void operator()(BaseObject* object, const SubString& = SubString()) const
     621             {
     622               PRINTF(1)("no usefull executor\n");
     623             }
     624
     625             virtual void operator()(BaseObject* object, int& count, void* values) const
     626             {
     627               lua_State* state = (lua_State*)values;
     628               count = 1;
     629
     630               toLua<ret>(state, (dynamic_cast<T*>(object)->*(functionPointer))(
     631                   fromLua<type0>(state, 1),
     632                   fromLua<type1>(state, 2),
     633                   fromLua<type2>(state, 3),
     634                   fromLua<type3>(state, 4),
     635                   fromLua<type4>(state, 5),
     636                   fromLua<type5>(state, 6) ));
     637             }
     638
     639    /**
     640              * @returns a _new_ Copy of this Executor
     641     */
     642             virtual Executor* clone () const
     643             {
     644               return new ExecutorLua6ret<T, ret, type0, type1, type2, type3, type4, type5>(this->functionPointer);
     645             }
    646646  private:
    647647    ret           (T::*functionPointer)(type0, type1, type2, type3, type4, type5);
Note: See TracChangeset for help on using the changeset viewer.