Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/tools/Timer.h

    r6417 r7284  
    4444
    4545    source.cc:
    46         include "core/Executor.h"
     46        #include "core/command/Executor.h"
    4747
    4848        ClassName::ClassName()
     
    6363#include "tools/ToolsPrereqs.h"
    6464
    65 #include "core/Executor.h"
    6665#include "core/OrxonoxClass.h"
     66#include "core/command/Executor.h"
    6767#include "tools/interfaces/TimeFactorListener.h"
    6868
     
    7878        public:
    7979            Timer();
    80             ~Timer();
    8180
    82             Timer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false);
     81            Timer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false);
    8382
    8483            /**
     
    8988                @param executor A executor of the function to call
    9089            */
    91             void setTimer(float interval, bool bLoop, Executor* executor, bool bKillAfterCall = false)
     90            void setTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false)
    9291            {
    93                 this->deleteExecutor();
    94 
    9592                this->setInterval(interval);
    9693                this->bLoop_ = bLoop;
     
    103100
    104101            void run();
    105             void deleteExecutor();
    106102
    107103            /** @brief Starts the Timer: Function-call after 'interval' seconds. */
     
    141137            void init();
    142138
    143             Executor* executor_;  //!< The executor of the function that should be called when the time expires
     139            ExecutorPtr executor_;  //!< The executor of the function that should be called when the time expires
    144140
    145             long long interval_;  //!< The time-interval in micro seconds
    146             bool bLoop_;          //!< If true, the function gets called every 'interval' seconds
    147             bool bActive_;        //!< If true, the Timer ticks and calls the function if the time's up
    148             bool bKillAfterCall_; //!< If true the timer gets deleted after it called the function
     141            long long interval_;    //!< The time-interval in micro seconds
     142            bool bLoop_;            //!< If true, the function gets called every 'interval' seconds
     143            bool bActive_;          //!< If true, the Timer ticks and calls the function if the time's up
     144            bool bKillAfterCall_;   //!< If true the timer gets deleted after it called the function
    149145
    150             long long time_;      //!< Internal variable, counting the time till the next function-call
     146            long long time_;        //!< Internal variable, counting the time till the next function-call
    151147    };
    152148}
Note: See TracChangeset for help on using the changeset viewer.