Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2008, 11:34:35 PM (16 years ago)
Author:
rgrieder
Message:

Merged revisions 2384-2436 from presentation branch to bugger.

Location:
code/branches/bugger
Files:
56 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/branches/bugger

  • code/branches/bugger/src/orxonox/objects/Level.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/Level.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/pickup/Usable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/quest/AddQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddQuest.cc
    31     @brief
    32     Implementation of the AddQuest class.
     30    @file
     31    @brief Implementation of the AddQuest class.
    3332*/
    3433
     
    4544#include "Quest.h"
    4645
    47 namespace orxonox {
    48 
     46namespace orxonox
     47{
    4948    CreateFactory(AddQuest);
    5049
     
    109108        }
    110109
    111         COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl;
     110        COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player: " << player << " ." << std::endl;
    112111        return true;
    113112    }
  • code/branches/bugger/src/orxonox/objects/quest/AddQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddQuest.h
    31     @brief
    32     Definition of the AddQuest class.
     30    @file
     31    @brief Definition of the AddQuest class.
    3332*/
    3433
     
    4342#include "ChangeQuestStatus.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
     
    5857    {
    5958        public:
    60             AddQuest(BaseObject* creator);
    61             virtual ~AddQuest();
    62 
    63             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
    64 
    65             virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
     59        AddQuest(BaseObject* creator);
     60        virtual ~AddQuest();
     61   
     62        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
     63   
     64        virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6665
    6766    };
  • code/branches/bugger/src/orxonox/objects/quest/AddQuestHint.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddQuestHint.cc
    31     @brief
    32     Implementation of the AddQuestHint class.
     30    @file
     31    @brief Implementation of the AddQuestHint class.
    3332*/
    3433
     
    4443#include "QuestHint.h"
    4544
    46 namespace orxonox {
    47 
     45namespace orxonox
     46{
    4847    CreateFactory(AddQuestHint);
    4948
     
    130129        }
    131130
    132         COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player." << std::endl;
     131        COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player: " << player << " ." << std::endl;
    133132        return true;
    134133
  • code/branches/bugger/src/orxonox/objects/quest/AddQuestHint.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddQuestHint.h
    31     @brief
    32     Definition of the AddQuestHint class.
     30    @file
     31    @brief Definition of the AddQuestHint class.
    3332*/
    3433
     
    4241#include "QuestEffect.h"
    4342
    44 namespace orxonox {
    45 
     43namespace orxonox
     44{
    4645    /**
    4746    @brief
     
    7372            inline const std::string & getHintId(void) const
    7473                { return this->hintId_; }
     74           
    7575            bool setHintId(const std::string & id); //!< Sets the id of the QuestHint.
    7676
  • code/branches/bugger/src/orxonox/objects/quest/AddReward.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddReward.cc
    31     @brief
    32     Implementation of the AddReward class.
     30    @file
     31    @brief Implementation of the AddReward class.
    3332*/
    3433
     
    4140#include "Rewardable.h"
    4241
    43 namespace orxonox {
    44 
     42namespace orxonox
     43{
    4544    CreateFactory(AddReward);
    4645
     
    106105    bool AddReward::invoke(PlayerInfo* player)
    107106    {
     107        COUT(3) << "AddReward on player: " << player << " ." << std::endl;
     108       
    108109        bool check = true;
    109110        for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
     
    111112            check = check && (*reward)->reward(player);
    112113        }
     114       
     115        COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl;
    113116
    114117        return check;
  • code/branches/bugger/src/orxonox/objects/quest/AddReward.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file AddReward.h
    31     @brief
    32     Definition of the AddReward class.
     30    @file
     31    @brief Definition of the AddReward class.
    3332*/
    3433
     
    4342#include "QuestEffect.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
     
    7877            inline void addRewardable(Rewardable* reward)
    7978                { this->rewards_.push_back(reward); }
     79       
    8080            const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index.
    8181
  • code/branches/bugger/src/orxonox/objects/quest/CMakeLists.txt

    r2530 r2533  
    1414  QuestHint.cc
    1515  QuestItem.cc
     16  QuestListener.cc
    1617  QuestManager.cc
    1718  Rewardable.cc
  • code/branches/bugger/src/orxonox/objects/quest/ChangeQuestStatus.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file ChangeQuestStatus.cc
    31     @brief
    32     Implementation of the ChangeQuestStatus class.
     30    @file
     31    @brief Implementation of the ChangeQuestStatus class.
    3332*/
    3433
     
    4039#include "QuestItem.h"
    4140
    42 namespace orxonox {
    43 
     41namespace orxonox
     42{
    4443    /**
    4544    @brief
  • code/branches/bugger/src/orxonox/objects/quest/ChangeQuestStatus.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file ChangeQuestStatus.h
    31     @brief
    32     Definition of the ChangeQuestStatus class.
     30    @file
     31    @brief Definition of the ChangeQuestStatus class.
    3332*/
    3433
     
    4342#include "QuestEffect.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
     
    6362        protected:
    6463            /**
    65                 @brief Returns the id of the Quest.
    66                 @return Returns the id of the Quest.
     64            @brief Returns the id of the Quest.
     65            @return Returns the id of the Quest.
    6766            */
    6867            inline const std::string & getQuestId(void) const
  • code/branches/bugger/src/orxonox/objects/quest/CompleteQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file CompleteQuest.cc
    31     @brief
    32     Implementation of the CompleteQuest class.
     30    @file
     31    @brief Implementation of the CompleteQuest class.
    3332*/
    3433
     
    4342#include "Quest.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    CreateFactory(CompleteQuest);
    4847
  • code/branches/bugger/src/orxonox/objects/quest/CompleteQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file CompleteQuest.h
    31     @brief
    32     Definition of the CompleteQuest class.
     30    @file
     31    @brief Definition of the CompleteQuest class.
    3332*/
    3433
     
    4342#include "ChangeQuestStatus.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
  • code/branches/bugger/src/orxonox/objects/quest/FailQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file FailQuest.cc
    31     @brief
    32     Implementation of the FailQuest class.
     30    @file
     31    @brief Implementation of the FailQuest class.
    3332*/
    3433
     
    4342#include "Quest.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    CreateFactory(FailQuest);
    4847
  • code/branches/bugger/src/orxonox/objects/quest/FailQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file FailQuest.h
    31     @brief
    32     Definition of the FailQuest class.
     30    @file
     31    @brief Definition of the FailQuest class.
    3332*/
    3433
     
    4342#include "ChangeQuestStatus.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
  • code/branches/bugger/src/orxonox/objects/quest/GlobalQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file GlobalQuest.cc
    31     @brief
    32     Implementation of the GlobalQuest class.
     30    @file
     31    @brief Implementation of the GlobalQuest class.
    3332*/
    3433
     
    3837#include "orxonox/objects/infos/PlayerInfo.h"
    3938#include "core/CoreIncludes.h"
     39#include "core/Super.h"
    4040#include "util/Exception.h"
    4141
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(GlobalQuest);
    4747
     
    8888    bool GlobalQuest::fail(PlayerInfo* player)
    8989    {
    90         if(this->isFailable(player)) //!< Check whether the Quest can be failed.
    91         {
    92             this->setStatus(player, questStatus::failed);
    93            
    94             //! Iterate through all players possessing this Quest.
    95             for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    96             {
    97                 QuestEffect::invokeEffects(*it, this->getFailEffectList());
    98             }
    99 
    100             return true;
    101         }
    102        
    103         COUT(4) << "A non-completable quest was trying to be failed." << std::endl;
    104         return false;
     90        if(!this->isFailable(player)) //!< Check whether the Quest can be failed.
     91        {
     92            COUT(4) << "A non-completable quest was trying to be failed." << std::endl;
     93            return false;
     94        }
     95       
     96        Quest::fail(player);
     97   
     98    //! Iterate through all players possessing this Quest.
     99    for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     100    {
     101        QuestEffect::invokeEffects(*it, this->getFailEffectList());
     102    }
     103
     104    return true;
    105105    }
    106106
     
    117117    bool GlobalQuest::complete(PlayerInfo* player)
    118118    {
    119         if(this->isCompletable(player)) //!< Check whether the Quest can be completed.
    120         {
    121             this->setStatus(player, questStatus::completed);
    122            
    123             //! Iterate through all players possessing the Quest.
    124             for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    125             {
    126                 QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
    127             }
    128            
    129             QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
    130             return true;
    131         }
    132        
    133         COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
    134         return false;
     119        if(!this->isCompletable(player)) //!< Check whether the Quest can be completed.
     120        {
     121            COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
     122            return false;
     123        }
     124       
     125        //! Iterate through all players possessing the Quest.
     126        for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     127        {
     128            QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
     129        }
     130   
     131        Quest::complete(player);
     132   
     133        QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
     134        return true;
    135135    }
    136136
     
    207207        }
    208208
    209     return questStatus::inactive;
     209        return questStatus::inactive;
    210210    }
    211211
  • code/branches/bugger/src/orxonox/objects/quest/GlobalQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file GlobalQuest.h
    31     @brief
    32     Definition of the GlobalQuest class.
     30    @file
     31    @brief Definition of the GlobalQuest class.
    3332*/
    3433
     
    4443#include "Quest.h"
    4544
    46 namespace orxonox {
    47 
     45namespace orxonox
     46{
    4847    /**
    4948    @brief
     
    5655            <QuestDescription title="Title" description="Description." /> //The description of the quest.
    5756            <subquests>
    58         <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
    59         ...
    60         <Quest id="questIdn" />
    61         </subquests>
    62         <hints>
    63         <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
    64         ...
    65         <QuestHint id="hintIdn" />
    66         </hints>
     57                <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
     58                ...
     59                <Quest id="questIdn" />
     60            </subquests>
     61            <hints>
     62                <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
     63                ...
     64                <QuestHint id="hintIdn" />
     65            </hints>
    6766            <fail-effects>
    6867                <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation.
  • code/branches/bugger/src/orxonox/objects/quest/LocalQuest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file LocalQuest.cc
    31     @brief
    32     Implementation of the LocalQuest class.
     30    @file
     31    @brief Implementation of the LocalQuest class.
    3332*/
    3433
     
    3736
    3837#include "core/CoreIncludes.h"
     38#include "core/Super.h"
    3939#include "util/Exception.h"
    4040
     
    4242#include "QuestEffect.h"
    4343
    44 namespace orxonox {
    45 
     44namespace orxonox
     45{
    4646    CreateFactory(LocalQuest);
    4747
     
    8686    bool LocalQuest::fail(PlayerInfo* player)
    8787    {
    88         if(this->isFailable(player)) //!< Checks whether the quest can be failed.
    89         {
    90             this->setStatus(player, questStatus::failed);
    91             QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    92             return true;
    93         }
    94        
    95         COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
    96         return false;
     88        if(!this->isFailable(player)) //!< Checks whether the quest can be failed.
     89        {
     90            COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
     91            return false;
     92        }
     93       
     94        Quest::fail(player);
     95       
     96        QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
     97        return true;
    9798    }
    9899
     
    108109    bool LocalQuest::complete(PlayerInfo* player)
    109110    {
    110         if(this->isCompletable(player)) //!< Checks whether the Quest can be completed.
    111         {
    112             this->setStatus(player, questStatus::completed);
    113             QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    114             return true;
    115         }
    116        
    117         COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
    118         return false;
     111        if(!this->isCompletable(player)) //!< Checks whether the Quest can be completed.
     112        {
     113            COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
     114            return false;
     115        }
     116       
     117        Quest::complete(player);
     118       
     119        QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
     120        return true;
    119121    }
    120122
  • code/branches/bugger/src/orxonox/objects/quest/LocalQuest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file LocalQuest.h
    31     @brief
    32     Definition of the LocalQuest class.
     30    @file
     31    @brief Definition of the LocalQuest class.
    3332*/
    3433
     
    4443#include "Quest.h"
    4544
    46 namespace orxonox {
    47 
     45namespace orxonox
     46{
    4847    /**
    4948    @brief
     
    5655            <QuestDescription title="Title" description="Description." /> //The description of the quest.
    5756            <subquests>
    58         <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
    59         ...
    60         <Quest id="questIdn" />
    61         </subquests>
    62         <hints>
    63         <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
    64         ...
    65         <QuestHint id="hintIdn" />
    66         </hints>
     57                <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
     58                ...
     59                <Quest id="questIdn" />
     60                </subquests>
     61                <hints>
     62                <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
     63                ...
     64                <QuestHint id="hintIdn" />
     65                </hints>
    6766            <fail-effects>
    6867                <QuestEffect /> //A list of QuestEffects, invoked when the Quest is failed, see QuestEffect for the full XML representation.
  • code/branches/bugger/src/orxonox/objects/quest/Quest.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file Quest.cc
    31     @brief
    32     Implementation of the Quest class.
     30    @file
     31    @brief Implementation of the Quest class.
    3332*/
    3433
     
    4342#include "QuestHint.h"
    4443#include "QuestEffect.h"
    45 
    46 namespace orxonox {
    47 
     44#include "QuestListener.h"
     45
     46namespace orxonox
     47{
    4848    /**
    4949    @brief
     
    363363        return this->getStatus(player) == questStatus::completed;
    364364    }
     365   
     366    /**
     367    @brief
     368        Fails the Quest for an input player.
     369    @param player
     370        The player.
     371    @return
     372        Returns true if the Quest could be failed, false if not.
     373    */
     374    bool Quest::fail(PlayerInfo* player)
     375    {
     376        QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
     377        this->setStatus(player, questStatus::failed);
     378       
     379        COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
     380       
     381        this->getDescription()->sendFailQuestNotification();
     382        return true;
     383    }
     384   
     385    /**
     386    @brief
     387        Completes the Quest for an input player.
     388    @param player
     389        The player.
     390    @return
     391        Returns true if the Quest could be completed, false if not.
     392    */
     393    bool Quest::complete(PlayerInfo* player)
     394    {
     395        QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
     396        this->setStatus(player, questStatus::completed);
     397       
     398        COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
     399       
     400        this->getDescription()->sendCompleteQuestNotification();
     401        return true;
     402    }
    365403
    366404    /**
     
    374412    bool Quest::start(PlayerInfo* player)
    375413    {
    376         if(this->isStartable(player)) //!< Checks whether the quest can be started.
    377         {
    378             this->setStatus(player, questStatus::active);
    379             return true;
    380         }
    381        
    382         COUT(4) << "A non-startable quest was trying to be started." << std::endl;
    383         return false;
     414        if(!this->isStartable(player)) //!< Checks whether the quest can be started.
     415        {
     416            COUT(4) << "A non-startable quest was trying to be started." << std::endl;
     417            return false;
     418        }
     419       
     420        COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
     421       
     422        QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
     423       
     424        this->setStatus(player, questStatus::active);
     425       
     426        this->getDescription()->sendAddQuestNotification();
     427        return true;
     428    }
     429   
     430    /**
     431    @brief
     432        Adds a QuestListener to the list of QuestListeners listening to this Quest.
     433    @param listener
     434        The QuestListener to be added.
     435    @return
     436        Returns true if successful, false if not.
     437    */
     438    bool Quest::addListener(QuestListener* listener)
     439    {
     440        if(listener == NULL)
     441        {
     442            COUT(2) << "A NULL-QuestListener was trying to be added to a Quests listeners." << std::endl;
     443            return false;
     444        }
     445       
     446        this->listeners_.push_back(listener);
     447        return true;
    384448    }
    385449
  • code/branches/bugger/src/orxonox/objects/quest/Quest.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file Quest.h
    31     @brief
    32     Definition of the Quest class.
    33    
    34     The Quest is the parent class of LocalQuest and GlobalQuest.
     30    @file
     31    @brief Definition of the Quest class.
     32        The Quest is the parent class of LocalQuest and GlobalQuest.
    3533*/
    3634 
     
    4745#include "QuestItem.h"
    4846
    49 namespace questStatus
     47namespace orxonox
    5048{
     49    namespace questStatus
     50    {
    5151
    52     //!Different states of a Quest.
    53     enum Enum
    54     {
    55         inactive,
    56         active,
    57         failed,
    58         completed
    59     };
     52        //!Different states of a Quest.
     53        enum Enum
     54        {
     55            inactive,
     56            active,
     57            failed,
     58            completed
     59        };
    6060
    61 }
    62 
    63 namespace orxonox {
     61    }
    6462
    6563    /**
     
    9088                { return this->parentQuest_; }
    9189               
    92             /**
    93             @brief Returns the list of subquests.
    94             @return Returns a reference to the list of subquests of the quest.
    95             */
    96             inline const std::list<Quest*> & getSubQuestList(void) const
    97                 { return this->subQuests_; }
    98                    
    99             /**
    100             @brief Returns the list of all QuestHints of this Quest.
    101             @return Returns a reference to the list of QuestHints of the Quest.
    102             */
    103             inline const std::list<QuestHint*> & getHintsList(void) const
    104                 { return this->hints_; }
    105            
    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'.
    110            
    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.
     90            /**
     91            @brief Returns the list of subquests.
     92            @return Returns a reference to the list of subquests of the quest.
     93            */
     94            inline const std::list<Quest*> & getSubQuestList(void) const
     95                { return this->subQuests_; }
     96
     97            /**
     98            @brief Returns the list of all QuestHints of this Quest.
     99            @return Returns a reference to the list of QuestHints of the Quest.
     100            */
     101            inline const std::list<QuestHint*> & getHintsList(void) const
     102                { return this->hints_; }
     103       
     104            bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     105            bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
     106            bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
     107            bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
     108       
     109            bool start(PlayerInfo* player); //!< Sets a Quest to active.
     110            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
     111            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
     112       
     113            bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest.
    114114
    115115        protected:
     
    131131                { return this->failEffects_; }
    132132               
    133             /**
    134             @brief Returns the list of complete QuestEffects.
    135             @return Returns a reference to the list of complete QuestEffects.
    136             */
    137             inline std::list<QuestEffect*> & getCompleteEffectList(void)
     133            /**
     134            @brief Returns the list of complete QuestEffects.
     135            @return Returns a reference to the list of complete QuestEffects.
     136            */
     137            inline std::list<QuestEffect*> & getCompleteEffectList(void)
    138138                { return this->completeEffects_; }
    139139
     
    141141            virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
    142142           
    143     private:
     143        private:
    144144            Quest* parentQuest_; //!< Pointer to the parentquest.
    145145            std::list<Quest*> subQuests_; //!< List of all the subquests.
     
    149149            std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed.
    150150            std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed.
     151           
     152            std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest.
    151153           
    152154            bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest.
  • code/branches/bugger/src/orxonox/objects/quest/QuestDescription.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file QuestDescription.cc
    31     @brief
    32     Implementation of the QuestDescription class.
     30    @file
     31    @brief Implementation of the QuestDescription class.
    3332*/
    3433
     
    3837
    3938#include "core/CoreIncludes.h"
     39#include "orxonox/overlays/notifications/Notification.h"
    4040
    41 namespace orxonox {
    42 
     41namespace orxonox
     42{
    4343    CreateFactory(QuestDescription);
    4444
     
    7474        XMLPortParam(QuestDescription, "title", setTitle, getTitle, xmlelement, mode);
    7575        XMLPortParam(QuestDescription, "description", setDescription, getDescription, xmlelement, mode);
     76        XMLPortParam(QuestDescription, "failMessage", setFailMessage, getFailMessage, xmlelement, mode);
     77        XMLPortParam(QuestDescription, "completeMessage", setCompleteMessage, getCompleteMessage, xmlelement, mode);
    7678
    7779        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
     80    }
     81   
     82    /**
     83    @brief
     84        This method is a helper for sending QuestDescriptions as Notifications.
     85    @param item
     86        The item the QuestDescription is for.
     87    @param status
     88        The status the QuestDescription us for.
     89    @return
     90        Returns true if successful.
     91    */
     92    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const
     93    {
     94        std::string message = "";
     95        std::string title = "";
     96        if(item == "hint")
     97        {
     98            title = "You received a hint: '" + this->title_ + "'";
     99            message = this->description_;
     100        }
     101        else if(item == "quest")
     102        {
     103            if(status == "start")
     104            {
     105                title = "You received a new quest: '" + this->title_ + "'";
     106                message = this->description_;
     107            }
     108            else if(status == "fail")
     109            {
     110                title = "You failed the quest: '" + this->title_ + "'";
     111                message = this->failMessage_;
     112            }
     113            else if(status == "complete")
     114            {
     115                title = "You successfully completed the quest: '" + this->title_ + "'";
     116                message = this->completeMessage_;
     117            }
     118            else
     119            {
     120                COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl;
     121                return false;
     122            }
     123        }
     124        else
     125        {
     126            COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl;
     127            return false;
     128        }
     129       
     130        Notification* notification = new Notification(0, message, title, 30);
     131        notification->send();
     132        return true;
    78133    }
    79134
  • code/branches/bugger/src/orxonox/objects/quest/QuestDescription.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file QuestDescription.h
    31     @brief
    32     Definition of the QuestDescription class.
     30    @file
     31    @brief Definition of the QuestDescription class.
    3332*/
    3433
     
    4342#include "core/XMLPort.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
     
    5251        Creating a QuestDescription through XML goes as follows:
    5352       
    54         <QuestDescription title="Title" description="Description Text" />
     53        <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
    5554    @author
    5655        Damian 'Mozork' Frick
    5756    */
    58     class _OrxonoxExport QuestDescription : public BaseObject {
    59 
     57    class _OrxonoxExport QuestDescription : public BaseObject
     58    {
    6059        public:
    6160            QuestDescription(BaseObject* creator);
     
    6463            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML.
    6564
    66         /**
    67         @brief Returns the title.
    68         @return Returns a string containing the title of the QuestDescription.
    69         */
     65            /**
     66            @brief Returns the title.
     67            @return Returns a string containing the title of the QuestDescription.
     68            */
    7069            inline const std::string & getTitle(void) const
    7170                { return this->title_; }
    7271       
    73         /**
    74         @brief Returns the description text.
    75         @return Returns a string containing the description text of the QuestDescription.
    76         */
     72            /**
     73            @brief Returns the description text.
     74            @return Returns a string containing the description text of the QuestDescription.
     75            */
    7776            inline const std::string & getDescription(void) const
    7877                { return this->description_; }
     78       
     79            /**
     80            @brief Returns the fail message.
     81            @return Returns a string containing the fail message of the QuestDescription.
     82            */
     83            inline const std::string & getFailMessage(void) const
     84                { return this->failMessage_; }
     85       
     86            /**
     87            @brief Returns the complete message.
     88            @return Returns a string containing the complete message of the QuestDescription.
     89            */
     90            inline const std::string & getCompleteMessage(void) const
     91                { return this->completeMessage_; }
     92       
     93            /**
     94            @brief Sends a Notification displaying that a QuestHint was added.
     95            @return Returns true if successful.
     96            */
     97            inline bool sendAddHintNotification(void) const
     98                { return notificationHelper("hint", ""); }
     99       
     100            /**
     101            @brief Sends a Notification displaying that a Quest was added.
     102            @return Returns true if successful.
     103            */
     104            inline bool sendAddQuestNotification(void) const
     105                { return notificationHelper("quest", "start"); }
     106       
     107            /**
     108            @brief Sends a Notification displaying that a Quest was failed.
     109            @return Returns true if successful.
     110            */
     111            inline bool sendFailQuestNotification(void) const
     112                { return notificationHelper("quest", "fail"); }
     113       
     114            /**
     115            @brief Sends a Notification displaying that a Quest was completed.
     116            @return Returns true if successful.
     117            */
     118            inline bool sendCompleteQuestNotification(void) const
     119                { return notificationHelper("quest", "complete"); }
    79120
    80121        private:
    81122            std::string title_; //!< The title.
    82123            std::string description_; //!< The description.
     124            std::string failMessage_; //!< The message displayed when the Quest is failed.
     125            std::string completeMessage_; //!< The message displayed when the Quest is completed.
     126
     127            bool notificationHelper(const std::string & item, const std::string & status) const; //!< Helper for sending QuestDescriptions as Notifications.
    83128
    84129            /**
     
    89134                { this->title_ = title; }
    90135               
    91         /**
     136            /**
    92137            @brief Sets the description text.
    93138            @param description The description text to be set.
     
    96141                { this->description_ = description; }
    97142
     143            /**
     144            @brief Sets the fail message.
     145            @param message The fail message to be set.
     146            */
     147            inline void setFailMessage(const std::string & message)
     148                { this->failMessage_ = message; }
     149               
     150            /**
     151            @brief Sets the complete message.
     152            @param message The complete message to be set.
     153            */
     154            inline void setCompleteMessage(const std::string & message)
     155                { this->completeMessage_ = message; }
     156
    98157    };
    99158
  • code/branches/bugger/src/orxonox/objects/quest/QuestEffect.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file QuestEffect.cc
    31     @brief
    32     Implementation of the QuestEffect class.
     30    @file
     31    @brief Implementation of the QuestEffect class.
    3332*/
    3433
     
    4039#include "orxonox/objects/infos/PlayerInfo.h"
    4140
    42 namespace orxonox {
    43 
     41namespace orxonox
     42{
    4443    /**
    4544    @brief
     
    7170        Returns false if there was an error, view console of log for further detail.
    7271    */
    73     bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)
     72    /*static*/ bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)
    7473    {
    7574        bool check = true;
     75       
     76        COUT(4) << "Invoking QuestEffects on player: " << player << " ."  << std::endl;
    7677
    7778        for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
  • code/branches/bugger/src/orxonox/objects/quest/QuestEffect.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file QuestEffect.h
    31     @brief
    32     Definition of the QuestEffect class.
     30    @file
     31    @brief Definition of the QuestEffect class.
    3332*/
    3433
     
    4241#include "core/BaseObject.h"
    4342
    44 namespace orxonox {
    45 
     43namespace orxonox
     44{
    4645    /**
    4746    @brief
  • code/branches/bugger/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r2530 r2533  
    2828
    2929/**
    30     @file QuestEffectBeacon.cc
    31     @brief
    32     Implementation of the QuestEffectBeacon class.
     30    @file
     31    @brief Implementation of the QuestEffectBeacon class.
    3332*/
    3433
     
    4645#include "QuestEffect.h"
    4746
    48 namespace orxonox {
    49 
     47namespace orxonox
     48{
    5049    CreateFactory(QuestEffectBeacon);
    5150
     
    5958       
    6059        this->status_ = QuestEffectBeaconStatus::active;
    61         this->times_ = INFINITE;
     60        this->times_ = INFINITE_TIME;
    6261    }
    6362
     
    9190        SUPER(QuestEffectBeacon, processEvent, event);
    9291   
    93     SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
     92        SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
    9493    }
    9594   
     
    145144            this->decrementTimes(); //!< Decrement the number of times the beacon can be used.
    146145            return true;
    147     }
    148 
    149     return false;
     146        }
     147
     148        return false;
    150149    }
    151150   
     
    187186            return false;
    188187        }
    189         if(this->getTimes() == INFINITE) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
     188        if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
    190189        {
    191190            return true;
     
    193192       
    194193        this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed.
    195     if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
    196     {
     194        if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
     195        {
    197196            this->status_ = QuestEffectBeaconStatus::inactive;
    198     }
     197        }
    199198       
    200199        return true;
     
    213212    bool QuestEffectBeacon::setTimes(const int & n)
    214213    {
    215         if(n < 0 && n != INFINITE)
     214        if(n < 0 && n != INFINITE_TIME)
    216215        {
    217216            return false;
  • code/branches/bugger/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2530 r2533  
    2828
    2929/**
    30     @file QuestEffectBeacon.h
    31     @brief
    32     Definition of the QuestEffectBeacon class.
     30    @file
     31    @brief Definition of the QuestEffectBeacon class.
    3332*/
    3433
     
    4039#include "orxonox/objects/worldentities/PositionableEntity.h"
    4140
    42 namespace QuestEffectBeaconStatus
     41namespace orxonox
    4342{
     43    namespace QuestEffectBeaconStatus
     44    {
    4445
    45     //! The status of the beacon, can be either active or inactive.
    46     enum Enum
    47     {
    48         inactive,
    49         active
    50     };
     46        //! The status of the beacon, can be either active or inactive.
     47        enum Enum
     48        {
     49            inactive,
     50            active
     51        };
    5152
    52 }
    53 
    54 namespace orxonox {
     53    }
    5554
    5655    /**
     
    6160        A QuestEffectBeacon can be inactive or active.
    6261       
    63     Creating a QuestEffectBeacon through XML goes as follows:
    64    
    65     <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
     62        Creating a QuestEffectBeacon through XML goes as follows:
     63       
     64        <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
    6665            <effects>
    6766                <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation.
     
    7069            </effects>
    7170            <events>
    72         <execute>
    73             <EventListener event=eventIdString />
    74         </execute>
    75         </events>
    76         <attached>
    77            <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
    78         </attached>
    79     </QuestEffectBeacon>
     71                <execute>
     72                    <EventListener event=eventIdString />
     73                </execute>
     74            </events>
     75            <attached>
     76                <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
     77            </attached>
     78        </QuestEffectBeacon>
    8079    @author
    8180        Damian 'Mozork' Frick
     
    8382    class _OrxonoxExport QuestEffectBeacon : public PositionableEntity
    8483    {
    85     public:
    86         QuestEffectBeacon(BaseObject* creator);
    87         virtual ~QuestEffectBeacon();
    88        
    89         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
    90        
    91         virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
    92        
    93         bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
    94        
    95         /**
    96         @brief Tests whether the QuestEffectBeacon is active.
    97         @return Returns true if the QuestEffectBeacon is active, fals if not.
    98         */
    99         inline bool isActive(void)
    100            { return this->status_ == QuestEffectBeaconStatus::active; }
    101        
    102         bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
    103        
    104     protected:
     84        public:
     85            QuestEffectBeacon(BaseObject* creator);
     86            virtual ~QuestEffectBeacon();
     87           
     88            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
     89           
     90            virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
     91           
     92            bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
     93           
     94            /**
     95            @brief Tests whether the QuestEffectBeacon is active.
     96            @return Returns true if the QuestEffectBeacon is active, fals if not.
     97            */
     98            inline bool isActive(void)
     99            { return this->status_ == QuestEffectBeaconStatus::active; }
     100           
     101            bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
     102           
     103        protected:
    105104            bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed.
    106105           
     
    111110            inline const int & getTimes(void) const
    112111                { return this->times_; }
    113 
     112   
    114113        private:
    115             //static const int INFINITE = -1; //!< Constant to avoid using magic numbers.
    116        
     114            static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers.
     115           
    117116            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    118117            int times_; //!< Number of times the beacon can be exectued.
  • code/branches/bugger/src/orxonox/objects/quest/QuestHint.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file QuestHint.cc
    31     @brief
    32     Implementation of the QuestHint class.
     30    @file
     31    @brief Implementation of the QuestHint class.
    3332*/
    3433
     
    4140#include "orxonox/objects/infos/PlayerInfo.h"
    4241#include "QuestManager.h"
     42#include "QuestDescription.h"
    4343#include "Quest.h"
    4444
    45 namespace orxonox {
    46 
     45namespace orxonox
     46{
    4747    CreateFactory(QuestHint);
    4848
     
    122122            {
    123123                this->playerStatus_[player] = questHintStatus::active;
     124               
     125                this->getDescription()->sendAddHintNotification();
    124126                return true;
    125127            }
  • code/branches/bugger/src/orxonox/objects/quest/QuestHint.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file QuestHint.h
    31     @brief
    32     Definition of the QuestHint class.
     30    @file
     31    @brief Definition of the QuestHint class.
    3332*/
    3433
     
    4443#include "QuestItem.h"
    4544
    46 namespace questHintStatus
    47 {
    48 
    49     //! The status of the hint.
    50     enum Enum
    51     {
    52         inactive,
    53         active
    54     };
    55 
    56 }
    57 
    5845namespace orxonox
    5946{
     47    namespace questHintStatus
     48    {
     49
     50        //! The state of the hint.
     51        enum Enum
     52        {
     53            inactive,
     54            active
     55        };
     56
     57    }
    6058
    6159    /**
     
    9694        private:
    9795            Quest* quest_; //!< The Quest the QuestHint belongs to.
    98             std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     96            std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
    9997
    10098    };
  • code/branches/bugger/src/orxonox/objects/quest/QuestItem.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file QuestItem.cc
    31     @brief
    32     Implementation of the QuestItem class.
     30    @file
     31    @brief Implementation of the QuestItem class.
    3332*/
    3433
     
    4039#include "QuestDescription.h"
    4140
    42 namespace orxonox {
    43 
     41namespace orxonox
     42{
    4443    /**
    4544    @brief
     
    9998    @return
    10099        Returns true if the string is likely to be of the required form.
    101     @todo
    102         Clarify form, more vigorous checks.
    103100    */
    104     bool QuestItem::isId(const std::string & id)
     101    /*static*/ bool QuestItem::isId(const std::string & id)
    105102    {
    106103        return id.size() >= 32;
  • code/branches/bugger/src/orxonox/objects/quest/QuestItem.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828 
    2929/**
    30     @file QuestItem.h
    31     @brief
    32     Definition of the QuestItem class.
    33    
    34     The QuestItem is the parent class of Quest and QuestHint.
     30    @file
     31    @brief Definition of the QuestItem class.
     32        The QuestItem is the parent class of Quest and QuestHint.
    3533*/
    3634
     
    4644#include "core/XMLPort.h"
    4745
    48 namespace orxonox {
    49 
    50 
     46namespace orxonox
     47{
    5148    /**
    5249    @brief
     
    6764            /**
    6865            @brief Returns the id of this QuestItem.
    69         @return Returns the id of the QuestItem.
     66            @return Returns the id of the QuestItem.
    7067            */
    7168            inline const std::string & getId(void) const
    7269                { return this->id_; }
    73         /**
    74         @brief Returns the QuestDescription of the QuestItem.
    75         @return Returns a pointer to the QuestDescription object of the QuestItem.
    76         */
     70           
     71            /**
     72            @brief Returns the QuestDescription of the QuestItem.
     73            @return Returns a pointer to the QuestDescription object of the QuestItem.
     74            */
    7775            inline const QuestDescription* getDescription(void) const
    7876                { return this->description_; }
  • code/branches/bugger/src/orxonox/objects/quest/QuestManager.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file QuestManager.cc
    31     @brief
    32     Implementation of the QuestManager class.
     30    @file
     31    @brief Implementation of the QuestManager class.
    3332*/
    3433
     
    4241#include "QuestHint.h"
    4342
    44 namespace orxonox {
    45 
     43namespace orxonox
     44{
    4645    //! All Quests registered by their id's.
    4746    std::map<std::string, Quest*> QuestManager::questMap_s;
     
    7675        Returns true if successful, false if not.
    7776    */
    78     bool QuestManager::registerQuest(Quest* quest)
     77    /*static*/ bool QuestManager::registerQuest(Quest* quest)
    7978    {
    8079        if(quest == NULL) //!< Doh! Just as if there were actual quests behind NULL-pointers.
     
    108107        Returns true if successful, false if not.
    109108    */
    110     bool QuestManager::registerHint(QuestHint* hint)
     109    /*static*/ bool QuestManager::registerHint(QuestHint* hint)
    111110    {
    112111        if(hint == NULL) //!< Still not liking NULL-pointers.
     
    142141        Throws an exception if the given questId is invalid.
    143142    */
    144     Quest* QuestManager::findQuest(const std::string & questId)
     143    /*static*/ Quest* QuestManager::findQuest(const std::string & questId)
    145144    {
    146145        if(!QuestItem::isId(questId)) //!< Check vor validity of the given id.
     
    176175        Throws an exception if the given hintId is invalid.
    177176    */
    178     QuestHint* QuestManager::findHint(const std::string & hintId)
     177    /*static*/ QuestHint* QuestManager::findHint(const std::string & hintId)
    179178    {
    180179        if(!QuestItem::isId(hintId)) //!< Check vor validity of the given id.
  • code/branches/bugger/src/orxonox/objects/quest/QuestManager.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file QuestManager.h
    31     @brief
    32     Definition of the QuestManager class.
     30    @file
     31    @brief Definition of the QuestManager class.
    3332*/
    3433
     
    4342#include "core/BaseObject.h"
    4443
    45 namespace orxonox {
    46 
     44namespace orxonox
     45{
    4746    /**
    4847    @brief
  • code/branches/bugger/src/orxonox/objects/quest/Rewardable.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file Rewardable.cc
    31     @brief
    32     Implementation of the Rewardable class.
     30    @file
     31    @brief Implementation of the Rewardable class.
    3332*/
    3433
     
    3837#include "core/CoreIncludes.h"
    3938
    40 namespace orxonox {
    41 
     39namespace orxonox
     40{
    4241    /**
    4342    @brief
  • code/branches/bugger/src/orxonox/objects/quest/Rewardable.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
    r2531 r2533  
    2828
    2929/**
    30     @file Rewardable.h
    31     @brief
    32     Definition of the Rewardable class.
     30    @file
     31    @brief Definition of the Rewardable class.
    3332*/
    3433
     
    4039#include "core/BaseObject.h"
    4140
    42 namespace orxonox {
    43 
     41namespace orxonox
     42{
    4443    /**
    4544    @brief
     
    5251    class _OrxonoxExport Rewardable : public BaseObject
    5352    {
    54 
    5553        public:
    5654            Rewardable(BaseObject* creator);
     
    6159                Method to transcribe a rewardable object to the player.
    6260                Must be implemented by every class inheriting from Rewardable.
    63         @param player
     61            @param player
    6462                A pointer to the ControllableEntity, do whatever you want with it.
    65         @return
     63            @return
    6664                Return true if successful.
    6765            */
    68             virtual bool reward(PlayerInfo* player) = 0; //!<
     66            virtual bool reward(PlayerInfo* player) = 0;
    6967
    7068    };
  • code/branches/bugger/src/orxonox/objects/weaponSystem/WeaponSystem.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/weaponSystem/WeaponSystem.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/Backlight.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/Backlight.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/CMakeLists.txt

    r2414 r2533  
    1616  ParticleEmitter.cc
    1717  ParticleSpawner.cc
     18  Planet.cc
    1819  SpawnPoint.cc
    1920)
  • code/branches/bugger/src/orxonox/objects/worldentities/Camera.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/Camera.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2531 r2533  
    8080        this->server_orientation_ = Quaternion::IDENTITY;
    8181        this->client_orientation_ = Quaternion::IDENTITY;
     82       
     83        this->setPriority( priority::very_high );
    8284
    8385        this->setConfigValues();
  • code/branches/bugger/src/orxonox/objects/worldentities/Model.cc

    r2531 r2533  
    4040    Model::Model(BaseObject* creator) : PositionableEntity(creator)
    4141    {
    42         static unsigned int i=10;
    4342        RegisterObject(Model);
    4443
     
    4645
    4746        this->registerVariables();
    48         this->setObjectPriority(i++);
    4947    }
    5048
  • code/branches/bugger/src/orxonox/objects/worldentities/MovableEntity.cc

    r2531 r2533  
    5252        this->overwrite_position_ = Vector3::ZERO;
    5353        this->overwrite_orientation_ = Quaternion::IDENTITY;
     54       
     55        this->setPriority( priority::low );
    5456
    5557        this->registerVariables();
  • code/branches/bugger/src/orxonox/objects/worldentities/ParticleSpawner.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/ParticleSpawner.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/PositionableEntity.cc

    r2531 r2533  
    3838    {
    3939        RegisterObject(PositionableEntity);
     40       
     41        this->setPriority( priority::very_low );
    4042
    4143        this->registerVariables();
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc

    r2530 r2533  
    2828
    2929/**
    30     @file PlayerTrigger.cc
     30    @file
    3131    @brief
    32         Implementation of the PlayerTrigger class.
     32    Implementation of the PlayerTrigger class.
    3333*/
    3434
     
    3838#include "core/CoreIncludes.h"
    3939
    40 namespace orxonox {
    41 
     40namespace orxonox
     41{
    4242    /**
    4343    @brief
     
    4747    {
    4848        RegisterObject(PlayerTrigger);
    49        
     49
    5050        this->player_ = NULL;
    5151        this->isForPlayer_ = true;
    5252    }
    53    
     53
    5454    /**
    5555    @brief
     
    6666    void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6767    {
    68         SUPER(PlayerTrigger, XMLPort, xmlelement, mode);
     68        SUPER(PlayerTrigger, XMLPort, xmlelement, mode);
    6969    }
    70 
    7170}
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h

    r2530 r2533  
    2828
    2929/**
    30     @file PlayerTrigger.h
     30    @file
    3131    @brief
    32         Definition of the PlayerTrigger class.
     32    Definition of the PlayerTrigger class.
    3333*/
    3434
     
    4040#include "Trigger.h"
    4141
    42 namespace orxonox {
    43    
     42namespace orxonox
     43{
    4444    /**
    4545    @brief
     
    5050    class _OrxonoxExport PlayerTrigger : public Trigger
    5151    {
    52         public:
    53             PlayerTrigger(BaseObject* creator);
    54             virtual ~PlayerTrigger();
    55            
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
     52    public:
     53        PlayerTrigger(BaseObject* creator);
     54        virtual ~PlayerTrigger();
     55       
     56        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
     57       
     58        /**
     59        @brief Returns the player that triggered the PlayerTrigger.
     60        @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
     61        */
     62        inline ControllableEntity* getTriggeringPlayer(void) const
     63            { return this->player_; }
     64       
     65        /**
     66        @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
     67        @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
     68        */
     69        inline bool isForPlayer(void) const
     70           { return this->isForPlayer_; }
    5771           
    58             /**
    59             @brief Returns the player that triggered the PlayerTrigger.
    60             @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
    61             */
    62             inline ControllableEntity* getTriggeringPlayer(void) const
    63                 { return this->player_; }
    64            
    65             /**
    66             @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
    67             @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
    68             */
    69             inline bool isForPlayer(void) const
    70                { return this->isForPlayer_; }
    71            
    72         protected:
    73             virtual bool isTriggered(TriggerMode mode) = 0;
    74            
    75             /**
    76             @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
    77             @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
    78             */
    79             inline void setTriggeringPlayer(ControllableEntity* player)
    80                { this->player_ = player; }
     72    protected:
     73        virtual bool isTriggered(TriggerMode mode) = 0;
     74       
     75        /**
     76        @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
     77        @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
     78        */
     79        inline void setTriggeringPlayer(ControllableEntity* player)
     80           { this->player_ = player; }
    8181
    8282            /**
     
    8484            @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not.
    8585            */
    86             inline void setForPlayer(bool isForPlayer)
    87                { this->isForPlayer_ = isForPlayer; }
    88            
    89         private:
    90             ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
    91             bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
    92        
     86        inline void setForPlayer(bool isForPlayer)
     87           { this->isForPlayer_ = isForPlayer; }
     88       
     89    private:
     90        ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
     91        bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
     92   
    9393    };
    9494
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/Trigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/branches/bugger/src/orxonox/objects/worldentities/triggers/Trigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.