Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/items/ShipPart.cc

    r11052 r11054  
    4949
    5050    ShipPart::ShipPart(Context* context)
    51         : Item(context), parent_(NULL)
     51        : Item(context), parent_(nullptr)
    5252    {
    5353        RegisterObject(ShipPart);
     
    121121    void ShipPart::addEntity(StaticEntity* entity)
    122122    {
    123         OrxAssert(entity != NULL, "The Entity cannot be NULL.");
     123        OrxAssert(entity != nullptr, "The Entity cannot be nullptr.");
    124124        this->entityList_.push_back(entity);
    125125    }
     
    129129        Get the i-th StaticEntity of the ShipPart.
    130130    @return
    131         Returns a pointer to the i-the StaticEntity. NULL if there is no StaticEntity with that index.
     131        Returns a pointer to the i-the StaticEntity. nullptr if there is no StaticEntity with that index.
    132132    */
    133133    StaticEntity* ShipPart::getEntity(unsigned int index)
    134134    {
    135135        if(this->entityList_.size() >= index)
    136             return NULL;
     136            return nullptr;
    137137        else
    138138            return this->entityList_[index];
     
    142142    @brief
    143143        Check whether the ShipPart has a particular Entity.
    144     @param engine
     144    @param search
    145145        A pointer to the Entity to be checked.
    146146    */
    147     bool ShipPart::hasEntity(StaticEntity* entity) const
    148     {
    149         for(unsigned int i = 0; i < this->entityList_.size(); i++)
    150         {
    151             if(this->entityList_[i] == entity)
     147    bool ShipPart::hasEntity(StaticEntity* search) const
     148    {
     149        for(StaticEntity* entity : this->entityList_)
     150        {
     151            if(entity == search)
    152152                return true;
    153153        }
     
    163163    void ShipPart::addDestructionEvent(PartDestructionEvent* event)
    164164    {
    165         OrxAssert(event != NULL, "The PartDestructionEvent cannot be NULL.");
     165        OrxAssert(event != nullptr, "The PartDestructionEvent cannot be nullptr.");
    166166        event->setParent(this);
    167167        this->eventList_.push_back(event);
     
    172172        Get the i-th PartDestructionEvent of the ShipPart.
    173173    @return
    174         Returns a pointer to the i-the PartDestructionEvent. NULL if there is no PartDestructionEvent with that index.
     174        Returns a pointer to the i-the PartDestructionEvent. nullptr if there is no PartDestructionEvent with that index.
    175175    */
    176176    PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index)
    177177    {
    178178        if(this->eventList_.size() <= index)
    179             return NULL;
     179            return nullptr;
    180180        else
    181181            return this->eventList_[index];
Note: See TracChangeset for help on using the changeset viewer.