Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 14, 2009, 3:07:59 AM (15 years ago)
Author:
landauf
Message:

sorry, large commit, but all changes are dependent:

  • Created a new plugin for the questsystem (called just "quest" for the moment because I'd had to rename the directory otherwise (the tolua script enforces this))
  • Added QuestPrereqs.h file and _QuestExport macro
  • Moved the GUI-name ↔ PlayerInfo map from QuestManager to GUIManager
  • Moved NotificationOverlay and NotificationQueue from overlays to quest and linked the overlays plugin into the quest plugin
  • Made QuestManager and NotificationManager ScopedSingletons with ScopeID GSLevel. Also removed both singletons from GSLevel and added the Scope instance instead.
Location:
code/branches/libraries/src
Files:
1 added
1 deleted
30 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/branches/libraries/src/core/GUIManager.h

    r3370 r5648  
    5050namespace orxonox
    5151{
     52    class PlayerInfo; // Forward declaration
     53
    5254    /**
    5355    @class GUIManager
     
    7779        static GUIManager* getInstancePtr() { return singletonPtr_s; }
    7880
     81        inline void setPlayer(const std::string& guiname, PlayerInfo* player)
     82            { this->players_[guiname] = player; }
     83        inline PlayerInfo* getPlayer(const std::string& guiname) const
     84            { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }
     85
    7986    private:
    8087        GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
     
    9299        void mouseScrolled (int abs, int rel);
    93100
    94         boost::scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;  //!< CEGUI's interface to the Ogre Engine
    95         boost::scoped_ptr<CEGUI::LuaScriptModule>   scriptModule_; //!< CEGUI's script module to use Lua
    96         boost::scoped_ptr<CEGUI::System>            guiSystem_;    //!< CEGUI's main system
    97         Ogre::RenderWindow*      renderWindow_;     //!< Ogre's render window to give CEGUI access to it
    98         CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider
    99         CEGUI::Logger*           ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    100         lua_State*               luaState_;         //!< Lua state, access point to the Lua engine
     101        boost::scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;       //!< CEGUI's interface to the Ogre Engine
     102        boost::scoped_ptr<CEGUI::LuaScriptModule>   scriptModule_;      //!< CEGUI's script module to use Lua
     103        boost::scoped_ptr<CEGUI::System>            guiSystem_;         //!< CEGUI's main system
     104        Ogre::RenderWindow*                         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
     105        CEGUI::ResourceProvider*                    resourceProvider_;  //!< CEGUI's resource provider
     106        CEGUI::Logger*                              ceguiLogger_;       //!< CEGUI's logger to be able to log CEGUI errors in our log
     107        lua_State*                                  luaState_;          //!< Lua state, access point to the Lua engine
     108        std::map<std::string, PlayerInfo*>          players_;           //!< Stores the player (owner) for each gui
    101109
    102         static GUIManager*       singletonPtr_s;    //!< Singleton reference to GUIManager
     110        static GUIManager*                          singletonPtr_s;     //!< Singleton reference to GUIManager
    103111
    104112    };
  • code/branches/libraries/src/orxonox/CMakeLists.txt

    r5633 r5648  
    4747    objects/pickup/BaseItem.h
    4848    objects/pickup/PickupInventory.h
    49     objects/quest/QuestDescription.h
    50     objects/quest/QuestManager.h
    5149  DEFINE_SYMBOL
    5250    "ORXONOX_SHARED_BUILD"
  • code/branches/libraries/src/orxonox/OrxonoxPrereqs.h

    r5634 r5648  
    8080    class Tickable;
    8181
    82     class AddQuest;
    83     class AddQuestHint;
    84     class AddReward;
    85     class ChangeQuestStatus;
    86     class CompleteQuest;
    87     class FailQuest;
    88     class GlobalQuest;
    89     class LocalQuest;
    90     class Quest;
    91     class QuestDescription;
    92     class QuestEffect;
    93     class QuestEffectBeacon;
    94     class QuestHint;
    95     class QuestItem;
    96     class QuestListener;
    97     class QuestManager;
    98     class QuestNotification;
    99     class Rewardable;
    100 
    10182    class WorldEntity;
    10283    class StaticEntity;
  • code/branches/libraries/src/orxonox/gamestates/GSLevel.cc

    r5633 r5648  
    4747#include "tools/interfaces/Tickable.h"
    4848#include "objects/Radar.h"
    49 #include "objects/quest/QuestManager.h"
    50 #include "objects/quest/notifications/NotificationManager.h"
    5149#include "CameraManager.h"
    5250#include "LevelManager.h"
     
    110108        this->playerManager_ = new PlayerManager();
    111109
    112         this->questManager_ = new QuestManager();
    113 
    114         this->notificationManager_ = new NotificationManager();
     110        this->scope_GSLevel_ = new Scope<ScopeID::GSLevel>();
    115111
    116112        if (GameMode::isMaster())
     
    201197        }
    202198
    203         if (this->questManager_)
    204         {
    205             delete this->questManager_;
    206             this->questManager_ = NULL;
    207         }
    208 
    209         if (this->notificationManager_)
    210         {
    211             delete this->notificationManager_;
    212             this->notificationManager_ = NULL;
     199        if (this->scope_GSLevel_)
     200        {
     201            delete this->scope_GSLevel_;
     202            this->scope_GSLevel_ = NULL;
    213203        }
    214204
  • code/branches/libraries/src/orxonox/gamestates/GSLevel.h

    r5643 r5648  
    3333
    3434#include <string>
     35#include "util/Scope.h"
    3536#include "core/OrxonoxClass.h"
    3637#include "core/GameState.h"
     
    6263        void keybindInternal(const std::string& command, bool bTemporary);
    6364
    64         KeyBinder*            keyBinder_;               //!< tool that loads and manages the input bindings
    65         InputState*           gameInputState_;          //!< input state for normal ingame playing
    66         InputState*           guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
    67         InputState*           guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
    68         Radar*                radar_;                   //!< represents the Radar (not the HUD part)
    69         CameraManager*        cameraManager_;           //!< camera manager for this level
    70         PlayerManager*        playerManager_;           //!< player manager for this level
    71         QuestManager*         questManager_;
    72         NotificationManager*  notificationManager_;
     65        KeyBinder*               keyBinder_;               //!< tool that loads and manages the input bindings
     66        InputState*              gameInputState_;          //!< input state for normal ingame playing
     67        InputState*              guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
     68        InputState*              guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
     69        Radar*                   radar_;                   //!< represents the Radar (not the HUD part)
     70        CameraManager*           cameraManager_;           //!< camera manager for this level
     71        PlayerManager*           playerManager_;           //!< player manager for this level
     72        Scope<ScopeID::GSLevel>* scope_GSLevel_;
    7373
    7474        //##### ConfigValues #####
  • code/branches/libraries/src/orxonox/objects/quest/AddQuest.h

    r3196 r5648  
    3535#define _AddQuest_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838#include "ChangeQuestStatus.h"
    3939
     
    4343    @brief
    4444        Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.
    45        
     45
    4646        Creating a AddQuest through XML goes as follows:
    47        
     47
    4848        <AddQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be added.
    4949    @author
    5050        Damian 'Mozork' Frick
    5151    */
    52     class _OrxonoxExport AddQuest : public ChangeQuestStatus
     52    class _QuestExport AddQuest : public ChangeQuestStatus
    5353    {
    5454        public:
    5555        AddQuest(BaseObject* creator);
    5656        virtual ~AddQuest();
    57    
     57
    5858        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
    59    
     59
    6060        virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
    6161
  • code/branches/libraries/src/orxonox/objects/quest/AddQuestHint.h

    r3196 r5648  
    3535#define _AddQuestHint_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <string>
     
    4545    @brief
    4646        Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on.
    47        
     47
    4848    Creating a AddQuestHint through XML goes as follows:
    49        
     49
    5050        <AddQuestHint hintId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the QuestHint that should be added.
    5151    @author
    5252        Damian 'Mozork' Frick
    5353    */
    54     class _OrxonoxExport AddQuestHint : public QuestEffect
     54    class _QuestExport AddQuestHint : public QuestEffect
    5555    {
    5656        public:
     
    7171            inline const std::string & getHintId(void) const
    7272                { return this->hintId_; }
    73            
     73
    7474            bool setHintId(const std::string & id); //!< Sets the id of the QuestHint.
    7575
  • code/branches/libraries/src/orxonox/objects/quest/AddReward.h

    r3196 r5648  
    3535#define _AddReward_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    4545    @brief
    4646        Adds a list of Rewardables to a player.
    47        
     47
    4848        Creating a AddReward through XML goes as follows:
    49        
     49
    5050        <AddReward>
    5151            <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations.
     
    5656        Damian 'Mozork' Frick
    5757    */
    58     class _OrxonoxExport AddReward : public QuestEffect
     58    class _QuestExport AddReward : public QuestEffect
    5959    {
    6060        public:
     
    7575            inline void addRewardable(Rewardable* reward)
    7676                { this->rewards_.push_back(reward); }
    77        
     77
    7878            const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index.
    7979
  • code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt

    r5619 r5648  
    1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     1SET_SOURCE_FILES(QUEST_SRC_FILES
    22  AddQuest.cc
    33  AddQuestHint.cc
     
    2020
    2121ADD_SUBDIRECTORY(notifications)
     22
     23# add the parent directory for tolua (TODO: remove this if the quest plugin is moved somewhere else)
     24INCLUDE_DIRECTORIES(..)
     25
     26ORXONOX_ADD_LIBRARY(quest
     27  PLUGIN
     28  TOLUA_FILES
     29    QuestDescription.h
     30    QuestManager.h
     31  DEFINE_SYMBOL
     32    "QUEST_SHARED_BUILD"
     33  LINK_LIBRARIES
     34    orxonox
     35    overlays
     36  SOURCE_FILES ${QUEST_SRC_FILES}
     37)
  • code/branches/libraries/src/orxonox/objects/quest/ChangeQuestStatus.h

    r3196 r5648  
    3535#define _ChangeQuestStatus_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <string>
     
    4848        Damian 'Mozork' Frick
    4949    */
    50     class _OrxonoxExport ChangeQuestStatus : public QuestEffect
     50    class _QuestExport ChangeQuestStatus : public QuestEffect
    5151    {
    5252        public:
     
    6868        private:
    6969            std::string questId_; //!< The id of the Quest the status should be changed of.
    70            
     70
    7171            bool setQuestId(const std::string & id); //!< Sets the id of the Quest.
    7272
  • code/branches/libraries/src/orxonox/objects/quest/CompleteQuest.h

    r3196 r5648  
    3535#define _CompleteQuest_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838#include "ChangeQuestStatus.h"
    3939
     
    4343    @brief
    4444        Completes a Quest (with a specified id) for the player invoking the QuestEffect.
    45        
     45
    4646        Creating a CompleteQuest through XML goes as follows:
    47        
     47
    4848        <CompleteQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be completed.
    4949    @author
    5050        Damian 'Mozork' Frick
    5151    */
    52     class _OrxonoxExport CompleteQuest : public ChangeQuestStatus
     52    class _QuestExport CompleteQuest : public ChangeQuestStatus
    5353    {
    5454        public:
  • code/branches/libraries/src/orxonox/objects/quest/FailQuest.h

    r3196 r5648  
    3535#define _FailQuest_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838#include "ChangeQuestStatus.h"
    3939
     
    4343    @brief
    4444        Fails a quest (with a specified id) for the player invoking the QuestEffect.
    45        
     45
    4646        Creating a FailQuest through XML goes as follows:
    47        
     47
    4848        <FailQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be failed.
    4949    @author
    5050        Damian 'Mozork' Frick
    5151    */
    52     class _OrxonoxExport FailQuest : public ChangeQuestStatus
     52    class _QuestExport FailQuest : public ChangeQuestStatus
    5353    {
    5454        public:
  • code/branches/libraries/src/orxonox/objects/quest/GlobalQuest.h

    r3280 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3535#define _GlobalQuest_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    4747        GlobalQuests are Quests, that have the same status for all players.
    4848        This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
    49        
     49
    5050        Creating a GlobalQuest through XML goes as follows:
    51        
     51
    5252        <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
    5353            <QuestDescription title="Title" description="Description." /> //The description of the quest.
     
    8181        Damian 'Mozork' Frick
    8282    */
    83     class _OrxonoxExport GlobalQuest : public Quest
     83    class _QuestExport GlobalQuest : public Quest
    8484    {
    8585        public:
     
    8888
    8989            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
    90            
     90
    9191            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
    9292            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
     
    9898
    9999            virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
    100            
     100
    101101            virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
    102102
     
    105105            QuestStatus::Value status_; //!< The status of this Quest.
    106106            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
    107            
     107
    108108            bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects.
    109109            const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward QuestEffect at the given index.
  • code/branches/libraries/src/orxonox/objects/quest/LocalQuest.h

    r3280 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3535#define _LocalQuest_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <map>
     
    4646        Handles Quests which have different states for different players.
    4747        LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest.
    48        
     48
    4949        Creating a LocalQuest through XML goes as follows:
    50        
     50
    5151        <LocalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
    5252            <QuestDescription title="Title" description="Description." /> //The description of the quest.
     
    7575        Damian 'Mozork' Frick
    7676    */
    77     class _OrxonoxExport LocalQuest : public Quest
     77    class _QuestExport LocalQuest : public Quest
    7878    {
    7979        public:
     
    8282
    8383            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
    84            
     84
    8585            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
    8686            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
  • code/branches/libraries/src/orxonox/objects/quest/Quest.h

    r3280 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3232        The Quest is the parent class of LocalQuest and GlobalQuest.
    3333*/
    34  
     34
    3535#ifndef _Quest_H__
    3636#define _Quest_H__
    3737
    38 #include "OrxonoxPrereqs.h"
     38#include "objects/quest/QuestPrereqs.h"
    3939
    4040#include <list>
     
    6262        A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest.
    6363        A Quest has a list of QuestEffects that are invoked when the quest is failed and also a list of QuestEffects that are invoked, when the Quest is completed.
    64        
     64
    6565        Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
    6666    @author
    6767        Damian 'Mozork' Frick
    6868    */
    69     class _OrxonoxExport Quest : public QuestItem
     69    class _QuestExport Quest : public QuestItem
    7070    {
    7171        public:
     
    8181            inline Quest* getParentQuest(void) const
    8282                { return this->parentQuest_; }
    83                
     83
    8484            /**
    8585            @brief Returns the list of subquests.
     
    9595            inline const std::list<QuestHint*> & getHintsList(void) const
    9696                { return this->hints_; }
    97        
     97
    9898            bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
    9999            bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
    100100            bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
    101101            bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    102        
     102
    103103            bool start(PlayerInfo* player); //!< Sets a Quest to active.
    104104            virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
    105105            virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
    106        
     106
    107107            bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest.
    108108
     
    116116            const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index.
    117117            const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index.
    118            
     118
    119119            /**
    120120            @brief Returns the list of fail QuestEffects.
     
    123123            inline std::list<QuestEffect*> & getFailEffectList(void)
    124124                { return this->failEffects_; }
    125                
     125
    126126            /**
    127127            @brief Returns the list of complete QuestEffects.
     
    133133            virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
    134134            virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
    135            
     135
    136136        private:
    137137            Quest* parentQuest_; //!< Pointer to the parentquest.
     
    142142            std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed.
    143143            std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed.
    144            
     144
    145145            std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest.
    146            
     146
    147147            bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest.
    148148            bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest.
  • code/branches/libraries/src/orxonox/objects/quest/QuestDescription.h

    r3370 r5648  
    3535#define _QuestDescription_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <string>
     
    4747        This class is a description of a QuestItem.
    4848        It holds a title and a description.
    49        
     49
    5050        Creating a QuestDescription through XML goes as follows:
    51        
     51
    5252        <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
    5353    @author
    5454        Damian 'Mozork' Frick
    5555    */
    56     class _OrxonoxExport QuestDescription : public BaseObject
     56    class _QuestExport QuestDescription : public BaseObject
    5757    {
    5858// tolua_end
     
    7070            inline const std::string & getTitle(void) const
    7171                { return this->title_; }
    72        
     72
    7373            /**
    7474            @brief Returns the description text.
     
    7878                { return this->description_; }
    7979// tolua_end
    80        
     80
    8181            /**
    8282            @brief Returns the fail message.
     
    8585            inline const std::string & getFailMessage(void) const
    8686                { return this->failMessage_; }
    87        
     87
    8888            /**
    8989            @brief Returns the complete message.
     
    9292            inline const std::string & getCompleteMessage(void) const
    9393                { return this->completeMessage_; }
    94        
     94
    9595            /**
    9696            @brief Sends a Notification displaying that a QuestHint was added.
     
    9999            inline bool sendAddHintNotification(void) const
    100100                { return notificationHelper("hint", ""); }
    101        
     101
    102102            /**
    103103            @brief Sends a Notification displaying that a Quest was added.
     
    106106            inline bool sendAddQuestNotification(void) const
    107107                { return notificationHelper("quest", "start"); }
    108        
     108
    109109            /**
    110110            @brief Sends a Notification displaying that a Quest was failed.
     
    113113            inline bool sendFailQuestNotification(void) const
    114114                { return notificationHelper("quest", "fail"); }
    115        
     115
    116116            /**
    117117            @brief Sends a Notification displaying that a Quest was completed.
     
    135135            inline void setTitle(const std::string & title)
    136136                { this->title_ = title; }
    137                
     137
    138138            /**
    139139            @brief Sets the description text.
     
    149149            inline void setFailMessage(const std::string & message)
    150150                { this->failMessage_ = message; }
    151                
     151
    152152            /**
    153153            @brief Sets the complete message.
  • code/branches/libraries/src/orxonox/objects/quest/QuestEffect.h

    r3196 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3535#define _QuestEffect_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    4949        Damian 'Mozork' Frick
    5050    */
    51     class _OrxonoxExport QuestEffect : public BaseObject
     51    class _QuestExport QuestEffect : public BaseObject
    5252    {
    5353        public:
  • code/branches/libraries/src/orxonox/objects/quest/QuestEffectBeacon.h

    r3280 r5648  
    3535#define _QuestEffectBeacon_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    5858        A QuestEffectBeacon can be executed a defined number of times.
    5959        A QuestEffectBeacon can be inactive or active.
    60        
     60
    6161        Creating a QuestEffectBeacon through XML goes as follows:
    62        
     62
    6363        <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.
    6464            <effects>
     
    7979        Damian 'Mozork' Frick
    8080    */
    81     class _OrxonoxExport QuestEffectBeacon : public StaticEntity
     81    class _QuestExport QuestEffectBeacon : public StaticEntity
    8282    {
    8383        public:
    8484            QuestEffectBeacon(BaseObject* creator);
    8585            virtual ~QuestEffectBeacon();
    86            
     86
    8787            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
    88            
     88
    8989            virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
    90            
     90
    9191            bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
    92            
     92
    9393            /**
    9494            @brief Tests whether the QuestEffectBeacon is active.
     
    9797            inline bool isActive(void)
    9898            { return this->status_ == QuestEffectBeaconStatus::Active; }
    99            
     99
    100100            bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
    101            
     101
    102102        protected:
    103103            bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed.
    104            
     104
    105105            /**
    106106            @brief Returns the number of times the QUestEffectBeacon can still be executed.
     
    109109            inline const int & getTimes(void) const
    110110                { return this->times_; }
    111    
     111
    112112        private:
    113113            static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers.
    114            
     114
    115115            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    116116            int times_; //!< Number of times the beacon can be exectued.
    117117            QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
    118            
     118
    119119            bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
    120120            bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon.
    121            
     121
    122122            const QuestEffect* getEffect(unsigned int index) const; //!< Get the QuestEffect at a given index.
    123    
     123
    124124    };
    125125
  • code/branches/libraries/src/orxonox/objects/quest/QuestHint.h

    r3280 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3535#define _QuestHint_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <map>
     
    5757        Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
    5858        A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
    59        
     59
    6060        Creating a QuestHint through XML goes as follows:
    61        
     61
    6262        <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
    6363            <QuestDesctription title="" description="" />
     
    6666        Damian 'Mozork' Frick
    6767    */
    68     class _OrxonoxExport QuestHint : public QuestItem
     68    class _QuestExport QuestHint : public QuestItem
    6969    {
    7070
  • code/branches/libraries/src/orxonox/objects/quest/QuestItem.h

    r3196 r5648  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    3737#define _QuestItem_H__
    3838
    39 #include "OrxonoxPrereqs.h"
     39#include "objects/quest/QuestPrereqs.h"
    4040
    4141#include <string>
     
    5151        Damian 'Mozork' Frick
    5252    */
    53     class _OrxonoxExport QuestItem : public BaseObject
     53    class _QuestExport QuestItem : public BaseObject
    5454    {
    5555
     
    6666            inline const std::string & getId(void) const
    6767                { return this->id_; }
    68            
     68
    6969            /**
    7070            @brief Returns the QuestDescription of the QuestItem.
     
    7878        protected:
    7979            void setId(const std::string & id); //!< Sets the id of the QuestItem.
    80            
     80
    8181            /**
    8282            @brief Sets the description of the QuestItem.
  • code/branches/libraries/src/orxonox/objects/quest/QuestListener.h

    r3280 r5648  
    3535#define _QuestListener_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <string>
     
    5858    @brief
    5959        Provides a way to react to the starting, completing and failing of Quests.
    60        
     60
    6161        The XML representation goes as follows:
    6262        You can use the QuestListener as if it were a Trigger or EventListener, that fires an Event when the status (depending on the set mode) of the given Quest changes.
    63        
     63
    6464        <BaseObject> // The object that should react to the status change of a Quest.
    6565            <events>
     
    7272    Damian 'Mozork' Frick
    7373    */
    74     class _OrxonoxExport QuestListener : public BaseObject
     74    class _QuestExport QuestListener : public BaseObject
    7575    {
    7676    public:
    7777        QuestListener(BaseObject* creator);
    7878        virtual ~QuestListener();
    79        
     79
    8080        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
    81        
     81
    8282        static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
    83        
     83
    8484        bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
    8585        bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
    86        
     86
    8787        std::string getMode(void); //!< Get the mode of the QuestListener.
    88        
    89         const std::string & getQuestId(void);       
     88
     89        const std::string & getQuestId(void);
    9090        bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
    91        
     91
    9292    private:
    9393        QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
    9494        Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
    95    
     95
    9696    };
    9797
  • code/branches/libraries/src/orxonox/objects/quest/QuestManager.cc

    r5617 r5648  
    3636#include "util/Exception.h"
    3737#include "core/CoreIncludes.h"
     38#include "core/GUIManager.h"
    3839
    3940#include "objects/infos/PlayerInfo.h"
     
    6465    QuestManager::~QuestManager()
    6566    {
    66 
    6767    }
    6868
     
    207207    QuestContainer* QuestManager::getQuestTree(std::string & name)
    208208    {
    209         PlayerInfo* player = this->players_[name];
     209        PlayerInfo* player = GUIManager::getInstance().getPlayer(name);
    210210        if(player == NULL)
    211211        {
  • code/branches/libraries/src/orxonox/objects/quest/QuestManager.h

    r5617 r5648  
    3535#define _QuestManager_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    4141#include <string>
    4242
    43 #include "util/Singleton.h"
     43#include "util/ScopedSingleton.h"
    4444#include "core/OrxonoxClass.h"
    4545
     
    6666    };
    6767
     68    typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua
     69
    6870    /**
    6971    @brief
     
    7375        Damian 'Mozork' Frick
    7476    */
    75     class _OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass
     77    class _QuestExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass
    7678    {
    7779// tolua_end
    78             friend class Singleton<QuestManager>;
     80            friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>;
    7981        public:
    8082            QuestManager();
     
    8284
    8385            //! Returns a reference to the single instance of the Quest Manager.
    84             static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
     86            static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export
    8587
    8688            bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
     
    9294            QuestContainer* getQuestTree(std::string & name); // tolua_export
    9395
    94             inline void setPlayer(const std::string& guiname, PlayerInfo* player)
    95                 { this->players_[guiname] = player; }
    96             inline PlayerInfo* getPlayer(const std::string& guiname) const
    97                 { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }
    98 
    9996        private:
    10097            static QuestManager* singletonPtr_s;
     
    10299            std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's.
    103100            std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's.
    104             std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each gui
    105101
    106102            void getRootQuests(const PlayerInfo* player, std::list<Quest*> & list);
  • code/branches/libraries/src/orxonox/objects/quest/QuestNotification.h

    r5619 r5648  
    3030#define _QuestNotification_H__
    3131
    32 #include "OrxonoxPrereqs.h"
     32#include "objects/quest/QuestPrereqs.h"
    3333
    3434#include <string>
     
    4343        Damian 'Mozork' Frick
    4444    */
    45     class _OrxonoxExport QuestNotification : public Notification
     45    class _QuestExport QuestNotification : public Notification
    4646    {
    4747        public:
  • code/branches/libraries/src/orxonox/objects/quest/notifications/CMakeLists.txt

    r5635 r5648  
    1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     1ADD_SOURCE_FILES(QUEST_SRC_FILES
    22  Notification.cc
    33  NotificationManager.cc
     4  NotificationOverlay.cc
     5  NotificationQueue.cc
    46)
  • code/branches/libraries/src/orxonox/objects/quest/notifications/Notification.h

    r5619 r5648  
    3535#define _Notification_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <string>
     
    4949        Damian 'Mozork' Frick
    5050    */
    51     class _OrxonoxExport Notification : public BaseObject
     51    class _QuestExport Notification : public BaseObject
    5252    {
    5353        public:
  • code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationManager.h

    r5619 r5648  
    3535#define _NotificationManager_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <ctime>
     
    4141#include <string>
    4242
    43 #include "util/Singleton.h"
     43#include "util/ScopedSingleton.h"
    4444#include "core/OrxonoxClass.h"
    4545
     
    5454        Damian 'Mozork' Frick
    5555    */
    56     class _OrxonoxExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass
     56    class _QuestExport NotificationManager : public ScopedSingleton<NotificationManager, ScopeID::GSLevel>, public OrxonoxClass
    5757    {
    58             friend class Singleton<NotificationManager>;
     58            friend class ScopedSingleton<NotificationManager, ScopeID::GSLevel>;
    5959        public:
    6060            NotificationManager();
  • code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationOverlay.h

    r5646 r5648  
    3636#define _NotificationOverlay_H__
    3737
    38 #include "overlays/OverlaysPrereqs.h"
     38#include "objects/quest/QuestPrereqs.h"
    3939
    4040#include <string>
     
    5050        Damian 'Mozork' Frick
    5151    */
    52     class _OverlaysExport NotificationOverlay : public OverlayText
     52    class _QuestExport NotificationOverlay : public OverlayText
    5353    {
    5454
  • code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationQueue.h

    r5646 r5648  
    3535#define _NotificationOueue_H__
    3636
    37 #include "overlays/OverlaysPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <ctime>
     
    8585    */
    8686
    87     class _OverlaysExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener
     87    class _QuestExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener
    8888    {
    8989
  • code/branches/libraries/src/orxonox/overlays/CMakeLists.txt

    r5627 r5648  
    1212ADD_SUBDIRECTORY(debug)
    1313ADD_SUBDIRECTORY(hud)
    14 ADD_SUBDIRECTORY(notifications)
    1514ADD_SUBDIRECTORY(stats)
    1615
  • code/branches/libraries/src/orxonox/overlays/GUIOverlay.cc

    r5617 r5648  
    3636#include "core/GUIManager.h"
    3737#include "core/XMLPort.h"
    38 #include "objects/quest/QuestManager.h"
    3938#include "objects/infos/PlayerInfo.h"
    4039
     
    8483    {
    8584        this->guiName_ = name;
    86         QuestManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner()));
     85        GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner()));
    8786    }
    8887}
  • code/branches/libraries/src/orxonox/overlays/OverlaysPrereqs.h

    r5630 r5648  
    7272    class HUDHealthBar;
    7373    class HUDTimer;
    74     class Notification;
    75     class NotificationListener;
    76     class NotificationManager;
    77     class NotificationOverlay;
    78     class NotificationQueue;
    7974    class OrxonoxOverlay;
    8075    class OverlayGroup;
Note: See TracChangeset for help on using the changeset viewer.