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

    r1992 r1996  
    6161    /**
    6262    @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 LocalQuest::isStartable(const Player & player) const
     70    {
     71        return this->isInactive(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 LocalQuest::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 LocalQuest::isCompletable(const Player & player) const
     96    {
     97        return this->isActive(player);
     98    }
     99   
     100    /**
     101    @brief
    63102        Returns the status of the quest for a specific player.
    64103    @param player
    65         The player
     104        The player.
     105    @return
     106        Returns the status of the quest for the input player.
    66107    */
    67     virtual int LocalQuest::getStatus(const Player & player) const
     108    virtual questStatus::Enum LocalQuest::getStatus(const Player & player) const
    68109    {
    69         //TDO: Implenet.
     110        std::map<Player*, questStatus::Enum>::iterator it = this->playerStatus_.find(&player);
     111        if (it != this->playerStatus_.end())
     112        {
     113            return it->second;
     114        }
     115        return questStatus::inactive;
    70116    }
    71117   
     
    80126    virtual void LocalQuest::setStatus(const Player & player, const questStatus::Enum & status)
    81127    {
    82         //TDO: Implement.
     128        this->playerStatus[&player] = status;
    83129    }
    84130
Note: See TracChangeset for help on using the changeset viewer.