Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Changed from ControllableEntity to PlayerInfo…

Location:
code/branches/questsystem2/src/orxonox/objects/quest
Files:
25 edited

Legend:

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

    r2191 r2205  
    4141#include "util/Exception.h"
    4242
    43 #include "orxonox/objects/worldentities/ControllableEntity.h"
     43#include "orxonox/objects/infos/PlayerInfo.h"
    4444#include "QuestManager.h"
    4545#include "Quest.h"
     
    8484        Returns true if the QuestEffect was successfully invoked.
    8585    */
    86     bool AddQuest::invoke(ControllableEntity* player)
     86    bool AddQuest::invoke(PlayerInfo* player)
    8787    {
    8888        if(player == NULL) //!< Null-pointers are badass.
     
    106106        }
    107107
     108        COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl;
    108109        return true;
    109110    }
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h

    r2191 r2205  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
     61            virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.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 "QuestManager.h"
    4343#include "QuestItem.h"
     
    105105        Returns true if the QuestEffect was successfully invoked.
    106106    */
    107     bool AddQuestHint::invoke(ControllableEntity* player)
     107    bool AddQuestHint::invoke(PlayerInfo* player)
    108108    {
    109109        if(player == NULL) //!< NULL-pointers are evil!
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h

    r2191 r2205  
    5858            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuestHint object through XML.
    5959
    60             virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
     60            virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6161
    6262        private:
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc

    r2191 r2205  
    3838#include "core/CoreIncludes.h"
    3939
    40 #include "orxonox/objects/worldentities/ControllableEntity.h"
     40#include "orxonox/objects/infos/PlayerInfo.h"
    4141#include "Rewardable.h"
    4242
     
    103103        Returns true if the QuestEffect was invoked successfully.
    104104    */
    105     bool AddReward::invoke(ControllableEntity* player)
     105    bool AddReward::invoke(PlayerInfo* player)
    106106    {
    107107        bool check = true;
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h

    r2191 r2205  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddReward object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
     61            virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6262
    6363        private:
  • code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h

    r2191 r2205  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a ChangeQuestStatus object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect.
     61            virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.
    6262
    6363        protected:
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.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 "QuestManager.h"
    4343#include "Quest.h"
     
    8181        Returns true if the QuestEffect was invoked successfully.
    8282    */
    83     bool CompleteQuest::invoke(ControllableEntity* player)
     83    bool CompleteQuest::invoke(PlayerInfo* player)
    8484    {
    8585        if(player == NULL) //!< You know, what we think of NULL-pointers...
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h

    r2191 r2205  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CompleteQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
     61            virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.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 "QuestManager.h"
    4343#include "Quest.h"
     
    8181        Returns true if the QuestEffect was invoked successfully.
    8282    */
    83     bool FailQuest::invoke(ControllableEntity* player)
     83    bool FailQuest::invoke(PlayerInfo* player)
    8484    {
    8585        if(player == NULL) //!< We don't know what to do with no player.
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h

    r2191 r2205  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a FailQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
     61            virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc

    r2191 r2205  
    3636#include "GlobalQuest.h"
    3737
    38 #include "orxonox/objects/worldentities/ControllableEntity.h"
     38#include "orxonox/objects/infos/PlayerInfo.h"
    3939#include "core/CoreIncludes.h"
    4040#include "util/Exception.h"
     
    8686        Returns true if the Quest could be failed, false if not.
    8787    */
    88     bool GlobalQuest::fail(ControllableEntity* player)
     88    bool GlobalQuest::fail(PlayerInfo* player)
    8989    {
    9090        if(this->isFailable(player)) //!< Check whether the Quest can be failed.
     
    9393           
    9494            //! Iterate through all players possessing this Quest.
    95             for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     95            for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    9696            {
    9797                QuestEffect::invokeEffects(*it, this->getFailEffectList());
     
    115115        Returns true if the Quest could be completed, false if not.
    116116    */
    117     bool GlobalQuest::complete(ControllableEntity* player)
     117    bool GlobalQuest::complete(PlayerInfo* player)
    118118    {
    119119        if(this->isCompletable(player)) //!< Check whether the Quest can be completed.
     
    122122           
    123123            //! Iterate through all players possessing the Quest.
    124             for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     124            for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    125125            {
    126126                QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
     
    145145        Throws an exception if either isInactive() of isActive() throws one.
    146146    */
    147     bool GlobalQuest::isStartable(const ControllableEntity* player) const
     147    bool GlobalQuest::isStartable(const PlayerInfo* player) const
    148148    {
    149149        return this->isInactive(player) ||  this->isActive(player);
     
    160160        Throws an Exception if isActive() throws one.
    161161    */
    162     bool GlobalQuest::isFailable(const ControllableEntity* player) const
     162    bool GlobalQuest::isFailable(const PlayerInfo* player) const
    163163    {
    164164        return this->isActive(player);
     
    176176        Throws an Exception if isActive() throws one.
    177177    */
    178     bool GlobalQuest::isCompletable(const ControllableEntity* player) const
     178    bool GlobalQuest::isCompletable(const PlayerInfo* player) const
    179179    {
    180180        return this->isActive(player);
     
    189189        Throws an Exception if player is NULL.
    190190    */
    191     questStatus::Enum GlobalQuest::getStatus(const ControllableEntity* player) const
     191    questStatus::Enum GlobalQuest::getStatus(const PlayerInfo* player) const
    192192    {
    193193        if(player == NULL) //!< We don't want NULL-Pointers!
    194194        {
    195             ThrowException(Argument, "The input ControllableEntity* is NULL.");
     195            ThrowException(Argument, "The input PlayerInfo* is NULL.");
    196196        }
    197197
    198198        //! Find the player.
    199         std::set<ControllableEntity*>::const_iterator it = this->players_.find((ControllableEntity*)(void*)player);
     199        std::set<PlayerInfo*>::const_iterator it = this->players_.find((PlayerInfo*)(void*)player);
    200200        if (it != this->players_.end()) //!< If the player was found.
    201201        {
     
    217217        Returns false if player is NULL.
    218218    */
    219     bool GlobalQuest::setStatus(ControllableEntity* player, const questStatus::Enum & status)
     219    bool GlobalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
    220220    {
    221221        if(player == NULL) //!< We don't want NULL-Pointers!
     
    225225
    226226        //! Find the player.
    227         std::set<ControllableEntity*>::const_iterator it = this->players_.find(player);
     227        std::set<PlayerInfo*>::const_iterator it = this->players_.find(player);
    228228        if (it == this->players_.end()) //!< Player is not yet in the list.
    229229        {
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h

    r2191 r2205  
    9292            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
    9393           
    94             virtual bool fail(ControllableEntity* player); //!< Fails the Quest.
    95             virtual bool complete(ControllableEntity* player); //!< Completes the Quest.
     94            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
     95            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
    9696
    9797        protected:
    98             virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started.
    99             virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed.
    100             virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed.
     98            virtual bool isStartable(const PlayerInfo* player) const; //!< Checks whether the Quest can be started.
     99            virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
     100            virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
    101101
    102             virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player.
    103             virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     102            virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     103            virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    104104
    105105        private:
    106             std::set<ControllableEntity*> players_; //!< The set of players which possess this Quest.
     106            std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest.
    107107            questStatus::Enum status_; //!< The status of this Quest.
    108108            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
  • 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.
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h

    r2191 r2205  
    8787            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
    8888           
    89             virtual bool fail(ControllableEntity* player); //!< Fails the Quest.
    90             virtual bool complete(ControllableEntity* player); //!< Completes the Quest.
     89            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
     90            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
    9191
    9292        protected:
    93             virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started.
    94             virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed.
    95             virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed.
     93            virtual bool isStartable(const PlayerInfo* player) const; //!< Checks whether the Quest can be started.
     94            virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
     95            virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
    9696
    97             virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player.
    98             virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     97            virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     98            virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    9999
    100100        private:
    101             std::map<ControllableEntity*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     101            std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    102102
    103103    };
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc

    r2191 r2205  
    3838#include "core/CoreIncludes.h"
    3939
    40 #include "orxonox/objects/worldentities/ControllableEntity.h"
     40#include "orxonox/objects/infos/PlayerInfo.h"
    4141#include "QuestManager.h"
    4242#include "QuestDescription.h"
     
    313313        Throws an exception if getStatus throws one.
    314314    */
    315     bool Quest::isInactive(const ControllableEntity* player) const
     315    bool Quest::isInactive(const PlayerInfo* player) const
    316316    {
    317317        return this->getStatus(player) == questStatus::inactive;
     
    328328        Throws an exception if getStatus throws one.
    329329    */
    330     bool Quest::isActive(const ControllableEntity* player) const
     330    bool Quest::isActive(const PlayerInfo* player) const
    331331    {
    332332
     
    344344        Throws an exception if getStatus throws one.
    345345    */
    346     bool Quest::isFailed(const ControllableEntity* player) const
     346    bool Quest::isFailed(const PlayerInfo* player) const
    347347    {
    348348        return this->getStatus(player) == questStatus::failed;
     
    359359        Throws an exception if getStatus throws one.
    360360    */
    361     bool Quest::isCompleted(const ControllableEntity* player) const
     361    bool Quest::isCompleted(const PlayerInfo* player) const
    362362    {
    363363        return this->getStatus(player) == questStatus::completed;
     
    372372        Returns true if the Quest could be started, false if not.
    373373    */
    374     bool Quest::start(ControllableEntity* player)
     374    bool Quest::start(PlayerInfo* player)
    375375    {
    376376        if(this->isStartable(player)) //!< Checks whether the quest can be started.
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.h

    r2191 r2205  
    4444
    4545#include "core/XMLPort.h"
     46
    4647#include "QuestItem.h"
    47 
    4848
    4949namespace questStatus
     
    104104                { return this->hints_; }
    105105
    106             bool isInactive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
    107             bool isActive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'active'.
    108             bool isFailed(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
    109             bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
     106            bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     107            bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
     108            bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
     109            bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    110110
    111             bool start(ControllableEntity* player); //!< Sets a Quest to active.
    112             virtual bool fail(ControllableEntity* player) = 0; //!< Fails the Quest.
    113             virtual bool complete(ControllableEntity* player) = 0; //!< Completes the Quest.
     111            bool start(PlayerInfo* player); //!< Sets a Quest to active.
     112            virtual bool fail(PlayerInfo* player) = 0; //!< Fails the Quest.
     113            virtual bool complete(PlayerInfo* player) = 0; //!< Completes the Quest.
    114114
    115115        protected:
    116             virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be started.
    117             virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be failed.
    118             virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be completed.
     116            virtual bool isStartable(const PlayerInfo* player) const = 0; //!< Checks whether the Quest can be started.
     117            virtual bool isFailable(const PlayerInfo* player) const = 0; //!< Checks whether the Quest can be failed.
     118            virtual bool isCompletable(const PlayerInfo* player) const = 0; //!< Checks whether the Quest can be completed.
    119119
    120120            const Quest* getParentQuest(void); //!< Returns the parentquest of the Quest.
     
    138138                { return this->completeEffects_; }
    139139
    140             virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the Quest for a specific player.
    141             virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
     140            virtual questStatus::Enum getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
     141            virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
    142142           
    143143        private:
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.cc

    r2159 r2205  
    3434
    3535#include "OrxonoxStableHeaders.h"
     36
    3637#include "QuestDescription.h"
    3738
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc

    r2191 r2205  
    3838#include "core/CoreIncludes.h"
    3939
    40 #include "orxonox/objects/worldentities/ControllableEntity.h"
     40#include "orxonox/objects/infos/PlayerInfo.h"
    4141
    4242namespace orxonox {
     
    7171        Returns false if there was an error, view console of log for further detail.
    7272    */
    73     bool QuestEffect::invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects)
     73    bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)
    7474    {
    7575        bool check = true;
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h

    r2191 r2205  
    5757            virtual ~QuestEffect();
    5858
    59             virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect.
    60             static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all QuestEffects in the list.
     59            virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.
     60            static bool invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects); //!< Invokes all QuestEffects in the list.
    6161
    6262
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r2196 r2205  
    3535#include "core/EventIncludes.h"
    3636
     37#include "orxonox/objects/infos/PlayerInfo.h"
    3738#include "orxonox/objects/worldentities/ControllableEntity.h"
    3839#include "orxonox/objects/worldentities/triggers/PlayerTrigger.h"
     
    5051        this->times_ = -1;
    5152        this->trigger_ = NULL;
    52         this->player_ = NULL;
    5353    }
    5454
     
    6969    {
    7070        SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
    71        
    72         this->player_ = dynamic_cast<ControllableEntity*>(event.originator_);
    7371    }
    7472   
    75     bool QuestEffectBeacon::execute(void)
     73    bool QuestEffectBeacon::execute(bool b, ControllableEntity* entity)
    7674    {
    77        
    78         if(!(this->isActive()))
     75        if(!b || !(this->isActive()))
    7976        {
    8077            return false;
    8178        }
    82         if(this->player_ == NULL)
     79        if(entity == NULL)
    8380        {
    8481            return false;
    8582        }
    8683       
    87         bool check = QuestEffect::invokeEffects(this->player_, this->effects_);
     84        PlayerInfo* player = entity->getPlayer();
     85       
     86        bool check = QuestEffect::invokeEffects(player, this->effects_);
    8887        if(check)
    8988        {
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2196 r2205  
    6363            virtual void processEvent(Event& event);
    6464           
    65             bool execute(void);
     65            bool execute(bool b, ControllableEntity* player);
    6666           
    6767            bool isActive(void);
     
    7878            QuestEffectBeaconStatus::Enum status_;
    7979            PlayerTrigger* trigger_;
    80             ControllableEntity* player_;
    8180           
    8281            bool setTimes(const int & n);
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.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 "Quest.h"
    4343
     
    8686        Returns true if the QuestHint is active for the specified player.
    8787    */
    88     bool QuestHint::isActive(ControllableEntity* player)
     88    bool QuestHint::isActive(const PlayerInfo* player) const
    8989    {
    9090        if(player == NULL) //!< NULL-Pointers are ugly!
    9191        {
    92             ThrowException(Argument, "The input ControllableEntity* is NULL.");
     92            ThrowException(Argument, "The input PlayerInfo* is NULL.");
    9393            return false;
    9494        }
    9595
    9696        //! Find the player.
    97         std::map<ControllableEntity*, questHintStatus::Enum>::iterator it = this->playerStatus_.find(player);
     97        std::map<const PlayerInfo*, questHintStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
    9898        if (it != this->playerStatus_.end()) //!< If the player is in the map.
    9999        {
     
    112112        Returns true if the activation was successful, false if there were problems.
    113113    */
    114     bool QuestHint::setActive(ControllableEntity* player)
     114    bool QuestHint::setActive(PlayerInfo* player)
    115115    {
    116116        if(this->quest_->isActive(player)) //!< For a hint to get activated the quest must be active.
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h

    r2191 r2205  
    8282            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
    8383
    84             bool isActive(ControllableEntity* player); //!< Returns true if the QuestHint is active for the input player.
     84            bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player.
    8585
    86             bool setActive(ControllableEntity* player); //!< Activates the QuestHint for the input player.
     86            bool setActive(PlayerInfo* player); //!< Activates the QuestHint for the input player.
    8787            bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to.
    8888
     
    9696        private:
    9797            Quest* quest_; //!< The Quest the QuestHint belongs to.
    98             std::map<ControllableEntity*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     98            std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    9999
    100100    };
  • code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.h

    r2159 r2205  
    6666                Return true if successful.
    6767            */
    68             virtual bool reward(ControllableEntity* player) = 0; //!<
     68            virtual bool reward(PlayerInfo* player) = 0; //!<
    6969
    7070    };
Note: See TracChangeset for help on using the changeset viewer.