Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 22, 2008, 4:03:10 PM (16 years ago)
Author:
dafrick
Message:

Some cleaning, reorganization and implementation of some small methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem/src/orxonox/objects/QuestHint.cc

    r1992 r1996  
    5858    }
    5959   
     60    /**
     61    @brief
     62        Checks whether the hint is active for a specific player.
     63    @param player
     64        The player.
     65    @return
     66        Returns
     67    */
    6068    bool QuestHint::isActive(const Player & player) const
    6169    {
    62         //TDO: Implement.
     70        std::map<Player*, questHintStatus::Enum>::iterator it = this->playerStatus_.find(&player);
     71        if (it != this->playerStatus_.end())
     72        {
     73            return it->second;
     74        }
     75        return questStatus::inactive;
    6376    }
    6477   
    65     void QuestHint::activate(const Player & player)
     78    bool QuestHint::activate(const Player & player)
    6679    {
    67         if(this->quest_->isActive(player))
     80        if(this->quest_->isActive(player) && !this->isActive())
    6881        {
    69             //TDO: Implement.
     82            this->playerStatus_[&player] = questHintStatus::active;
     83            return true;
    7084        }
    71         else
    72         {
    73             COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
    74         }
     85        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
     86        return false;
    7587    }
    7688
Note: See TracChangeset for help on using the changeset viewer.