Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2008, 8:31:20 PM (16 years ago)
Author:
dafrick
Message:

Nearly compiles, some minor improvements.

File:
1 edited

Legend:

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

    r1996 r2021  
    3535    CreateFactory(GlobalQuest);
    3636
     37    GlobalQuest::GlobalQuest() : Quest()
     38    {
     39       
     40    }
     41
    3742    /**
    3843    @brief
     
    4550        The description of the quest.
    4651    */
    47     GlobalQuest::GlobalQuest(std::string id, std::string title = "", std::string description = "") : Quest(id, title, description)
     52    GlobalQuest::GlobalQuest(std::string id, std::string title, std::string description) : Quest(id, title, description)
    4853    {
    4954        RegisterObject(GlobalQuest);
     
    6772        Returns true if the quest can be started, false if not.
    6873    */
    69     bool GlobalQuest::isStartable(const Player & player) const
     74    bool GlobalQuest::isStartable(Player* player)
    7075    {
    7176        return this->isInactive(player) || this->isActive(player);
     
    8085        Returns true if the quest can be failed, false if not.
    8186    */
    82     bool GlobalQuest::isFailable(const Player & player) const
     87    bool GlobalQuest::isFailable(Player* player)
    8388    {
    8489        return this->isActive(player);
     
    9398        Returns true if the quest can be completed, false if not.
    9499    */
    95     bool GlobalQuest::isCompletable(const Player & player) const
     100    bool GlobalQuest::isCompletable(Player* player)
    96101    {
    97102        return this->isActive(player);
     
    104109        The player.
    105110    */
    106     questStatus::Enum getStatus(const Player & player) const
     111    questStatus::Enum GlobalQuest::getStatus(const Player* player)
    107112    {
    108113        //TDO: Does this really work???
    109         if (this->players_.find(&player) != this->players_.end())
     114        std::set<Player*>::const_iterator it = this->players_.find((Player*)(void*)player);
     115        if (it != this->players_.end())
    110116        {
    111117            return this->status_;
     
    126132        The status to be set.
    127133    */
    128     void setStatus(const Player & player, const questStatus::Enum & status)
     134    bool GlobalQuest::setStatus(Player* player, const questStatus::Enum & status)
    129135    {
    130         if (this->players_.find(&player) == this->players_.end()) //!< Player is not yet in the list.
     136        std::set<Player*>::const_iterator it = this->players_.find(player);
     137        if (it == this->players_.end()) //!< Player is not yet in the list.
    131138        {
    132             this->players_.insert(&player);
     139            this->players_.insert(player);
    133140        }
    134141        this->status_ = status;
     142        return true;
    135143    }
    136144
Note: See TracChangeset for help on using the changeset viewer.