Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/questsystem/GlobalQuest.cc

    r9667 r11071  
    9494
    9595        // Iterate through all players possessing this Quest.
    96         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    97             QuestEffect::invokeEffects(*it, this->getFailEffectList());
     96        for(PlayerInfo* questPlayer : players_)
     97            QuestEffect::invokeEffects(questPlayer, this->getFailEffectList());
    9898
    9999        return true;
     
    119119
    120120        // Iterate through all players possessing the Quest.
    121         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    122             QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
     121        for(PlayerInfo* questPlayer : players_)
     122            QuestEffect::invokeEffects(questPlayer, this->getCompleteEffectList());
    123123
    124124        Quest::complete(player);
     
    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
     
    177177        The player.
    178178    */
    179     QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
     179    QuestStatus GlobalQuest::getStatus(const PlayerInfo* player) const
    180180    {
    181181        assert(player);
     
    198198        The status to be set.
    199199    @return
    200         Returns false if player is NULL.
    201     */
    202     bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     200        Returns false if player is nullptr.
     201    */
     202    bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus & status)
    203203    {
    204204        assert(player);
     
    242242    {
    243243        int i = index;
    244         for (std::list<QuestEffect*>::const_iterator effect = this->rewards_.begin(); effect != this->rewards_.end(); ++effect)
     244        for (QuestEffect* reward : this->rewards_)
    245245        {
    246246            if(i == 0)
    247                return *effect;
     247               return reward;
    248248
    249249            i--;
    250250        }
    251         return NULL;
     251        return nullptr;
    252252    }
    253253
Note: See TracChangeset for help on using the changeset viewer.