Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 13, 2008, 9:55:01 PM (15 years ago)
Author:
dafrick
Message:

Changed from ControllableEntity to PlayerInfo…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc

    r2191 r2205  
    3939#include "util/Exception.h"
    4040
    41 #include "orxonox/objects/worldentities/ControllableEntity.h"
     41#include "orxonox/objects/infos/PlayerInfo.h"
    4242#include "QuestEffect.h"
    4343
     
    8484        Returns true if the Quest could be failed, false if not.
    8585    */
    86     bool LocalQuest::fail(ControllableEntity* player)
     86    bool LocalQuest::fail(PlayerInfo* player)
    8787    {
    8888        if(this->isFailable(player)) //!< Checks whether the quest can be failed.
     
    106106        Returns true if the Quest could be completed, false if not.
    107107    */
    108     bool LocalQuest::complete(ControllableEntity* player)
     108    bool LocalQuest::complete(PlayerInfo* player)
    109109    {
    110110        if(this->isCompletable(player)) //!< Checks whether the Quest can be completed.
     
    127127        Returns true if the Quest can be started, false if not.
    128128    @throws
    129         Throws an exception if isInactive(ControllableEntity*) throws one.
    130     */
    131     bool LocalQuest::isStartable(const ControllableEntity* player) const
     129        Throws an exception if isInactive(PlayerInfo*) throws one.
     130    */
     131    bool LocalQuest::isStartable(const PlayerInfo* player) const
    132132    {
    133133        return this->isInactive(player);
     
    142142        Returns true if the Quest can be failed, false if not.
    143143    @throws
    144         Throws an exception if isActive(ControllableEntity*) throws one.
    145     */
    146     bool LocalQuest::isFailable(const ControllableEntity* player) const
     144        Throws an exception if isActive(PlayerInfo*) throws one.
     145    */
     146    bool LocalQuest::isFailable(const PlayerInfo* player) const
    147147    {
    148148        return this->isActive(player);
     
    157157        Returns true if the Quest can be completed, false if not.
    158158    @throws
    159         Throws an exception if isInactive(ControllableEntity*) throws one.
    160     */
    161     bool LocalQuest::isCompletable(const ControllableEntity* player) const
     159        Throws an exception if isInactive(PlayerInfo*) throws one.
     160    */
     161    bool LocalQuest::isCompletable(const PlayerInfo* player) const
    162162    {
    163163        return this->isActive(player);
     
    174174        Throws an Exception if player is NULL.
    175175    */
    176     questStatus::Enum LocalQuest::getStatus(const ControllableEntity* player) const
     176    questStatus::Enum LocalQuest::getStatus(const PlayerInfo* player) const
    177177    {
    178178        if(player == NULL) //!< No player has no defined status.
    179179        {
    180             ThrowException(Argument, "The input ControllableEntity* is NULL.");
    181         }
    182 
    183         std::map<ControllableEntity*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((ControllableEntity*)(void*)player); //Thx. to x3n for the (ControllableEntity*)(void*) 'hack'.
     180            ThrowException(Argument, "The input PlayerInfo* is NULL.");
     181        }
     182
     183        std::map<const PlayerInfo*, questStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
    184184        if (it != this->playerStatus_.end()) //!< If there is a player in the map.
    185185        {
     
    201201        Returns false if player is NULL.
    202202    */
    203     bool LocalQuest::setStatus(ControllableEntity* player, const questStatus::Enum & status)
     203    bool LocalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
    204204    {
    205205        if(player == NULL) //!< We can't set a status for no player.
Note: See TracChangeset for help on using the changeset viewer.