Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2015, 10:25:42 PM (9 years ago)
Author:
landauf
Message:

replace 'NULL' by 'nullptr'

Location:
code/branches/cpp11_v2/src/modules/questsystem
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/questsystem/GlobalQuest.cc

    r9667 r10765  
    138138    bool GlobalQuest::isStartable(const PlayerInfo* player) const
    139139    {
    140         if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     140        if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player)))
    141141            return false;
    142142
     
    198198        The status to be set.
    199199    @return
    200         Returns false if player is NULL.
     200        Returns false if player is nullptr.
    201201    */
    202202    bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     
    249249            i--;
    250250        }
    251         return NULL;
     251        return nullptr;
    252252    }
    253253
  • code/branches/cpp11_v2/src/modules/questsystem/LocalQuest.cc

    r9667 r10765  
    128128    bool LocalQuest::isStartable(const PlayerInfo* player) const
    129129    {
    130         if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     130        if(!(this->getParentQuest() == nullptr || this->getParentQuest()->isActive(player)))
    131131            return false;
    132132
     
    188188        The status to be set.
    189189    @return
    190         Returns false if player is NULL.
     190        Returns false if player is nullptr.
    191191    */
    192192    bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
  • code/branches/cpp11_v2/src/modules/questsystem/Quest.cc

    r10624 r10765  
    5555        RegisterObject(Quest);
    5656
    57         this->parentQuest_ = NULL;
     57        this->parentQuest_ = nullptr;
    5858    }
    5959
     
    183183        The index.
    184184    @return
    185         Returns a pointer to the sub-quest at the given index. NULL if there is no element at the given index.
     185        Returns a pointer to the sub-quest at the given index. nullptr if there is no element at the given index.
    186186    */
    187187    const Quest* Quest::getSubQuest(unsigned int index) const
     
    198198        }
    199199
    200         return NULL; // If the index is greater than the number of elements in the list.
     200        return nullptr; // If the index is greater than the number of elements in the list.
    201201    }
    202202
     
    207207        The index.
    208208    @return
    209         Returns a pointer to the QuestHint at the given index. NULL if there is no element at the given index.
     209        Returns a pointer to the QuestHint at the given index. nullptr if there is no element at the given index.
    210210    */
    211211    const QuestHint* Quest::getHint(unsigned int index) const
     
    221221            i--;
    222222        }
    223         return NULL; // If the index is greater than the number of elements in the list.
     223        return nullptr; // If the index is greater than the number of elements in the list.
    224224    }
    225225
     
    230230        The index.
    231231    @return
    232         Returns a pointer to the fail QuestEffect at the given index. NULL if there is no element at the given index.
     232        Returns a pointer to the fail QuestEffect at the given index. nullptr if there is no element at the given index.
    233233    */
    234234    const QuestEffect* Quest::getFailEffect(unsigned int index) const
     
    244244            i--;
    245245        }
    246         return NULL; // If the index is greater than the number of elements in the list.
     246        return nullptr; // If the index is greater than the number of elements in the list.
    247247    }
    248248
     
    253253        The index.
    254254    @return
    255         Returns a pointer to the complete QuestEffect at the given index. NULL if there is no element at the given index.
     255        Returns a pointer to the complete QuestEffect at the given index. nullptr if there is no element at the given index.
    256256    */
    257257    const QuestEffect* Quest::getCompleteEffect(unsigned int index) const
     
    267267            i--;
    268268        }
    269         return NULL; // If the index is greater than the number of elements in the list.
     269        return nullptr; // If the index is greater than the number of elements in the list.
    270270    }
    271271
     
    280280    bool Quest::isInactive(const PlayerInfo* player) const
    281281    {
    282         if(player == NULL)
     282        if(player == nullptr)
    283283            return true;
    284284        return this->getStatus(player) == QuestStatus::Inactive;
     
    295295    bool Quest::isActive(const PlayerInfo* player) const
    296296    {
    297         if(player == NULL)
     297        if(player == nullptr)
    298298            return false;
    299299        return this->getStatus(player) == QuestStatus::Active;
     
    310310    bool Quest::isFailed(const PlayerInfo* player) const
    311311    {
    312         if(player == NULL)
     312        if(player == nullptr)
    313313            return false;
    314314        return this->getStatus(player) == QuestStatus::Failed;
     
    325325    bool Quest::isCompleted(const PlayerInfo* player) const
    326326    {
    327         if(player == NULL)
     327        if(player == nullptr)
    328328            return false;
    329329        return this->getStatus(player) == QuestStatus::Completed;
  • code/branches/cpp11_v2/src/modules/questsystem/QuestEffectBeacon.cc

    r9667 r10765  
    113113
    114114        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    115         PlayerInfo* player = NULL;
     115        PlayerInfo* player = nullptr;
    116116
    117117        // If the trigger is a PlayerTrigger.
    118         if(pTrigger != NULL)
     118        if(pTrigger != nullptr)
    119119        {
    120120            if(!pTrigger->isForPlayer())  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     
    126126            return false;
    127127
    128         if(player == NULL)
     128        if(player == nullptr)
    129129        {
    130130            orxout(verbose, context::quests) << "The QuestEffectBeacon was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << endl;
     
    243243            i--;
    244244        }
    245         return NULL;
     245        return nullptr;
    246246    }
    247247
  • code/branches/cpp11_v2/src/modules/questsystem/QuestHint.cc

    r9667 r10765  
    8888    bool QuestHint::isActive(const PlayerInfo* player) const
    8989    {
    90         if(player == NULL) // If the player is NULL, the Quest obviously can't be active.
     90        if(player == nullptr) // If the player is nullptr, the Quest obviously can't be active.
    9191            return false;
    9292
  • code/branches/cpp11_v2/src/modules/questsystem/QuestListener.cc

    r9667 r10765  
    5959
    6060        this->mode_ = QuestListenerMode::All;
    61         this->quest_ = NULL;
     61        this->quest_ = nullptr;
    6262    }
    6363
     
    8181        XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode);
    8282
    83         if(this->quest_ != NULL)
     83        if(this->quest_ != nullptr)
    8484            this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners.
    8585
     
    117117        this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId.
    118118
    119         if(this->quest_ == NULL) // If there is no such Quest.
     119        if(this->quest_ == nullptr) // If there is no such Quest.
    120120        {
    121121            ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id..");
  • code/branches/cpp11_v2/src/modules/questsystem/QuestManager.cc

    r10624 r10765  
    9393    bool QuestManager::registerQuest(Quest* quest)
    9494    {
    95         if(quest == NULL)
    96         {
    97             orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;
     95        if(quest == nullptr)
     96        {
     97            orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl;
    9898            return false;
    9999        }
     
    135135    bool QuestManager::registerHint(QuestHint* hint)
    136136    {
    137         if(hint == NULL)
    138         {
    139             orxout(internal_error, context::quests) << "Quest pointer is NULL." << endl;
     137        if(hint == nullptr)
     138        {
     139            orxout(internal_error, context::quests) << "Quest pointer is nullptr." << endl;
    140140            return false;
    141141        }
     
    173173    @return
    174174        Returns a pointer to the Quest with the input id.
    175         Returns NULL if there is no Quest with the given questId.
     175        Returns nullptr if there is no Quest with the given questId.
    176176    @throws
    177177        Throws an exception if the given questId is invalid.
     
    188188        else
    189189        {
    190            quest = NULL;
     190           quest = nullptr;
    191191           orxout(internal_warning, context::quests) << "The quest with id {" << questId << "} is nowhere to be found." << endl;
    192192        }
     
    202202    @return
    203203        Returns a pointer to the QuestHint with the input id.
    204         Returns NULL if there is no QuestHint with the given hintId.
     204        Returns nullptr if there is no QuestHint with the given hintId.
    205205    @throws
    206206        Throws an exception if the given hintId is invalid.
     
    217217        else
    218218        {
    219            hint = NULL;
     219           hint = nullptr;
    220220           orxout(internal_warning, context::quests) << "The hint with id {" << hintId << "} is nowhere to be found." << endl;
    221221        }
     
    237237        for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
    238238        {
    239             if(it->second->getParentQuest() == NULL && !it->second->isInactive(player))
     239            if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player))
    240240                numQuests++;
    241241        }
     
    257257        for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
    258258        {
    259             if(it->second->getParentQuest() == NULL && !it->second->isInactive(player) && index-- == 0)
     259            if(it->second->getParentQuest() == nullptr && !it->second->isInactive(player) && index-- == 0)
    260260                return it->second;
    261261        }
    262         return NULL;
     262        return nullptr;
    263263    }
    264264
     
    275275    int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
    276276    {
    277         if(quest == NULL)
     277        if(quest == nullptr)
    278278            return this->getNumRootQuests(player);
    279279
     
    300300    Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
    301301    {
    302         if(quest == NULL)
     302        if(quest == nullptr)
    303303            return this->getRootQuest(player, index);
    304304
     
    309309                return *it;
    310310        }
    311         return NULL;
     311        return nullptr;
    312312    }
    313313
     
    354354                return *it;
    355355        }
    356         return NULL;
     356        return nullptr;
    357357    }
    358358
     
    367367    Quest* QuestManager::getParentQuest(Quest* quest)
    368368    {
    369         OrxAssert(quest, "The input Quest is NULL.");
     369        OrxAssert(quest, "The input Quest is nullptr.");
    370370        return quest->getParentQuest();
    371371    }
     
    381381    QuestDescription* QuestManager::getDescription(Quest* item)
    382382    {
    383         OrxAssert(item, "The input Quest is NULL.");
     383        OrxAssert(item, "The input Quest is nullptr.");
    384384        return item->getDescription();
    385385    }
     
    395395    QuestDescription* QuestManager::getDescription(QuestHint* item)
    396396    {
    397         OrxAssert(item, "The input QuestHint is NULL.");
     397        OrxAssert(item, "The input QuestHint is nullptr.");
    398398        return item->getDescription();
    399399    }
     
    409409    const std::string QuestManager::getId(Quest* item) const
    410410    {
    411         OrxAssert(item, "The input Quest is NULL.");
     411        OrxAssert(item, "The input Quest is nullptr.");
    412412        return item->getId();
    413413    }
     
    423423    const std::string QuestManager::getId(QuestHint* item) const
    424424    {
    425         OrxAssert(item, "The input QuestHint is NULL.");
     425        OrxAssert(item, "The input QuestHint is nullptr.");
    426426        return item->getId();
    427427    }
     
    440440    {
    441441        PlayerInfo* player = GUIManager::getInstance().getPlayer(guiName);
    442         if(player == NULL)
     442        if(player == nullptr)
    443443        {
    444444            orxout(internal_error, context::quests) << "GUIOverlay with name '" << guiName << "' has no player." << endl;
    445             return NULL;
     445            return nullptr;
    446446        }
    447447
  • code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuest.cc

    r9667 r10765  
    9090        {
    9191            Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId());
    92             if(quest == NULL || !quest->start(player))
     92            if(quest == nullptr || !quest->start(player))
    9393               return false;
    9494        }
  • code/branches/cpp11_v2/src/modules/questsystem/effects/AddQuestHint.cc

    r9667 r10765  
    113113        {
    114114            QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_);
    115             if(hint == NULL || !hint->setActive(player))
     115            if(hint == nullptr || !hint->setActive(player))
    116116                return false;
    117117        }
  • code/branches/cpp11_v2/src/modules/questsystem/effects/AddReward.cc

    r9667 r10765  
    9090            i--;
    9191        }
    92         return NULL;
     92        return nullptr;
    9393    }
    9494
  • code/branches/cpp11_v2/src/modules/questsystem/effects/CompleteQuest.cc

    r9667 r10765  
    9292        {
    9393            quest = QuestManager::getInstance().findQuest(this->getQuestId());
    94             if(quest == NULL || !quest->complete(player))
     94            if(quest == nullptr || !quest->complete(player))
    9595               return false;
    9696        }
  • code/branches/cpp11_v2/src/modules/questsystem/effects/FailQuest.cc

    r9667 r10765  
    9191        {
    9292            quest = QuestManager::getInstance().findQuest(this->getQuestId());
    93             if(quest == NULL || !quest->fail(player))
     93            if(quest == nullptr || !quest->fail(player))
    9494               return false;
    9595        }
Note: See TracChangeset for help on using the changeset viewer.