Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 7, 2009, 2:20:43 PM (15 years ago)
Author:
dafrick
Message:

Added comments and a lot of TODO's, many of which probably are obsolete by now, so don't mind them, they're just to help me remember, what I thought at the time I went through that particular code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup/src/orxonox/pickup/PickupSpawner.h

    r5781 r5902  
    5050    class _OrxonoxExport PickupSpawner : public StaticEntity, public Tickable
    5151    {
    52     public:
    53         PickupSpawner(BaseObject* creator);
    54         virtual ~PickupSpawner();
     52        public:
     53            //TODO: Add limit of items spawned here. Also possibility to spawn collections?
     54            PickupSpawner(BaseObject* creator);
     55            virtual ~PickupSpawner();
    5556
    56         virtual void changedActivity();                                 //!< Invoked when activity has changed (set visibilty).
    57         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
    58         virtual void tick(float dt);
     57            virtual void changedActivity();                                 //!< Invoked when activity has changed (set visibilty).
     58            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
     59            virtual void tick(float dt);
    5960
    60         void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
    61         void respawnTimerCallback();                                    //!< Method called when the timer runs out.
     61            void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
     62            void respawnTimerCallback();                                    //!< Method called when the timer runs out.
    6263
    63         /**
     64            /**
    6465            @brief Get the template name for the item to spawn.
    6566            @return Returns the name of the template of the item to spawn.
    66         */
    67         inline const std::string& getItemTemplateName() const
    68             { return this->itemTemplateName_; }
    69         void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
     67            */
     68            inline const std::string& getItemTemplateName() const
     69                { return this->itemTemplateName_; }
     70            void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
    7071
    71         /**
    72             @brief Get the template for the item to spawn.
    73             @return Returns the template of the item to spawn.
    74         */
    75         inline Template* getItemTemplate() const
    76             { return this->itemTemplate_; }
     72            /**
     73                @brief Get the template for the item to spawn.
     74                @return Returns the template of the item to spawn.
     75            */
     76            inline Template* getItemTemplate() const
     77                { return this->itemTemplate_; }
    7778
    78         /**
    79             @brief Get the distance in which to trigger.
    80             @return Returns the distance in which this gets triggered.
    81         */
    82         inline float getTriggerDistance() const
    83             { return this->triggerDistance_; }
    84         /**
    85             @brief Set the distance in which to trigger.
    86             @param value The new distance in which to trigger.
    87         */
    88         inline void setTriggerDistance(float value)
    89             { this->triggerDistance_ = value; }
     79            /**
     80                @brief Get the distance in which to trigger.
     81                @return Returns the distance in which this gets triggered.
     82            */
     83            inline float getTriggerDistance() const
     84                { return this->triggerDistance_; }
     85            /**
     86                @brief Set the distance in which to trigger.
     87                @param value The new distance in which to trigger.
     88            */
     89            inline void setTriggerDistance(float value)
     90                { this->triggerDistance_ = value; }
    9091
    91         /**
    92             @brief Get the time to respawn.
    93             @returns Returns the time after which this gets re-actived.
    94         */
    95         inline float getRespawnTime() const
    96             { return this->respawnTime_; }
    97         /**
    98             @brief Set the time to respawn.
    99             @param time New time after which this gets re-actived.
    100         */
    101         inline void setRespawnTime(float time)
    102             { this->respawnTime_ = time; }
    103     private:
    104         std::string itemTemplateName_;          //!< Template name of the item to spawn.
    105         Template* itemTemplate_;                //!< Template of the item to spawn.
     92            /**
     93                @brief Get the time to respawn.
     94                @returns Returns the time after which this gets re-actived.
     95            */
     96            inline float getRespawnTime() const
     97                { return this->respawnTime_; }
     98            /**
     99                @brief Set the time to respawn.
     100                @param time New time after which this gets re-actived.
     101            */
     102            inline void setRespawnTime(float time)
     103                { this->respawnTime_ = time; }
     104        private:
     105            std::string itemTemplateName_;          //!< Template name of the item to spawn.
     106            Template* itemTemplate_;                //!< Template of the item to spawn.
    106107
    107         float triggerDistance_;                 //!< Distance in which this gets triggered.
     108            float triggerDistance_;                 //!< Distance in which this gets triggered.
    108109
    109         /* Pickup animation */
    110         float tickSum_;                         //!< Adds up tick to use in sine movement
    111         static const float bounceSpeed_s;       //!< Speed of pickup to bounce up and down
    112         static const float bounceDistance_s;    //!< Distance the pickup bounces up and down
    113         static const float rotationSpeed_s;     //!< Rotation speed of pickup
     110            /* Pickup animation */
     111            float tickSum_;                         //!< Adds up tick to use in sine movement
     112            static const float bounceSpeed_s;       //!< Speed of pickup to bounce up and down
     113            static const float bounceDistance_s;    //!< Distance the pickup bounces up and down
     114            static const float rotationSpeed_s;     //!< Rotation speed of pickup
    114115
    115         float respawnTime_;                     //!< Time after which this gets re-actived.
    116         Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
     116            float respawnTime_;                     //!< Time after which this gets re-actived.
     117            Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
    117118    };
    118119}
Note: See TracChangeset for help on using the changeset viewer.