Changeset 5648
- Timestamp:
- Aug 14, 2009, 3:07:59 AM (15 years ago)
- 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 50 50 namespace orxonox 51 51 { 52 class PlayerInfo; // Forward declaration 53 52 54 /** 53 55 @class GUIManager … … 77 79 static GUIManager* getInstancePtr() { return singletonPtr_s; } 78 80 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 79 86 private: 80 87 GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class) … … 92 99 void mouseScrolled (int abs, int rel); 93 100 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 101 109 102 static GUIManager* singletonPtr_s;//!< Singleton reference to GUIManager110 static GUIManager* singletonPtr_s; //!< Singleton reference to GUIManager 103 111 104 112 }; -
code/branches/libraries/src/orxonox/CMakeLists.txt
r5633 r5648 47 47 objects/pickup/BaseItem.h 48 48 objects/pickup/PickupInventory.h 49 objects/quest/QuestDescription.h50 objects/quest/QuestManager.h51 49 DEFINE_SYMBOL 52 50 "ORXONOX_SHARED_BUILD" -
code/branches/libraries/src/orxonox/OrxonoxPrereqs.h
r5634 r5648 80 80 class Tickable; 81 81 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 101 82 class WorldEntity; 102 83 class StaticEntity; -
code/branches/libraries/src/orxonox/gamestates/GSLevel.cc
r5633 r5648 47 47 #include "tools/interfaces/Tickable.h" 48 48 #include "objects/Radar.h" 49 #include "objects/quest/QuestManager.h"50 #include "objects/quest/notifications/NotificationManager.h"51 49 #include "CameraManager.h" 52 50 #include "LevelManager.h" … … 110 108 this->playerManager_ = new PlayerManager(); 111 109 112 this->questManager_ = new QuestManager(); 113 114 this->notificationManager_ = new NotificationManager(); 110 this->scope_GSLevel_ = new Scope<ScopeID::GSLevel>(); 115 111 116 112 if (GameMode::isMaster()) … … 201 197 } 202 198 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; 213 203 } 214 204 -
code/branches/libraries/src/orxonox/gamestates/GSLevel.h
r5643 r5648 33 33 34 34 #include <string> 35 #include "util/Scope.h" 35 36 #include "core/OrxonoxClass.h" 36 37 #include "core/GameState.h" … … 62 63 void keybindInternal(const std::string& command, bool bTemporary); 63 64 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_; 73 73 74 74 //##### ConfigValues ##### -
code/branches/libraries/src/orxonox/objects/quest/AddQuest.h
r3196 r5648 35 35 #define _AddQuest_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 #include "ChangeQuestStatus.h" 39 39 … … 43 43 @brief 44 44 Adds a Quest, resp. changes the quests status to active for the player invoking the Quest. 45 45 46 46 Creating a AddQuest through XML goes as follows: 47 47 48 48 <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. 49 49 @author 50 50 Damian 'Mozork' Frick 51 51 */ 52 class _ OrxonoxExport AddQuest : public ChangeQuestStatus52 class _QuestExport AddQuest : public ChangeQuestStatus 53 53 { 54 54 public: 55 55 AddQuest(BaseObject* creator); 56 56 virtual ~AddQuest(); 57 57 58 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML. 59 59 60 60 virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect. 61 61 -
code/branches/libraries/src/orxonox/objects/quest/AddQuestHint.h
r3196 r5648 35 35 #define _AddQuestHint_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 45 45 @brief 46 46 Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on. 47 47 48 48 Creating a AddQuestHint through XML goes as follows: 49 49 50 50 <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. 51 51 @author 52 52 Damian 'Mozork' Frick 53 53 */ 54 class _ OrxonoxExport AddQuestHint : public QuestEffect54 class _QuestExport AddQuestHint : public QuestEffect 55 55 { 56 56 public: … … 71 71 inline const std::string & getHintId(void) const 72 72 { return this->hintId_; } 73 73 74 74 bool setHintId(const std::string & id); //!< Sets the id of the QuestHint. 75 75 -
code/branches/libraries/src/orxonox/objects/quest/AddReward.h
r3196 r5648 35 35 #define _AddReward_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 45 45 @brief 46 46 Adds a list of Rewardables to a player. 47 47 48 48 Creating a AddReward through XML goes as follows: 49 49 50 50 <AddReward> 51 51 <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations. … … 56 56 Damian 'Mozork' Frick 57 57 */ 58 class _ OrxonoxExport AddReward : public QuestEffect58 class _QuestExport AddReward : public QuestEffect 59 59 { 60 60 public: … … 75 75 inline void addRewardable(Rewardable* reward) 76 76 { this->rewards_.push_back(reward); } 77 77 78 78 const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index. 79 79 -
code/branches/libraries/src/orxonox/objects/quest/CMakeLists.txt
r5619 r5648 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES1 SET_SOURCE_FILES(QUEST_SRC_FILES 2 2 AddQuest.cc 3 3 AddQuestHint.cc … … 20 20 21 21 ADD_SUBDIRECTORY(notifications) 22 23 # add the parent directory for tolua (TODO: remove this if the quest plugin is moved somewhere else) 24 INCLUDE_DIRECTORIES(..) 25 26 ORXONOX_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 35 35 #define _ChangeQuestStatus_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 48 48 Damian 'Mozork' Frick 49 49 */ 50 class _ OrxonoxExport ChangeQuestStatus : public QuestEffect50 class _QuestExport ChangeQuestStatus : public QuestEffect 51 51 { 52 52 public: … … 68 68 private: 69 69 std::string questId_; //!< The id of the Quest the status should be changed of. 70 70 71 71 bool setQuestId(const std::string & id); //!< Sets the id of the Quest. 72 72 -
code/branches/libraries/src/orxonox/objects/quest/CompleteQuest.h
r3196 r5648 35 35 #define _CompleteQuest_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 #include "ChangeQuestStatus.h" 39 39 … … 43 43 @brief 44 44 Completes a Quest (with a specified id) for the player invoking the QuestEffect. 45 45 46 46 Creating a CompleteQuest through XML goes as follows: 47 47 48 48 <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. 49 49 @author 50 50 Damian 'Mozork' Frick 51 51 */ 52 class _ OrxonoxExport CompleteQuest : public ChangeQuestStatus52 class _QuestExport CompleteQuest : public ChangeQuestStatus 53 53 { 54 54 public: -
code/branches/libraries/src/orxonox/objects/quest/FailQuest.h
r3196 r5648 35 35 #define _FailQuest_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 #include "ChangeQuestStatus.h" 39 39 … … 43 43 @brief 44 44 Fails a quest (with a specified id) for the player invoking the QuestEffect. 45 45 46 46 Creating a FailQuest through XML goes as follows: 47 47 48 48 <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. 49 49 @author 50 50 Damian 'Mozork' Frick 51 51 */ 52 class _ OrxonoxExport FailQuest : public ChangeQuestStatus52 class _QuestExport FailQuest : public ChangeQuestStatus 53 53 { 54 54 public: -
code/branches/libraries/src/orxonox/objects/quest/GlobalQuest.h
r3280 r5648 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 35 35 #define _GlobalQuest_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 47 47 GlobalQuests are Quests, that have the same status for all players. 48 48 This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it. 49 49 50 50 Creating a GlobalQuest through XML goes as follows: 51 51 52 52 <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 53 53 <QuestDescription title="Title" description="Description." /> //The description of the quest. … … 81 81 Damian 'Mozork' Frick 82 82 */ 83 class _ OrxonoxExport GlobalQuest : public Quest83 class _QuestExport GlobalQuest : public Quest 84 84 { 85 85 public: … … 88 88 89 89 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML. 90 90 91 91 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 92 92 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. … … 98 98 99 99 virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player. 100 100 101 101 virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player. 102 102 … … 105 105 QuestStatus::Value status_; //!< The status of this Quest. 106 106 std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest. 107 107 108 108 bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects. 109 109 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 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 35 35 #define _LocalQuest_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <map> … … 46 46 Handles Quests which have different states for different players. 47 47 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 49 49 Creating a LocalQuest through XML goes as follows: 50 50 51 51 <LocalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 52 52 <QuestDescription title="Title" description="Description." /> //The description of the quest. … … 75 75 Damian 'Mozork' Frick 76 76 */ 77 class _ OrxonoxExport LocalQuest : public Quest77 class _QuestExport LocalQuest : public Quest 78 78 { 79 79 public: … … 82 82 83 83 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML. 84 84 85 85 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 86 86 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. -
code/branches/libraries/src/orxonox/objects/quest/Quest.h
r3280 r5648 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 32 32 The Quest is the parent class of LocalQuest and GlobalQuest. 33 33 */ 34 34 35 35 #ifndef _Quest_H__ 36 36 #define _Quest_H__ 37 37 38 #include " OrxonoxPrereqs.h"38 #include "objects/quest/QuestPrereqs.h" 39 39 40 40 #include <list> … … 62 62 A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest. 63 63 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 65 65 Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better. 66 66 @author 67 67 Damian 'Mozork' Frick 68 68 */ 69 class _ OrxonoxExport Quest : public QuestItem69 class _QuestExport Quest : public QuestItem 70 70 { 71 71 public: … … 81 81 inline Quest* getParentQuest(void) const 82 82 { return this->parentQuest_; } 83 83 84 84 /** 85 85 @brief Returns the list of subquests. … … 95 95 inline const std::list<QuestHint*> & getHintsList(void) const 96 96 { return this->hints_; } 97 97 98 98 bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'. 99 99 bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'. 100 100 bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'. 101 101 bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 102 102 103 103 bool start(PlayerInfo* player); //!< Sets a Quest to active. 104 104 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 105 105 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. 106 106 107 107 bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest. 108 108 … … 116 116 const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index. 117 117 const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index. 118 118 119 119 /** 120 120 @brief Returns the list of fail QuestEffects. … … 123 123 inline std::list<QuestEffect*> & getFailEffectList(void) 124 124 { return this->failEffects_; } 125 125 126 126 /** 127 127 @brief Returns the list of complete QuestEffects. … … 133 133 virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player. 134 134 virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player. 135 135 136 136 private: 137 137 Quest* parentQuest_; //!< Pointer to the parentquest. … … 142 142 std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed. 143 143 std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed. 144 144 145 145 std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest. 146 146 147 147 bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest. 148 148 bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest. -
code/branches/libraries/src/orxonox/objects/quest/QuestDescription.h
r3370 r5648 35 35 #define _QuestDescription_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 47 47 This class is a description of a QuestItem. 48 48 It holds a title and a description. 49 49 50 50 Creating a QuestDescription through XML goes as follows: 51 51 52 52 <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" /> 53 53 @author 54 54 Damian 'Mozork' Frick 55 55 */ 56 class _ OrxonoxExport QuestDescription : public BaseObject56 class _QuestExport QuestDescription : public BaseObject 57 57 { 58 58 // tolua_end … … 70 70 inline const std::string & getTitle(void) const 71 71 { return this->title_; } 72 72 73 73 /** 74 74 @brief Returns the description text. … … 78 78 { return this->description_; } 79 79 // tolua_end 80 80 81 81 /** 82 82 @brief Returns the fail message. … … 85 85 inline const std::string & getFailMessage(void) const 86 86 { return this->failMessage_; } 87 87 88 88 /** 89 89 @brief Returns the complete message. … … 92 92 inline const std::string & getCompleteMessage(void) const 93 93 { return this->completeMessage_; } 94 94 95 95 /** 96 96 @brief Sends a Notification displaying that a QuestHint was added. … … 99 99 inline bool sendAddHintNotification(void) const 100 100 { return notificationHelper("hint", ""); } 101 101 102 102 /** 103 103 @brief Sends a Notification displaying that a Quest was added. … … 106 106 inline bool sendAddQuestNotification(void) const 107 107 { return notificationHelper("quest", "start"); } 108 108 109 109 /** 110 110 @brief Sends a Notification displaying that a Quest was failed. … … 113 113 inline bool sendFailQuestNotification(void) const 114 114 { return notificationHelper("quest", "fail"); } 115 115 116 116 /** 117 117 @brief Sends a Notification displaying that a Quest was completed. … … 135 135 inline void setTitle(const std::string & title) 136 136 { this->title_ = title; } 137 137 138 138 /** 139 139 @brief Sets the description text. … … 149 149 inline void setFailMessage(const std::string & message) 150 150 { this->failMessage_ = message; } 151 151 152 152 /** 153 153 @brief Sets the complete message. -
code/branches/libraries/src/orxonox/objects/quest/QuestEffect.h
r3196 r5648 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 35 35 #define _QuestEffect_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 49 49 Damian 'Mozork' Frick 50 50 */ 51 class _ OrxonoxExport QuestEffect : public BaseObject51 class _QuestExport QuestEffect : public BaseObject 52 52 { 53 53 public: -
code/branches/libraries/src/orxonox/objects/quest/QuestEffectBeacon.h
r3280 r5648 35 35 #define _QuestEffectBeacon_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 58 58 A QuestEffectBeacon can be executed a defined number of times. 59 59 A QuestEffectBeacon can be inactive or active. 60 60 61 61 Creating a QuestEffectBeacon through XML goes as follows: 62 62 63 63 <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. 64 64 <effects> … … 79 79 Damian 'Mozork' Frick 80 80 */ 81 class _ OrxonoxExport QuestEffectBeacon : public StaticEntity81 class _QuestExport QuestEffectBeacon : public StaticEntity 82 82 { 83 83 public: 84 84 QuestEffectBeacon(BaseObject* creator); 85 85 virtual ~QuestEffectBeacon(); 86 86 87 87 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML. 88 88 89 89 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon. 90 90 91 91 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon. 92 92 93 93 /** 94 94 @brief Tests whether the QuestEffectBeacon is active. … … 97 97 inline bool isActive(void) 98 98 { return this->status_ == QuestEffectBeaconStatus::Active; } 99 99 100 100 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon. 101 101 102 102 protected: 103 103 bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed. 104 104 105 105 /** 106 106 @brief Returns the number of times the QUestEffectBeacon can still be executed. … … 109 109 inline const int & getTimes(void) const 110 110 { return this->times_; } 111 111 112 112 private: 113 113 static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers. 114 114 115 115 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 116 116 int times_; //!< Number of times the beacon can be exectued. 117 117 QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive. 118 118 119 119 bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed. 120 120 bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon. 121 121 122 122 const QuestEffect* getEffect(unsigned int index) const; //!< Get the QuestEffect at a given index. 123 123 124 124 }; 125 125 -
code/branches/libraries/src/orxonox/objects/quest/QuestHint.h
r3280 r5648 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 35 35 #define _QuestHint_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <map> … … 57 57 Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest. 58 58 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 60 60 Creating a QuestHint through XML goes as follows: 61 61 62 62 <QuestHint id="hintId"> //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 63 63 <QuestDesctription title="" description="" /> … … 66 66 Damian 'Mozork' Frick 67 67 */ 68 class _ OrxonoxExport QuestHint : public QuestItem68 class _QuestExport QuestHint : public QuestItem 69 69 { 70 70 -
code/branches/libraries/src/orxonox/objects/quest/QuestItem.h
r3196 r5648 26 26 * 27 27 */ 28 28 29 29 /** 30 30 @file … … 37 37 #define _QuestItem_H__ 38 38 39 #include " OrxonoxPrereqs.h"39 #include "objects/quest/QuestPrereqs.h" 40 40 41 41 #include <string> … … 51 51 Damian 'Mozork' Frick 52 52 */ 53 class _ OrxonoxExport QuestItem : public BaseObject53 class _QuestExport QuestItem : public BaseObject 54 54 { 55 55 … … 66 66 inline const std::string & getId(void) const 67 67 { return this->id_; } 68 68 69 69 /** 70 70 @brief Returns the QuestDescription of the QuestItem. … … 78 78 protected: 79 79 void setId(const std::string & id); //!< Sets the id of the QuestItem. 80 80 81 81 /** 82 82 @brief Sets the description of the QuestItem. -
code/branches/libraries/src/orxonox/objects/quest/QuestListener.h
r3280 r5648 35 35 #define _QuestListener_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 58 58 @brief 59 59 Provides a way to react to the starting, completing and failing of Quests. 60 60 61 61 The XML representation goes as follows: 62 62 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 64 64 <BaseObject> // The object that should react to the status change of a Quest. 65 65 <events> … … 72 72 Damian 'Mozork' Frick 73 73 */ 74 class _ OrxonoxExport QuestListener : public BaseObject74 class _QuestExport QuestListener : public BaseObject 75 75 { 76 76 public: 77 77 QuestListener(BaseObject* creator); 78 78 virtual ~QuestListener(); 79 79 80 80 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML. 81 81 82 82 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 84 84 bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to. 85 85 bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener. 86 86 87 87 std::string getMode(void); //!< Get the mode of the QuestListener. 88 89 const std::string & getQuestId(void); 88 89 const std::string & getQuestId(void); 90 90 bool execute(void); //!< Executes the QuestListener, resp. fires an Event. 91 91 92 92 private: 93 93 QuestListenerMode::Value mode_; //!< The mode of the QuestListener. 94 94 Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to. 95 95 96 96 }; 97 97 -
code/branches/libraries/src/orxonox/objects/quest/QuestManager.cc
r5617 r5648 36 36 #include "util/Exception.h" 37 37 #include "core/CoreIncludes.h" 38 #include "core/GUIManager.h" 38 39 39 40 #include "objects/infos/PlayerInfo.h" … … 64 65 QuestManager::~QuestManager() 65 66 { 66 67 67 } 68 68 … … 207 207 QuestContainer* QuestManager::getQuestTree(std::string & name) 208 208 { 209 PlayerInfo* player = this->players_[name];209 PlayerInfo* player = GUIManager::getInstance().getPlayer(name); 210 210 if(player == NULL) 211 211 { -
code/branches/libraries/src/orxonox/objects/quest/QuestManager.h
r5617 r5648 35 35 #define _QuestManager_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 41 41 #include <string> 42 42 43 #include "util/S ingleton.h"43 #include "util/ScopedSingleton.h" 44 44 #include "core/OrxonoxClass.h" 45 45 … … 66 66 }; 67 67 68 typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua 69 68 70 /** 69 71 @brief … … 73 75 Damian 'Mozork' Frick 74 76 */ 75 class _ OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass77 class _QuestExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass 76 78 { 77 79 // tolua_end 78 friend class S ingleton<QuestManager>;80 friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>; 79 81 public: 80 82 QuestManager(); … … 82 84 83 85 //! Returns a reference to the single instance of the Quest Manager. 84 static QuestManager& getInstance() { return S ingleton<QuestManager>::getInstance(); } // tolua_export86 static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export 85 87 86 88 bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. … … 92 94 QuestContainer* getQuestTree(std::string & name); // tolua_export 93 95 94 inline void setPlayer(const std::string& guiname, PlayerInfo* player)95 { this->players_[guiname] = player; }96 inline PlayerInfo* getPlayer(const std::string& guiname) const97 { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }98 99 96 private: 100 97 static QuestManager* singletonPtr_s; … … 102 99 std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's. 103 100 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 gui105 101 106 102 void getRootQuests(const PlayerInfo* player, std::list<Quest*> & list); -
code/branches/libraries/src/orxonox/objects/quest/QuestNotification.h
r5619 r5648 30 30 #define _QuestNotification_H__ 31 31 32 #include " OrxonoxPrereqs.h"32 #include "objects/quest/QuestPrereqs.h" 33 33 34 34 #include <string> … … 43 43 Damian 'Mozork' Frick 44 44 */ 45 class _ OrxonoxExport QuestNotification : public Notification45 class _QuestExport QuestNotification : public Notification 46 46 { 47 47 public: -
code/branches/libraries/src/orxonox/objects/quest/notifications/CMakeLists.txt
r5635 r5648 1 ADD_SOURCE_FILES( ORXONOX_SRC_FILES1 ADD_SOURCE_FILES(QUEST_SRC_FILES 2 2 Notification.cc 3 3 NotificationManager.cc 4 NotificationOverlay.cc 5 NotificationQueue.cc 4 6 ) -
code/branches/libraries/src/orxonox/objects/quest/notifications/Notification.h
r5619 r5648 35 35 #define _Notification_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 49 49 Damian 'Mozork' Frick 50 50 */ 51 class _ OrxonoxExport Notification : public BaseObject51 class _QuestExport Notification : public BaseObject 52 52 { 53 53 public: -
code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationManager.h
r5619 r5648 35 35 #define _NotificationManager_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <ctime> … … 41 41 #include <string> 42 42 43 #include "util/S ingleton.h"43 #include "util/ScopedSingleton.h" 44 44 #include "core/OrxonoxClass.h" 45 45 … … 54 54 Damian 'Mozork' Frick 55 55 */ 56 class _ OrxonoxExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass56 class _QuestExport NotificationManager : public ScopedSingleton<NotificationManager, ScopeID::GSLevel>, public OrxonoxClass 57 57 { 58 friend class S ingleton<NotificationManager>;58 friend class ScopedSingleton<NotificationManager, ScopeID::GSLevel>; 59 59 public: 60 60 NotificationManager(); -
code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationOverlay.h
r5646 r5648 36 36 #define _NotificationOverlay_H__ 37 37 38 #include "o verlays/OverlaysPrereqs.h"38 #include "objects/quest/QuestPrereqs.h" 39 39 40 40 #include <string> … … 50 50 Damian 'Mozork' Frick 51 51 */ 52 class _ OverlaysExport NotificationOverlay : public OverlayText52 class _QuestExport NotificationOverlay : public OverlayText 53 53 { 54 54 -
code/branches/libraries/src/orxonox/objects/quest/notifications/NotificationQueue.h
r5646 r5648 35 35 #define _NotificationOueue_H__ 36 36 37 #include "o verlays/OverlaysPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <ctime> … … 85 85 */ 86 86 87 class _ OverlaysExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener87 class _QuestExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener 88 88 { 89 89 -
code/branches/libraries/src/orxonox/overlays/CMakeLists.txt
r5627 r5648 12 12 ADD_SUBDIRECTORY(debug) 13 13 ADD_SUBDIRECTORY(hud) 14 ADD_SUBDIRECTORY(notifications)15 14 ADD_SUBDIRECTORY(stats) 16 15 -
code/branches/libraries/src/orxonox/overlays/GUIOverlay.cc
r5617 r5648 36 36 #include "core/GUIManager.h" 37 37 #include "core/XMLPort.h" 38 #include "objects/quest/QuestManager.h"39 38 #include "objects/infos/PlayerInfo.h" 40 39 … … 84 83 { 85 84 this->guiName_ = name; 86 QuestManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner()));85 GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner())); 87 86 } 88 87 } -
code/branches/libraries/src/orxonox/overlays/OverlaysPrereqs.h
r5630 r5648 72 72 class HUDHealthBar; 73 73 class HUDTimer; 74 class Notification;75 class NotificationListener;76 class NotificationManager;77 class NotificationOverlay;78 class NotificationQueue;79 74 class OrxonoxOverlay; 80 75 class OverlayGroup;
Note: See TracChangeset
for help on using the changeset viewer.