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/GlobalQuest.cc

    r1992 r1996  
    5858       
    5959    }
     60   
     61    /**
     62    @brief
     63        Checks whether the quest can be started.
     64    @param player
     65        The player for whom is to be checked.
     66    @return
     67        Returns true if the quest can be started, false if not.
     68    */
     69    bool GlobalQuest::isStartable(const Player & player) const
     70    {
     71        return this->isInactive(player) || this->isActive(player);
     72    }
     73   
     74    /**
     75    @brief
     76        Checks whether the quest can be failed.
     77    @param player
     78        The player for whom is to be checked.
     79    @return
     80        Returns true if the quest can be failed, false if not.
     81    */
     82    bool GlobalQuest::isFailable(const Player & player) const
     83    {
     84        return this->isActive(player);
     85    }
     86   
     87    /**
     88    @brief
     89        Checks whether the quest can be completed.
     90    @param player
     91        The player for whom is to be checked.
     92    @return
     93        Returns true if the quest can be completed, false if not.
     94    */
     95    bool GlobalQuest::isCompletable(const Player & player) const
     96    {
     97        return this->isActive(player);
     98    }
    6099
    61100    /**
     
    65104        The player.
    66105    */
    67     virtual questStatus::Enum getStatus(const Player & player) const
     106    questStatus::Enum getStatus(const Player & player) const
    68107    {
    69108        //TDO: Does this really work???
     
    87126        The status to be set.
    88127    */
    89     virtual void setStatus(const Player & player, const questStatus::Enum & status)
     128    void setStatus(const Player & player, const questStatus::Enum & status)
    90129    {
    91         //TDO: Implement.
     130        if (this->players_.find(&player) == this->players_.end()) //!< Player is not yet in the list.
     131        {
     132            this->players_.insert(&player);
     133        }
     134        this->status_ = status;
    92135    }
    93136
     137
    94138}
Note: See TracChangeset for help on using the changeset viewer.