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/ModifierPickup.cc

    r5781 r5902  
    4343
    4444    /**
    45         @brief Constructor. Registers the ModifierPickup.
    46         @param creator Pointer to the object which created this item.
     45    @brief
     46        Constructor. Registers the ModifierPickup.
     47    @param creator
     48        Pointer to the object which created this item.
    4749    */
    4850    ModifierPickup::ModifierPickup(BaseObject* creator) : PassiveItem(creator)
     
    5254        this->duration_ = 0.0f;
    5355    }
    54     //! Deconstructor.
     56
     57    /**
     58    @brief
     59        Destructor.
     60    */
    5561    ModifierPickup::~ModifierPickup()
    5662    {
    57     }
    58     /**
    59         @brief Method for loading information from a level file.
    60         @param element XMLElement from which to read the data.
    61         @param mode XMLPort mode to use.
    62     */
     63       
     64    }
     65
     66    /**
     67    @brief
     68        Method for loading information from a level file.
     69    @param element
     70        XMLElement from which to read the data.
     71    @param mode
     72        XMLPort mode to use.
     73    */
     74    //TODO: Comments: params can probably be ommitted.
    6375    void ModifierPickup::XMLPort(Element& element, XMLPort::Mode mode)
    6476    {
     
    7385        XMLPortParamTemplate(ModifierPickup, "accelerationMulti", setMultiplicativeAcceleration, getMultiplicativeAcceleration, element, mode, float);
    7486    }
    75     /**
    76         @brief
    77             Invoked when a pawn picks up the pickup.
    78 
    79             Adds the modifiers to the pawn and sets a timer (if effect is limited)
    80             if the pickup could be added to the pawn's PickupCollection.
    81 
    82         @param pawn Pawn which picked up the pickup.
    83         @return Returns whether the pickup was able to be added to the pawn.
     87
     88    /**
     89    @brief
     90        Invoked when a pawn picks up the pickup.
     91
     92        Adds the modifiers to the pawn and sets a timer (if effect is limited)
     93        if the pickup could be added to the pawn's PickupCollection.
     94
     95    @param pawn
     96        Pawn which picked up the pickup.
     97    @return
     98        Returns whether the pickup was able to be added to the pawn.
    8499    */
    85100    bool ModifierPickup::pickedUp(Pawn* pawn)
     
    110125        return false;
    111126    }
    112     /**
    113         @brief
    114             Invoked when a pawn drops the pickup.
    115 
    116             Removes the modifiers from the pawn if the pickup
    117             was successfully removed from it's PickupCollection.
    118 
    119         @param pawn Pawn which dropped the pickup.
    120         @return Returns whether the pickup could be removed.
     127
     128    /**
     129    @brief
     130        Invoked when a pawn drops the pickup.
     131
     132        Removes the modifiers from the pawn if the pickup
     133        was successfully removed from it's PickupCollection.
     134
     135    @param pawn
     136        Pawn which dropped the pickup.
     137    @return
     138        Returns whether the pickup could be removed.
    121139    */
    122140    bool ModifierPickup::dropped(Pawn* pawn)
     
    145163        return false;
    146164    }
    147     /**
    148         @brief Invoked when the timer finished, calls dropped().
    149     */
     165
     166    /**
     167    @brief Invoked when the timer finished, calls dropped().
     168    */
     169    //TODO: Other name for function?
    150170    void ModifierPickup::timerCallback(Pawn* pawn)
    151171    {
     
    153173            COUT(2) << "Failed to remove modifier pickup after the timer ran out!" << std::endl;
    154174    }
    155     /**
    156         @brief Gets the additive modifier of a given type.
    157         @param type ModifierType for which to return the modifier.
    158         @return Returns the additive modifier for type (or 0 if not exists).
     175
     176    /**
     177    @brief
     178        Gets the additive modifier of a given type.
     179    @param type
     180        ModifierType for which to return the modifier.
     181    @return
     182        Returns the additive modifier for type (or 0 if not exists).
    159183    */
    160184    float ModifierPickup::getAdditiveModifier(ModifierType::Value type) const
     
    166190            return 0.0f;
    167191    }
    168     /**
    169         @brief Gets the multiplicative modifier of a given type.
    170         @param type ModifierType for which to return the modifier.
    171         @return Returns the multiplicative modifier for type (or 1 if not exists).
     192
     193    /**
     194    @brief
     195        Gets the multiplicative modifier of a given type.
     196    @param type
     197        ModifierType for which to return the modifier.
     198    @return
     199        Returns the multiplicative modifier for type (or 1 if not exists).
    172200    */
    173201    float ModifierPickup::getMultiplicativeModifier(ModifierType::Value type) const
     
    179207            return 1.0f;
    180208    }
    181     /**
    182         @brief Gets the additive modifier of a given type.
    183         @param type ModifierType for which to return the modifier.
    184         @param value The new additive modifier for type.
     209
     210    /**
     211    @brief
     212        Gets the additive modifier of a given type.
     213    @param type
     214        ModifierType for which to return the modifier.
     215    @param value
     216        The new additive modifier for type.
    185217    */
    186218    void ModifierPickup::setAdditiveModifier(ModifierType::Value type, float value)
     
    191223            this->additiveModifiers_[type] = value;
    192224    }
    193     /**
    194         @brief Gets the multiplicative modifier of a given type.
    195         @param type ModifierType for which to return the modifier.
    196         @param value The new multiplicative modifier for type.
     225
     226    /**
     227    @brief
     228        Gets the multiplicative modifier of a given type.
     229    @param type
     230        ModifierType for which to return the modifier.
     231    @param value
     232        The new multiplicative modifier for type.
    197233    */
    198234    void ModifierPickup::setMultiplicativeModifier(ModifierType::Value type, float value)
     
    203239            this->multiplicativeModifiers_[type] = value;
    204240    }
     241
    205242}
Note: See TracChangeset for help on using the changeset viewer.