Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2007, 3:21:33 PM (17 years ago)
Author:
landauf
Message:

More documentation and comments (it's so much fun!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/Tickable.h

    r443 r452  
     1/*!
     2    @file Tickable.h
     3    @brief Definition of the Tickable interface.
     4
     5    The Tickable interface provides a tick(dt) function, that gets called every frame.
     6    float dt is the time since the last frame.
     7
     8    Attention:
     9    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
     10    parent::tick(dt) function explicit in their implementation of tick(dt) because it's a virtual function.
     11*/
     12
    113#ifndef _Tickable_H__
    214#define _Tickable_H__
     
    719namespace orxonox
    820{
    9     class TickFrameListener;
     21    class TickFrameListener; // Forward declaration
    1022
     23    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
    1124    class Tickable : virtual public OrxonoxClass
    1225    {
    1326        public:
     27            /**
     28                @brief Gets called every frame.
     29                @param dt The time since the last frame
     30            */
    1431            virtual void tick(float dt) = 0;
    1532
    1633        protected:
     34            /**
     35                @brief Constructor: Registers the object in the Tickable-list
     36            */
    1737            Tickable() { RegisterRootObject(Tickable); }
    1838    };
    1939
     40    //! The TickFrameListener calls the tick(dt) function of all Tickables every frame.
    2041    class TickFrameListener : public Ogre::FrameListener
    2142    {
    2243        private:
     44            /** @brief Gets called before a frame gets rendered. */
    2345            bool frameStarted(const Ogre::FrameEvent &evt)
    2446            {
     47                // Iterate through all Tickables and call their tick(dt) function
    2548                for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
    2649                    it->tick(evt.timeSinceLastFrame);
Note: See TracChangeset for help on using the changeset viewer.