[Orxonox-commit 2751] r7456 - in code/trunk: data/gui/scripts doc/api doc/api/images src/modules/notifications src/modules/notifications/dispatchers src/modules/pickup src/modules/pickup/items src/modules/questsystem src/modules/questsystem/effects src/orxonox/interfaces src/orxonox/pickup
dafrick at orxonox.net
dafrick at orxonox.net
Wed Sep 15 19:29:17 CEST 2010
Author: dafrick
Date: 2010-09-15 19:29:16 +0200 (Wed, 15 Sep 2010)
New Revision: 7456
Added:
code/trunk/doc/api/images/questsystem.png
Modified:
code/trunk/data/gui/scripts/QuestGUI.lua
code/trunk/doc/api/Groups.dox
code/trunk/src/modules/notifications/Notification.cc
code/trunk/src/modules/notifications/Notification.h
code/trunk/src/modules/notifications/NotificationDispatcher.cc
code/trunk/src/modules/notifications/NotificationDispatcher.h
code/trunk/src/modules/notifications/NotificationManager.h
code/trunk/src/modules/notifications/NotificationQueue.h
code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc
code/trunk/src/modules/notifications/dispatchers/CommandNotification.h
code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc
code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h
code/trunk/src/modules/pickup/CollectiblePickup.h
code/trunk/src/modules/pickup/DroppedPickup.h
code/trunk/src/modules/pickup/Pickup.h
code/trunk/src/modules/pickup/PickupCollection.h
code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
code/trunk/src/modules/pickup/PickupManager.h
code/trunk/src/modules/pickup/PickupRepresentation.h
code/trunk/src/modules/pickup/PickupSpawner.h
code/trunk/src/modules/pickup/items/DronePickup.h
code/trunk/src/modules/pickup/items/HealthPickup.h
code/trunk/src/modules/pickup/items/InvisiblePickup.h
code/trunk/src/modules/pickup/items/MetaPickup.h
code/trunk/src/modules/pickup/items/ShieldPickup.h
code/trunk/src/modules/pickup/items/SpeedPickup.h
code/trunk/src/modules/questsystem/GlobalQuest.cc
code/trunk/src/modules/questsystem/GlobalQuest.h
code/trunk/src/modules/questsystem/LocalQuest.cc
code/trunk/src/modules/questsystem/LocalQuest.h
code/trunk/src/modules/questsystem/Quest.cc
code/trunk/src/modules/questsystem/Quest.h
code/trunk/src/modules/questsystem/QuestDescription.cc
code/trunk/src/modules/questsystem/QuestDescription.h
code/trunk/src/modules/questsystem/QuestEffect.cc
code/trunk/src/modules/questsystem/QuestEffect.h
code/trunk/src/modules/questsystem/QuestEffectBeacon.cc
code/trunk/src/modules/questsystem/QuestEffectBeacon.h
code/trunk/src/modules/questsystem/QuestHint.cc
code/trunk/src/modules/questsystem/QuestHint.h
code/trunk/src/modules/questsystem/QuestItem.cc
code/trunk/src/modules/questsystem/QuestItem.h
code/trunk/src/modules/questsystem/QuestListener.cc
code/trunk/src/modules/questsystem/QuestListener.h
code/trunk/src/modules/questsystem/QuestManager.cc
code/trunk/src/modules/questsystem/QuestManager.h
code/trunk/src/modules/questsystem/QuestNotification.cc
code/trunk/src/modules/questsystem/QuestNotification.h
code/trunk/src/modules/questsystem/effects/AddQuest.cc
code/trunk/src/modules/questsystem/effects/AddQuest.h
code/trunk/src/modules/questsystem/effects/AddQuestHint.cc
code/trunk/src/modules/questsystem/effects/AddQuestHint.h
code/trunk/src/modules/questsystem/effects/AddReward.cc
code/trunk/src/modules/questsystem/effects/AddReward.h
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h
code/trunk/src/modules/questsystem/effects/CompleteQuest.cc
code/trunk/src/modules/questsystem/effects/CompleteQuest.h
code/trunk/src/modules/questsystem/effects/FailQuest.cc
code/trunk/src/modules/questsystem/effects/FailQuest.h
code/trunk/src/orxonox/interfaces/PickupCarrier.h
code/trunk/src/orxonox/interfaces/Pickupable.h
code/trunk/src/orxonox/pickup/PickupIdentifier.h
Log:
Reviewing documentation fo Questsystem, moving documentation fully into doxygen.
Added some files to modules they belong to.
Modified: code/trunk/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/QuestGUI.lua 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/data/gui/scripts/QuestGUI.lua 2010-09-15 17:29:16 UTC (rev 7456)
@@ -38,11 +38,11 @@
local questWindow = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/QuestGUI/Quests")
questWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
- -- Iterate through all parent-quests.
- local numParentQuests = orxonox.QuestManager:getInstance():getNumParentQuests(P.player)
+ -- Iterate through all root-quests.
+ local numRootQuests = orxonox.QuestManager:getInstance():getNumRootQuests(P.player)
local i = 0
- while i <= numParentQuests-1 do
- local quest = orxonox.QuestManager:getInstance():getParentQuest(P.player, i)
+ while i <= numRootQuests-1 do
+ local quest = orxonox.QuestManager:getInstance():getRootQuest(P.player, i)
index = P.createQuestNodes(questWindow, quest, depth, index)
i = i+1
end
Modified: code/trunk/doc/api/Groups.dox
===================================================================
--- code/trunk/doc/api/Groups.dox 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/doc/api/Groups.dox 2010-09-15 17:29:16 UTC (rev 7456)
@@ -22,7 +22,7 @@
* Author:
* Fabian 'x3n' Landau
* Co-authors:
- * ...
+ * Damian 'Mozork' Frick
*
*/
@@ -118,6 +118,9 @@
/**
@defgroup Notifications Notifications
@ingroup Modules
+
+ @defgroup NotificationDispatchers Dispatchers
+ @ingroup Notifications
*/
/**
@@ -133,6 +136,9 @@
/**
@defgroup Pickup Pickup
@ingroup Modules
+
+ @defgroup PickupItems Items
+ @ingroup Pickup
*/
/**
@@ -143,6 +149,197 @@
/**
@defgroup Questsystem Questsystem
@ingroup Modules
+
+ The Questsystem is a module that enhances Orxonox with @ref orxonox::Quest "Quests". @ref orxonox::Quest "Quests" are objects that challenge the player that receives such an object to fulfill some specific task (e.g. Rescue a princess, fetch some rare metal alloy, destroy the evil pirates den, ...). Upon having fulfilled that task the player can be rewarded with some kind of reward. Quests can be hierarchically structured, meaning that to fulfill some @ref orxonox::Quest "Quest" you first have to fulfill all (or some, depending on the quest) sub-quests.
+
+ @section TechnicalDetails Technical details
+ The Questsystem essentially consists of the @ref orxonox::Quest "Quest" entity which is the quest itself (and sub- or helper-entities, such as @ref orxonox::QuestHint "QuestHint" (hints for quests) or @ref orxonox::QuestDescription "QuestDescription" (descriptions for quests and hints, to separate content from function)), the @ref orxonox::QuestEffect "QuestEffect" and @ref orxonox::QuestListener "QuestListener" entities which are the only tools for quests to have any influence on the game world. By enabling quests to have @ref orxonox::QuestEffect "QuestEffects" they are able to (for example) fail or complete other quests, activate hints, give rewards or even add a quest to a player. @ref orxonox::QuestListener "QuestListeners" on the other hand can be used by any object to react to a status change of a quest. The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is the physical entity which finally makes quests available for the player in the game, by being able to invoke a @ref orxonox::QuestEffect "QuestEffect" on a player (under some conditions).
+ @image html questsystem.png
+
+ @section CreatingQuests Creating Quests
+
+ @subsection CreatingTheQuestHierarchy Creating the Quest-Hierarchy
+ To start you have to create a Quest-Hierarchy in the XML-Levelfile by hierarchically nesting your quests. There are two types of Quests you can use, the LocalQuest and the GlobalQuest.
+
+ @subsubsection LocalQuest LocalQuest
+ A @ref orxonox::LocalQuest "LocalQuest" is a @ref orxonox::Quest "Quest" which has different states for each player, that means each @ref orxonox::LocalQuest "LocalQuest" can be obtained and completed (or failed) by each player in parallel. A questId is some string that uniquely identifies the quest, this can either be a name or, to ensure uniqueness, you can use a GUID generator (<a href="http://www.google.com/search?q=guid+generator">google</a> or you can use this <a href="http://www.famkruithof.net/uuid/uuidgen">generator</a>). The advantage of GUID is, that you can be quite sure that your id is unique, the drawback is, that it provides less overview and can be quite confusing when looking at the level file. So make your own choice.
+
+ Creating a @ref orxonox::LocalQuest "LocalQuest" in XML goes as follows:
+ @code
+ <LocalQuest id="questId">
+ <QuestDescription title="Title" description="Description." /> //The description of the quest.
+ <subquests>
+ <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.
+ ...
+ <Quest id="questIdn" />
+ </subquests>
+ <hints>
+ <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
+ ...
+ <QuestHint id="hintIdn" />
+ </hints>
+ <fail-effects>
+ <QuestEffect /> //A list of QuestEffects, invoked when the Quest is failed, see QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </fail-effects>
+ <complete-effects>
+ <QuestEffect /> //A list of QuestEffects, invoked when the Quest is completed, see QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </complete-effects>
+ </LocalQuest>
+ @endcode
+
+ @subsubsection GlobalQuest GlobalQuest
+ @ref orxonox::GlobalQuest "GlobalQuests" are different, they can be obtained by every player but the changes made to the @ref orxonox::Quest "Quest" (e.g. completion of the quest) affect all owners of the quest. A short example: There are 3 Players, A, B and C. Player A obtains the quest, a while later player B obtains the quest and completes it. Since it is a @ref orxonox::GlobalQuest "GlobalQuest" it is completed for all players having obtained the Quest which means it is also completed for player A. Player C though, never having obtained the quest, can now never complete it.
+
+ Creating a @ref orxonox::GlobalQuest "GlobalQuest" in XML goes as follows:
+ @code
+ <GlobalQuest id="questId">
+ <QuestDescription title="Title" description="Description." /> //The description of the quest.
+ <subquests>
+ <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.
+ ...
+ <Quest id="questIdn" />
+ </subquests>
+ <hints>
+ <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
+ ...
+ <QuestHint id="hintIdn" />
+ </hints>
+ <fail-effects>
+ <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </fail-effects>
+ <complete-effects>
+ <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is completed, see QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </complete-effects>
+ <reward-effects>
+ <QuestEffect /> //A list of QuestEffects, invoked on the player completing this quest. See QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </reward-effects>
+ </GlobalQuest>
+ @endcode
+
+ As you may see that another difference between a @ref orxonox::GlobalQuest "GlobalQuest" and a @ref orxonox::LocalQuest "LocalQuest" is, that with a \ref orxonox::GlobalQuest "GlobalQuest" having @ref orxonox::AddReward "RewardEffects", the RewardEffects are only executed on the player completing the quest. Additionally \ref orxonox::CompleteQuest "CompleteEffects" are executed on all players having obtained the quest before it was completed, when it is completed., while with a @ref orxonox::LocalQuest "LocalQuest" each player that completes a quest, completes it for himself alone, but also gets the reward, regardless whether another player completed the quest before him.
+
+ @subsubsection QuestHint QuestHint
+ @ref orxonox::QuestHint "QuestHints" can be used to give a player useful information for @ref orxonox::Quest "Quests" he is working on completing. @ref orxonox::QuestHint "QuestHints" cannot have any side effects, but also have an identifier which follows the same form as in the @ref orxonox::Quest "Quests".
+
+ Creating a @ref orxonox::QuestHint "QuestHint" in XML goes as follows:
+ @code
+ <QuestHint id="hintId">
+ <QuestDesctription title="" description="" />
+ </QuestHint>
+ @endcode
+
+ @subsubsection QuestDescription QuestDescription
+ Each @ref orxonox::Quest "Quest" (and also each @ref orxonox::QuestHint "QuestHint") must have a @ref orxonox::QuestDescription "QuestDescription" consisting of a title and description, and for @ref orxonox::Quest "Quests" also messages for the event the quest is either failed or completed. Of course these are (as is the title and the description) optional.
+
+ Creating a @ref orxonox::QuestDescription "QuestDescription" in XML goes as follows:
+ @code
+ <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
+ @endcode
+
+ @subsection CreatingSideEffects Creating side effects
+ @ref orxonox::Quest "Quests" can have side effects, in fact that is mostly what they are about. This means that they can have an influence on the game world. @ref orxonox::Quest "Quests" do that through two distinct devices, @ref orxonox::QuestEffect "QuestEffects" (active) and @ref orxonox::QuestListener "QuestListeners" (passive).
+
+ @subsubsection QuestEffect QuestEffect
+ A @ref orxonox::QuestEffect "QuestEffect" is the first (and probably most important) device for @ref orxonox::Quest "Quests" to have side effects. There are two entities that can have @ref orxonox::QuestEffect "QuestEffects": @ref orxonox::Quest "Quests" and \ref orxonox::QuestEffectBeacon "QuestEffectBeacons" (which will be explained later on). @ref orxonox::QuestEffect "QuestEffects", for example, can start a @ref orxonox::Quest "Quest" for a player, complete/fail @ref orxonox::Quest "Quests" for a player, add a @ref orxonox::QuestHint "QuestHint" or a @ref orxonox::Rewardable "Reward" to a player, and potentially much, much more.
+
+ These @ref orxonox::QuestEffect "QuestEffects" are implemented so far, but feel free to <a href="http://www.orxonox.net/wiki/DamianFrick">contact me</a> if you have suggestions for new @ref orxonox::QuestEffect "QuestEffects" or if you need help implementing a new one yourself.
+
+ @paragraph AddQuest AddQuest
+ This @ref orxonox::QuestEffect "QuestEffect" adds (respectively starts) a @ref orxonox::Quest "Quest" (identified by the given questId) to the player.
+ @code
+ <AddQuest questId="id" /> //Where id identifies the Quest that should be added.
+ @endcode
+
+ @paragraph FailQuest FailQuest
+ This @ref orxonox::QuestEffect "QuestEffect" fails a @ref orxonox::Quest "Quest" (identified by the given questId) for the player.
+ @code
+ <FailQuest questId="id" /> //Where id identifies the Quest that should be added.
+ @endcode
+
+ @paragraph CompleteQuest CompleteQuest
+ This @ref orxonox::QuestEffect "QuestEffect" completes a @ref orxonox::Quest "Quest" (identified by the given questId) for the player.
+ @code
+ <CompleteQuest questId="id" /> //Where id identifies the Quest that should be added.
+ @endcode
+
+ @paragraph AddQuestHint AddQuestHint
+ This @ref orxonox::QuestEffect "QuestEffect" adds a @ref orxonox::QuestHint "QuestHint" to a @ref orxonox::Quest "Quest" (identified by the given questId) of a player.
+ @code
+ <AddQuestHint hintId="id" /> //Where id identifies the QuestHint that should be added.
+ @endcode
+
+ @paragraph AddReward AddReward
+ This @ref orxonox::QuestEffect "QuestEffect" adds a @ref orxonox::Rewardable "Rewardable" (@ref orxonox::Rewardable "Rewardable" is an Interface which can be implemented by an object that its creator thinks should be able to be rewarded a player for completing (or failing for that matter) a @ref orxonox::Quest "Quest") to the player. @ref Pickup Pickups for example wold be good @ref orxonox::Rewardable "Rewardables".
+ @code
+ <AddReward>
+ <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations.
+ ...
+ <Rewardable />
+ </AddReward>
+ @endcode
+
+ @subsubsection QuestListener QuestListener
+ The @ref orxonox::QuestListener "QuestListener" is the second device you can use to create side effects. As opposed to @ref orxonox::QuestEffect "QuestEffects" (that are executed (or invoked) either as a result of failing or completing a Quest or by a @ref orxonox::QuestEffectBeacon "QuestEffectBeacon"), @ref orxonox::QuestListener "QuestListeners" are passive, meaning that they relay information regarding status changes of @ref orxonox::Quest "Quests" rather than enforcing status changes. @ref orxonox::QuestListener "QuestListeners" have a certain mode (all, start, complete or fail) and a @ref orxonox::Quest "Quest" which they belong to (resp. to which they react). You then can use @ref orxonox::QuestListener "QuestListeners" to make basically any object aware of when the status of the given @ref orxonox::Quest "Quest" changes (the way you defined through the mode) and take any action you may think of.
+
+ Here is an example of the usage of @ref orxonox::QuestListener "QuestListeners" in XML:
+ @code
+ <BaseObject> // The object that should react to the status change of a Quest.
+ <events>
+ <function> // Where function is the method of the object that schould be executed. Normally this would be visibility or activity.
+ <QuestListener questId="someQuestId" mode="someMode" /> // Where someQuestId is the identifier for the Quest the QuestListener is reacting to, and someMode is the kind of status change the QUestListener reacts to (all, start, complete or fail).
+ </function>
+ </events>
+ </BaseObject>
+ @endcode
+
+ I hope this example has made the usage of @ref orxonox::QuestListener "QuestListeners" a little clearer. The @ref orxonox::QuestListener "QuestListener" actually reacts exactly as any @ref orxonox::Trigger "Trigger" or @ref orxonox::EventListener "EventListener" would (although the @ref orxonox::QuestListener "QuestListener" is really neighter the one nor the other) which means you can use it in exactly the same way you would use one of the above, it just reacts to a different thing. Namely to the change in a @ref orxonox::Quest "Quests" status.
+
+ @subsection PuttingTheQuestsInTheGameWorld Putting the Quests in the game world
+ As of now we know how to create @ref orxonox::Quest "Quests" and @ref orxonox::QuestHint "QuestHints", we have a way for quests to add new quests, or even complete/fail other quests. We also have a way of reacting to a status change in a @ref orxonox::Quest "Quest". In short we know how quests can be created, how they can influence other quests and how we can react to changes in quests. But our @ref orxonox::Quest "Quests" have no ties (well, not really at least) to the game world as of yet, meaning, that the game world cannot influence quests. For this we have @ref orxonox::QuestEffectBeacon "QuestEffectBeacons".
+
+ @subsubsection QuestEffectBeacon QuestEffectBeacon
+ The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is a @ref orxonox::StaticEntity "StaticEntity" and has the ability to (when triggered trough some circumstance) invoke a specified list of @ref orxonox::QuestEffect "QuestEffects" on the player triggering the @ref orxonox::QuestEffectBeacon "QuestEffectBeacon".
+
+ Creating a @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" in XML goes as follows:
+ @code
+ <QuestEffectBeacon times=n> //Where 'n' is either 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.
+ <effects>
+ <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation.
+ ...
+ <QuestEffect />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=eventIdString />
+ </execute>
+ </events>
+ <attached>
+ <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
+ </attached>
+ </QuestEffectBeacon>
+ @endcode
+
+ The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" can only be executed a defined number of times (where -1 times stands for an infinite number of times) and the @ref orxonox::QuestEffect "QuestEffects" are invoked whenever the method 'execute' is called, which is (indirectly through an @ref orxonox::EventListener "EventListener", because I wanted to attach the @ref orxonox::PlayerTrigger "PlayerTrigger" so that its position is always relative to the @ref orxonox::QuestEffectBeacon "QuestEffectBeacons" position) done by the @ref orxonox::PlayerTrigger "PlayerTrigger".
+
+ A @ref orxonox::PlayerTrigger "PlayerTrigger" is a special sort of @ref orxonox::Trigger "Trigger" that knows the player that triggered it and therefore can be asked who that was. This allows the @ref orxonox::QuestEffect "QuestEffects" to be executed on the right player.
+
+ @section SampleQuest Sample quest
+ To get your head around all of this and see some of the things mentioned here in action you might want to check out the "The Tale of Princess Aeryn"-Quest (Levelfile: princessaeryn.oxw) in the level-folder.
+
+ @defgroup QuestEffects Effects
+ @ingroup Questsystem
+
+ A @ref orxonox::QuestEffect "QuestEffect" is a device for @ref orxonox::Quest "Quests" to have side effects. There are two entities that can have @ref orxonox::QuestEffect "QuestEffects": @ref orxonox::Quest "Quests" and \ref orxonox::QuestEffectBeacon "QuestEffectBeacons". @ref orxonox::QuestEffect "QuestEffects", for example, can start a @ref orxonox::Quest "Quest" for a player, complete/fail @ref orxonox::Quest "Quests" for a player, add a @ref orxonox::QuestHint "QuestHint" or a @ref orxonox::Rewardable "Reward" to a player, and potentially much, much more.
*/
/**
Added: code/trunk/doc/api/images/questsystem.png
===================================================================
(Binary files differ)
Property changes on: code/trunk/doc/api/images/questsystem.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: code/trunk/src/modules/notifications/Notification.cc
===================================================================
--- code/trunk/src/modules/notifications/Notification.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/Notification.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file Notification.cc
@brief Implementation of the Notification class.
*/
Modified: code/trunk/src/modules/notifications/Notification.h
===================================================================
--- code/trunk/src/modules/notifications/Notification.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/Notification.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file Notification.h
@brief Definition of the Notification class.
+ @ingroup Notifications
*/
#ifndef _Notification_H__
Modified: code/trunk/src/modules/notifications/NotificationDispatcher.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationDispatcher.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/NotificationDispatcher.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file NotificationDispatcher.cc
@brief Implementation of the NotificationDispatcher class.
*/
Modified: code/trunk/src/modules/notifications/NotificationDispatcher.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationDispatcher.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/NotificationDispatcher.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file NotificationDispatcher.h
@brief Definition of the NotificationDispatcher class.
+ @ingroup Notifications
*/
#ifndef _NotificationDispatcher_H__
Modified: code/trunk/src/modules/notifications/NotificationManager.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationManager.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/NotificationManager.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file NotificationManager.h
@brief Definition of the NotificationManager class.
+ @ingroup Notifications
*/
#ifndef _NotificationManager_H__
Modified: code/trunk/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationQueue.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/NotificationQueue.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file NotificationQueue.h
@brief Definition of the NotificationQueue class.
+ @ingroup Notifications
*/
#ifndef _NotificationOueue_H__
Modified: code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file CommandNotification.cc
@brief Implementation of the CommandNotification class.
*/
Modified: code/trunk/src/modules/notifications/dispatchers/CommandNotification.h
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/CommandNotification.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/dispatchers/CommandNotification.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file CommandNotification.h
@brief Definition of the CommandNotification class.
+ @ingroup NotificationDispatchers
*/
#ifndef _CommandNotification_H__
Modified: code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -26,6 +26,11 @@
*
*/
+/**
+ @file SimpleNotification.cc
+ @brief Implementation of the SimpleNotification class.
+*/
+
#include "SimpleNotification.h"
#include "core/CoreIncludes.h"
Modified: code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h
===================================================================
--- code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -26,6 +26,12 @@
*
*/
+/**
+ @file SimpleNotification.h
+ @brief Declaration of the SimpleNotification class.
+ @ingroup NotificationDispatchers
+*/
+
#ifndef _SimpleNotification_H__
#define _SimpleNotification_H__
Modified: code/trunk/src/modules/pickup/CollectiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/CollectiblePickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/CollectiblePickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file CollectiblePickup.h
@brief Definition of the CollectiblePickup class.
+ @ingroup Pickup
*/
#ifndef _CollectiblePickup_H__
Modified: code/trunk/src/modules/pickup/DroppedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/DroppedPickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/DroppedPickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file DroppedPickup.h
@brief Definition of the DroppedPickup class.
+ @ingroup Pickup
*/
#ifndef _DroppedPickup_H__
Modified: code/trunk/src/modules/pickup/Pickup.h
===================================================================
--- code/trunk/src/modules/pickup/Pickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/Pickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file Pickup.h
@brief Declaration of the Pickup class.
+ @ingroup Pickup
*/
#ifndef _Pickup_H__
Modified: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/PickupCollection.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupCollection.h
@brief Declaration of PickupCollection.
+ @ingroup Pickup
*/
#ifndef _PickupCollection_H__
Modified: code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupCollectionIdentifier.h
@brief Declaration of PickupCollectionIdentifier.
+ @ingroup Pickup
*/
#ifndef _PickupCollectionIdentifier_H__
Modified: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/PickupManager.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupManager.h
@brief Definition of the PickupManager class.
+ @ingroup Pickup
*/
#ifndef _PickupManager_H__
Modified: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupRepresentation.h
@brief Definition of the PickupRepresentation class.
+ @ingroup Pickup
*/
#ifndef _PickupRepresentation_H__
Modified: code/trunk/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/PickupSpawner.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupSpawner.h
@brief Definition of the PickupSpawner class.
+ @ingroup Pickup
*/
#ifndef _PickupSpawner_H__
Modified: code/trunk/src/modules/pickup/items/DronePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/DronePickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/DronePickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file DronePickup.h
@brief Declaration of the DronePickup class.
+ @ingroup PickupItems
*/
#ifndef _DronePickup_H__
Modified: code/trunk/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/HealthPickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/HealthPickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file HealthPickup.h
@brief Declaration of the HealthPickup class.
+ @ingroup PickupItems
*/
#ifndef _HealthPickup_H__
Modified: code/trunk/src/modules/pickup/items/InvisiblePickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/InvisiblePickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/InvisiblePickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file InvisiblePickup.h
@brief Declaration of the InvisiblePickup class.
+ @ingroup PickupItems
*/
#ifndef _InvisiblePickup_H__
Modified: code/trunk/src/modules/pickup/items/MetaPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/MetaPickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file MetaPickup.h
@brief Definition of the MetaPickup class.
+ @ingroup PickupItems
*/
#ifndef _MetaPickup_H__
Modified: code/trunk/src/modules/pickup/items/ShieldPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/ShieldPickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/ShieldPickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -30,6 +30,7 @@
/**
@file ShieldPickup.h
@brief Declaration of the ShieldPickup class.
+ @ingroup PickupItems
*/
#ifndef _ShieldPickup_H__
Modified: code/trunk/src/modules/pickup/items/SpeedPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/SpeedPickup.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/pickup/items/SpeedPickup.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file SpeedPickup.h
@brief Declaration of the SpeedPickup class.
+ @ingroup PickupItems
*/
#ifndef _SpeedPickup_H__
Modified: code/trunk/src/modules/questsystem/GlobalQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/GlobalQuest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/GlobalQuest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file GlobalQuest.cc
@brief Implementation of the GlobalQuest class.
*/
@@ -35,6 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "QuestEffect.h"
namespace orxonox
@@ -83,7 +84,7 @@
*/
bool GlobalQuest::fail(PlayerInfo* player)
{
- if(!this->isFailable(player)) //!< Check whether the Quest can be failed.
+ if(!this->isFailable(player)) // Check whether the Quest can be failed.
{
COUT(4) << "A non-completable quest was trying to be failed." << std::endl;
return false;
@@ -91,13 +92,11 @@
Quest::fail(player);
- //! Iterate through all players possessing this Quest.
- for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
- {
- QuestEffect::invokeEffects(*it, this->getFailEffectList());
- }
+ // Iterate through all players possessing this Quest.
+ for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
+ QuestEffect::invokeEffects(*it, this->getFailEffectList());
- return true;
+ return true;
}
/**
@@ -112,21 +111,19 @@
*/
bool GlobalQuest::complete(PlayerInfo* player)
{
- if(!this->isCompletable(player)) //!< Check whether the Quest can be completed.
+ if(!this->isCompletable(player)) // Check whether the Quest can be completed.
{
COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
return false;
}
- //! Iterate through all players possessing the Quest.
+ // Iterate through all players possessing the Quest.
for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
- {
QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
- }
Quest::complete(player);
- QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
+ QuestEffect::invokeEffects(player, this->rewards_); // Invoke reward QuestEffects on the player completing the Quest.
return true;
}
@@ -143,9 +140,8 @@
bool GlobalQuest::isStartable(const PlayerInfo* player) const
{
if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
- {
return false;
- }
+
return (this->isInactive(player) && !(this->status_ == QuestStatus::Completed || this->status_ == QuestStatus::Failed));
}
@@ -190,17 +186,14 @@
*/
QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
{
- if(player == NULL) //!< We don't want NULL-Pointers!
- {
+ //TODO: Replace with assert.
+ if(player == NULL) // We don't want NULL-Pointers!
ThrowException(Argument, "The input PlayerInfo* is NULL.");
- }
- //! Find the player.
+ // Find the player.
std::set<PlayerInfo*>::const_iterator it = this->players_.find((PlayerInfo*)(void*)player);
- if (it != this->players_.end()) //!< If the player was found.
- {
+ if (it != this->players_.end()) // If the player was found.
return this->status_;
- }
return QuestStatus::Inactive;
}
@@ -218,19 +211,16 @@
*/
bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
{
- if(player == NULL) //!< We don't want NULL-Pointers!
- {
+ //TODO: Replace with assert.
+ if(player == NULL) // We don't want NULL-Pointers!
return false;
- }
- //! Find the player.
+ // Find the player.
std::set<PlayerInfo*>::const_iterator it = this->players_.find(player);
- if (it == this->players_.end()) //!< Player is not yet in the list.
- {
- this->players_.insert(player); //!< Add the player to the set.
- }
+ if (it == this->players_.end()) // Player is not yet in the list.
+ this->players_.insert(player); // Add the player to the set.
- this->status_ = status; //!< Set the status, which is global, remember...?
+ this->status_ = status; // Set the status, which is global, remember...?
return true;
}
@@ -244,13 +234,14 @@
*/
bool GlobalQuest::addRewardEffect(QuestEffect* effect)
{
- if(effect == NULL) //!< We don't want NULL-Pointers!
+ //TODO: Replace with assert?
+ if(effect == NULL) // We don't want NULL-Pointers!
{
COUT(2) << "The reward effect to be added to quest {" << this->getId() << "} was NULL." << std::endl;
return false;
}
- this->rewards_.push_back(effect); //!< Add the QuestEffect to the list.
+ this->rewards_.push_back(effect); // Add the QuestEffect to the list.
COUT(4) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
return true;
@@ -270,13 +261,11 @@
for (std::list<QuestEffect*>::const_iterator effect = this->rewards_.begin(); effect != this->rewards_.end(); ++effect)
{
if(i == 0)
- {
return *effect;
- }
+
i--;
}
return NULL;
}
-
}
Modified: code/trunk/src/modules/questsystem/GlobalQuest.h
===================================================================
--- code/trunk/src/modules/questsystem/GlobalQuest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/GlobalQuest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file GlobalQuest.h
@brief Definition of the GlobalQuest class.
+ @ingroup Questsystem
*/
#ifndef _GlobalQuest_H__
@@ -44,11 +45,10 @@
{
/**
@brief
- GlobalQuests are Quests, that have the same status for all players.
+ GlobalQuests are @ref orxonox::Quest "Quests", that have the same status for all players.
This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
Creating a GlobalQuest through XML goes as follows:
-
@code
<GlobalQuest id="questId">
<QuestDescription title="Title" description="Description." /> //The description of the quest.
Modified: code/trunk/src/modules/questsystem/LocalQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/LocalQuest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/LocalQuest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file LocalQuest.cc
@brief Implementation of the LocalQuest class.
*/
@@ -35,6 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "QuestEffect.h"
namespace orxonox
@@ -81,7 +82,7 @@
*/
bool LocalQuest::fail(PlayerInfo* player)
{
- if(!this->isFailable(player)) //!< Checks whether the quest can be failed.
+ if(!this->isFailable(player)) // Checks whether the quest can be failed.
{
COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
return false;
@@ -89,7 +90,7 @@
Quest::fail(player);
- QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
+ QuestEffect::invokeEffects(player, this->getFailEffectList()); // Invoke the failEffects.
return true;
}
@@ -104,7 +105,7 @@
*/
bool LocalQuest::complete(PlayerInfo* player)
{
- if(!this->isCompletable(player)) //!< Checks whether the Quest can be completed.
+ if(!this->isCompletable(player)) // Checks whether the Quest can be completed.
{
COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
return false;
@@ -112,7 +113,7 @@
Quest::complete(player);
- QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
+ QuestEffect::invokeEffects(player, this->getCompleteEffectList()); // Invoke the complete QuestEffects.
return true;
}
@@ -129,9 +130,8 @@
bool LocalQuest::isStartable(const PlayerInfo* player) const
{
if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
- {
return false;
- }
+
return this->isInactive(player);
}
@@ -177,18 +177,15 @@
*/
QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const
{
- if(player == NULL) //!< No player has no defined status.
- {
+ //TODO: Replace with assert.
+ if(player == NULL) // No player has no defined status.
ThrowException(Argument, "The input PlayerInfo* is NULL.");
- }
std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player);
- if (it != this->playerStatus_.end()) //!< If there is a player in the map.
- {
+ if (it != this->playerStatus_.end()) // If there is a player in the map.
return it->second;
- }
- return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
+ return QuestStatus::Inactive; // If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
}
/**
@@ -204,10 +201,9 @@
*/
bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
{
- if(player == NULL) //!< We can't set a status for no player.
- {
+ //TODO: Replace with assert.
+ if(player == NULL) // We can't set a status for no player.
return false;
- }
this->playerStatus_[player] = status;
return true;
Modified: code/trunk/src/modules/questsystem/LocalQuest.h
===================================================================
--- code/trunk/src/modules/questsystem/LocalQuest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/LocalQuest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file LocalQuest.h
@brief Definition of the LocalQuest class.
+ @ingroup Questsystem
*/
#ifndef _LocalQuest_H__
@@ -43,11 +44,10 @@
{
/**
@brief
- Handles Quests which have different states for different players.
- 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.
+ Handles @ref orxonox::Quest "Quests" which have different states for different players.
+ LocalQuests have (as opposed to @ref orxonox::GlobalQuest "GlobalQuests") a different state for each player, that means if for one player the status of the @ref orxonox::Quest "Quest" changes it does not for all the other players which also possess this quest.
Creating a LocalQuest through XML goes as follows:
-
@code
<LocalQuest id="questId">
<QuestDescription title="Title" description="Description." /> //The description of the quest.
Modified: code/trunk/src/modules/questsystem/Quest.cc
===================================================================
--- code/trunk/src/modules/questsystem/Quest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/Quest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file Quest.cc
@brief Implementation of the Quest class.
*/
@@ -35,11 +35,12 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "QuestManager.h"
+
#include "QuestDescription.h"
+#include "QuestEffect.h"
#include "QuestHint.h"
-#include "QuestEffect.h"
#include "QuestListener.h"
+#include "QuestManager.h"
namespace orxonox
{
@@ -77,20 +78,21 @@
XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffect, xmlelement, mode);
XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffect, xmlelement, mode);
- QuestManager::getInstance().registerQuest(this); //!<Registers the Quest with the QuestManager.
+ QuestManager::getInstance().registerQuest(this); // Registers the Quest with the QuestManager.
}
/**
@brief
- Sets the parentquest of the Quest.
+ Sets the parent-quest of the Quest.
@param quest
- A pointer to the Quest to be set as parentquest.
+ A pointer to the Quest to be set as parent-quest.
@return
- Returns true if the parentquest could be set.
+ Returns true if the parent-quest could be set.
*/
bool Quest::setParentQuest(Quest* quest)
{
- if(quest == NULL) //!< We don't want to set NULL-Pointers.
+ //TODO: Replace with assert.
+ if(quest == NULL) // We don't want to set NULL-Pointers.
{
COUT(2) << "The parentquest to be added to quest {" << this->getId() << "} was NULL." << std::endl;
return false;
@@ -104,22 +106,23 @@
/**
@brief
- Adds a subquest to the Quest.
+ Adds a sub-quest to the Quest.
@param quest
- A pointer to the Quest to be set as subquest.
+ A pointer to the Quest to be set as sub-quest.
@return
- Returns true if the subquest could be set.
+ Returns true if the sub-quest could be set.
*/
bool Quest::addSubQuest(Quest* quest)
{
- if(quest == NULL) //!< We don't want to set NULL-Pointers.
+ //TODO: Replace with assert.
+ if(quest == NULL) // We don't want to set NULL-Pointers.
{
COUT(2) << "The subquest to be added to quest {" << this->getId() << "} was NULL." << std::endl;
return false;
}
- quest->setParentQuest(this); //!< Sets the currentQuest (this) as parentquest for the added subquest.
- this->subQuests_.push_back(quest); //!< Adds the Quest to the end of the list of subquests.
+ quest->setParentQuest(this); // Sets the currentQuest (this) as parent-quest for the added sub-quest.
+ this->subQuests_.push_back(quest); // Adds the Quest to the end of the list of sub-quests.
COUT(4) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
return true;
@@ -136,14 +139,15 @@
*/
bool Quest::addHint(QuestHint* hint)
{
- if(hint == NULL) //!< We don't want to set NULL-Pointers. Seriously!
+ //TODO: Replace with assert.
+ if(hint == NULL) // We don't want to set NULL-Pointers. Seriously!
{
COUT(2) << "A NULL-QuestHint was trying to be added." << std::endl;
return false;
}
- hint->setQuest(this); //!< Sets the current Quest (this) as Quest for the added QuestHint.
- this->hints_.push_back(hint); //!< Adds the QuestHint to the end of the list of QuestHints.
+ hint->setQuest(this); // Sets the current Quest (this) as Quest for the added QuestHint.
+ this->hints_.push_back(hint); // Adds the QuestHint to the end of the list of QuestHints.
COUT(4) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
return true;
@@ -159,13 +163,14 @@
*/
bool Quest::addFailEffect(QuestEffect* effect)
{
- if(effect == NULL) //!< We don't want to set NULL-Pointers.
+ //TODO: Replace with assert.
+ if(effect == NULL) // We don't want to set NULL-Pointers.
{
COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
return false;
}
- this->failEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of fail QuestEffects.
+ this->failEffects_.push_back(effect); // Adds the QuestEffect to the end of the list of fail QuestEffects.
COUT(4) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
return true;
@@ -181,13 +186,14 @@
*/
bool Quest::addCompleteEffect(QuestEffect* effect)
{
- if(effect == NULL) //!< We don't want to set NULL-Pointers.
+ //TODO: Replace with assert.
+ if(effect == NULL) // We don't want to set NULL-Pointers.
{
COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
return false;
}
- this->completeEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of complete QuestEffects.
+ this->completeEffects_.push_back(effect); // Adds the QuestEffect to the end of the list of complete QuestEffects.
COUT(4) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
return true;
@@ -195,27 +201,26 @@
/**
@brief
- Returns the subquest at the given index.
+ Returns the sub-quest at the given index.
@param index
The index.
@return
- Returns a pointer to the subquest at the given index. NULL if there is no element at the given index.
+ Returns a pointer to the sub-quest at the given index. NULL if there is no element at the given index.
*/
const Quest* Quest::getSubQuest(unsigned int index) const
{
int i = index;
- //! Iterate through all subquests.
+ // Iterate through all subquests.
for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
{
- if(i == 0) //!< We're counting down...
- {
+ if(i == 0) // We're counting down...
return *subQuest;
- }
+
i--;
}
- return NULL; //!< If the index is greater than the number of elements in the list.
+ return NULL; // If the index is greater than the number of elements in the list.
}
/**
@@ -230,16 +235,15 @@
{
int i = index;
- //! Iterate through all QuestHints.
+ // Iterate through all QuestHints.
for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
{
- if(i == 0) //!< We're counting down...
- {
+ if(i == 0) // We're counting down...
return *hint;
- }
+
i--;
}
- return NULL; //!< If the index is greater than the number of elements in the list.
+ return NULL; // If the index is greater than the number of elements in the list.
}
/**
@@ -254,16 +258,15 @@
{
int i = index;
- //! Iterate through all fail QuestEffects.
+ // Iterate through all fail QuestEffects.
for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
{
- if(i == 0) //!< We're counting down...
- {
+ if(i == 0) // We're counting down...
return *effect;
- }
+
i--;
}
- return NULL; //!< If the index is greater than the number of elements in the list.
+ return NULL; // If the index is greater than the number of elements in the list.
}
/**
@@ -278,16 +281,15 @@
{
int i = index;
- //! Iterate through all complete QuestEffects.
+ // Iterate through all complete QuestEffects.
for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
{
- if(i == 0) //!< We're counting down...
- {
+ if(i == 0) // We're counting down...
return *effect;
- }
+
i--;
}
- return NULL; //!< If the index is greater than the number of elements in the list.
+ return NULL; // If the index is greater than the number of elements in the list.
}
/**
@@ -317,7 +319,6 @@
*/
bool Quest::isActive(const PlayerInfo* player) const
{
-
return this->getStatus(player) == QuestStatus::Active;
}
@@ -361,7 +362,7 @@
*/
bool Quest::fail(PlayerInfo* player)
{
- QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
+ QuestListener::advertiseStatusChange(this->listeners_, "fail"); // Tells the QuestListeners, that the status has changed to failed.
this->setStatus(player, QuestStatus::Failed);
COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
@@ -380,7 +381,7 @@
*/
bool Quest::complete(PlayerInfo* player)
{
- QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
+ QuestListener::advertiseStatusChange(this->listeners_, "complete"); // Tells the QuestListeners, that the status has changed to completed.
this->setStatus(player, QuestStatus::Completed);
COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
@@ -399,7 +400,7 @@
*/
bool Quest::start(PlayerInfo* player)
{
- if(!this->isStartable(player)) //!< Checks whether the quest can be started.
+ if(!this->isStartable(player)) // Checks whether the quest can be started.
{
COUT(4) << "A non-startable quest was trying to be started." << std::endl;
return false;
@@ -407,7 +408,7 @@
COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
- QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
+ QuestListener::advertiseStatusChange(this->listeners_, "start"); // Tells the QuestListeners, that the status has changed to active.
this->setStatus(player, QuestStatus::Active);
@@ -425,6 +426,7 @@
*/
bool Quest::addListener(QuestListener* listener)
{
+ //TODO: Replace with assert?
if(listener == NULL)
{
COUT(2) << "A NULL-QuestListener was trying to be added to a Quests listeners." << std::endl;
Modified: code/trunk/src/modules/questsystem/Quest.h
===================================================================
--- code/trunk/src/modules/questsystem/Quest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/Quest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,9 +27,10 @@
*/
/**
- @file
+ @file Quest.h
@brief Definition of the Quest class.
- The Quest is the parent class of LocalQuest and GlobalQuest.
+ The Quest class is the parent class of @ref orxonox::LocalQuest "LocalQuest" and @ref orxonox::GlobalQuest "GlobalQuest".
+ @ingroup Questsystem
*/
#ifndef _Quest_H__
@@ -44,7 +45,7 @@
{ // tolua_export
namespace QuestStatus
{
- //!Different states of a Quest.
+ //! Different states of a @ref orxonox::Quest "Quest".
enum Value
{
Inactive,
@@ -56,13 +57,14 @@
/**
@brief
- Represents a Quest in the game.
- A Quest has a list of subquests and a parentquest (if it is not a rootquest).
+ Represents a Quest in the game. A Quest is a task that the player can (or has to) fulfill upon which he will (possibly) receive some kind of reward.
+
+ A Quest can have a list of sub-quests and has a parent-quest (if it is not a root-quest).
Each Quest exists only once but it has a different status (inactive, active, failed or completed) for each player.
- A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest.
- 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.
+ A Quest can have several hints (QuestHint) that can be unlocked through @ref orxonox::QuestEffect "QuestEffects" and then display aid in solving the Quest.
+ A Quest can have a list of @ref orxonox::QuestEffect "QuestEffects" that are invoked when the quest is failed and also a list of @ref orxonox::QuestEffect "QuestEffects" that are invoked, when the Quest is completed.
- Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
+ Quest itself should not be instantiated, if you want to create a quest either use LocalQuest or GlobalQuest, whichever suits you needs better.
@author
Damian 'Mozork' Frick
*/
@@ -76,15 +78,15 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML.
/**
- @brief Returns the parentquest of the Quest.
- @return Returns a pointer to the parentquest of the Quest.
+ @brief Returns the parent-quest of the Quest.
+ @return Returns a pointer to the parent-quest of the Quest.
*/
inline Quest* getParentQuest(void) const
{ return this->parentQuest_; }
/**
- @brief Returns the list of subquests.
- @return Returns a reference to the list of subquests of the quest.
+ @brief Returns the list of sub-quests.
+ @return Returns a reference to the list of sub-quests of the quest.
*/
inline const std::list<Quest*> & getSubQuestList(void) const
{ return this->subQuests_; }
@@ -112,7 +114,7 @@
virtual bool isFailable(const PlayerInfo* player) const = 0; //!< Checks whether the Quest can be failed.
virtual bool isCompletable(const PlayerInfo* player) const = 0; //!< Checks whether the Quest can be completed.
- const Quest* getSubQuest(unsigned int index) const; //!<Returns the subquest at the given index.
+ const Quest* getSubQuest(unsigned int index) const; //!<Returns the sub-quest at the given index.
const QuestHint* getHint(unsigned int index) const; //!< Returns the QuestHint at the given index.
const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index.
const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index.
@@ -135,8 +137,8 @@
virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
private:
- Quest* parentQuest_; //!< Pointer to the parentquest.
- std::list<Quest*> subQuests_; //!< List of all the subquests.
+ Quest* parentQuest_; //!< Pointer to the parent-quest.
+ std::list<Quest*> subQuests_; //!< List of all the sub-quests.
std::list<QuestHint*> hints_; //!< A list of all the QuestHints tied to this Quest.
@@ -145,8 +147,8 @@
std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest.
- bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest.
- bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest.
+ bool setParentQuest(Quest* quest); //!< Sets the parent-quest of the Quest.
+ bool addSubQuest(Quest* quest); //!< Adds a sub-quest to the Quest.
bool addHint(QuestHint* hint); //!< Add a QuestHint to the list of QuestHints.
bool addFailEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of fail QuestEffects.
bool addCompleteEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of complete QuestEffects.
Modified: code/trunk/src/modules/questsystem/QuestDescription.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestDescription.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestDescription.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestDescription.cc
@brief Implementation of the QuestDescription class.
*/
@@ -36,6 +36,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "QuestNotification.h"
namespace orxonox
@@ -92,23 +93,15 @@
{
std::string message;
if(item == "hint")
- {
message = "You received a hint: '" + this->title_ + '\'';
- }
else if(item == "quest")
{
if(status == "start")
- {
message = "You received a new quest: '" + this->title_ + '\'';
- }
else if(status == "fail")
- {
message = "You failed the quest: '" + this->title_ + '\'';
- }
else if(status == "complete")
- {
message = "You successfully completed the quest: '" + this->title_ + '\'';
- }
else
{
COUT(2) << "Bad input in notificationHelper, this should not be happening!" << std::endl;
Modified: code/trunk/src/modules/questsystem/QuestDescription.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestDescription.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestDescription.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestDescription.h
@brief Definition of the QuestDescription class.
+ @ingroup Questsystem
*/
#ifndef _QuestDescription_H__
@@ -44,11 +45,10 @@
{
/**
@brief
- This class is a description of a QuestItem.
- It holds a title and a description.
+ This class is a description of a QuestItem (@ref orxonox::Quest "Quest" and @ref orxonox::QuestHint "QuestHint").
+ It holds a title and a description. For quests also messages that are sent, when failing or completing the quest can be added.
Creating a QuestDescription through XML goes as follows:
-
@code
<QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
@endcode
Modified: code/trunk/src/modules/questsystem/QuestEffect.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffect.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestEffect.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestEffect.cc
@brief Implementation of the QuestEffect class.
*/
@@ -63,7 +63,7 @@
@param effects
A list of all the QuestEffects to be invoked.
@return
- Returns false if there was an error, view console of log for further detail.
+ Returns false if there was an error, view console or log for further details.
*/
/*static*/ bool QuestEffect::invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects)
{
@@ -72,9 +72,8 @@
COUT(4) << "Invoking QuestEffects on player: " << player << " ." << std::endl;
for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
- {
check = check && (*effect)->invoke(player);
- }
+
return check;
}
Modified: code/trunk/src/modules/questsystem/QuestEffect.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffect.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestEffect.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestEffect.h
@brief Definition of the QuestEffect class.
+ @ingroup Questsystem
*/
#ifndef _QuestEffect_H__
@@ -43,8 +44,8 @@
{
/**
@brief
- Handles QuestEffects for Quests.
- QuestEffects are the only way for Quests to have any sideeffects in the game world. They are also the only way for a player to gain, complete or fail Quests.
+ Handles QuestEffects for @ref orxonox::Quest "Quests".
+ QuestEffects are one of the ways for @ref orxonox::Quest "Quests" to have any side effects on the game world and for the game world to influence the @ref orxonox::Quest "Quests".
@author
Damian 'Mozork' Frick
*/
@@ -57,7 +58,6 @@
virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.
static bool invokeEffects(PlayerInfo* player, std::list<QuestEffect*> & effects); //!< Invokes all QuestEffects in the list.
-
};
}
Modified: code/trunk/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffectBeacon.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestEffectBeacon.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestEffectBeacon.cc
@brief Implementation of the QuestEffectBeacon class.
*/
@@ -36,8 +36,10 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "core/EventIncludes.h"
-#include "worldentities/pawns/Pawn.h"
+
#include "interfaces/PlayerTrigger.h"
+#include "worldentities/pawns/Pawn.h"
+
#include "objects/triggers/MultiTriggerContainer.h"
#include "QuestEffect.h"
@@ -49,6 +51,7 @@
@brief
Constructor. Registers the object and initializes defaults.
*/
+ //TODO: Make just BaseObject?
QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : StaticEntity(creator)
{
RegisterObject(QuestEffectBeacon);
@@ -98,13 +101,14 @@
@return
Returns true if successfully executed, false if not.
*/
+ //TODO: Eliminate MultiTriggerContainer stuff, since they are now PlayerTriggers as well.
bool QuestEffectBeacon::execute(bool bTriggered, BaseObject* trigger)
{
if(!bTriggered)
{
return false;
}
- if(!(this->isActive())) //!< If the QuestEffectBeacon is inactive it cannot be executed.
+ if(!(this->isActive())) // If the QuestEffectBeacon is inactive it cannot be executed.
{
COUT(4) << "The QuestEffectBeacon is inactive." << std::endl;
return false;
@@ -114,14 +118,14 @@
MultiTriggerContainer* mTrigger = orxonox_cast<MultiTriggerContainer*>(trigger);
Pawn* pawn = NULL;
- //! If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it.
+ // If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it.
if(pTrigger == NULL && mTrigger == NULL)
return false;
// If the trigger is a PlayerTrigger.
if(pTrigger != NULL)
{
- if(!pTrigger->isForPlayer()) //!< The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
+ if(!pTrigger->isForPlayer()) // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
return false;
else
pawn = pTrigger->getTriggeringPlayer();
@@ -139,7 +143,7 @@
return false;
}
- //! Extract the PlayerInfo from the Pawn.
+ // Extract the PlayerInfo from the Pawn.
PlayerInfo* player = pawn->getPlayer();
if(player == NULL)
@@ -150,10 +154,10 @@
COUT(4) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
- bool check = QuestEffect::invokeEffects(player, this->effects_); //!< Invoke the QuestEffects on the PlayerInfo.
+ bool check = QuestEffect::invokeEffects(player, this->effects_); // Invoke the QuestEffects on the PlayerInfo.
if(check)
{
- this->decrementTimes(); //!< Decrement the number of times the beacon can be used.
+ this->decrementTimes(); // Decrement the number of times the beacon can be used.
return true;
}
@@ -170,15 +174,13 @@
*/
bool QuestEffectBeacon::setActive(bool activate)
{
- if(this->getTimes() == 0 && activate) //!< A QuestEffectBeacon that can be executed only 0 times is always inactive.
- {
+ if(this->getTimes() == 0 && activate) // A QuestEffectBeacon that can be executed only 0 times is always inactive.
return false;
- }
if(activate)
{
- this->status_ = QuestEffectBeaconStatus::Active;
- return true;
+ this->status_ = QuestEffectBeaconStatus::Active;
+ return true;
}
this->status_ = QuestEffectBeaconStatus::Inactive;
@@ -193,20 +195,15 @@
*/
bool QuestEffectBeacon::decrementTimes(void)
{
- if(!(this->isActive())) //!< The QuestEffectBeacon mus be active to decrement the number of times it can be executed.
- {
+ if(!(this->isActive())) // The QuestEffectBeacon mus be active to decrement the number of times it can be executed.
return false;
- }
- if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
- {
+
+ if(this->getTimes() == INFINITE_TIME) // If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
return true;
- }
- this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed.
- if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
- {
+ this->times_ = this->times_ - 1; // Decrement number of times the QuestEffectBeacon can be executed.
+ if(this->getTimes() == 0) // Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
this->status_ = QuestEffectBeaconStatus::Inactive;
- }
return true;
}
@@ -224,9 +221,7 @@
bool QuestEffectBeacon::setTimes(const int & n)
{
if(n < 0 && n != INFINITE_TIME)
- {
return false;
- }
this->times_ = n;
return true;
@@ -242,7 +237,8 @@
*/
bool QuestEffectBeacon::addEffect(QuestEffect* effect)
{
- if(effect == NULL) //!< NULL-pointers are not well liked here...
+ //TODO: Replace with assert.
+ if(effect == NULL) // NULL-pointers are not well liked here...
{
COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
return false;
@@ -268,9 +264,8 @@
for (std::list<QuestEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
{
if(i == 0)
- {
return *effect;
- }
+
i--;
}
return NULL;
Modified: code/trunk/src/modules/questsystem/QuestEffectBeacon.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestEffectBeacon.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestEffectBeacon.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestEffectBeacon.h
@brief Definition of the QuestEffectBeacon class.
+ @ingroup Questsystem
*/
#ifndef _QuestEffectBeacon_H__
@@ -43,7 +44,7 @@
{
namespace QuestEffectBeaconStatus
{
- //! The status of the beacon, can be either active or inactive.
+ //! The status of the @ref orxonox::QuestEffectBeacon "QuestEffectBeacon", can be either active or inactive.
enum Value
{
Inactive,
@@ -53,13 +54,12 @@
/**
@brief
- A QuestEffectBeacon is a physical entity in the game which can (under some condition(s)) invoke a number QuestEffects on players meeting the condition(s).
- The conditions under which the QuestEffects are invoked on the player are defined by Triggers.
+ A QuestEffectBeacon is a physical entity in the game which can (under some condition(s)) invoke a number of @ref orxonox::QuestEffect "QuestEffects" on players meeting the condition(s).
+ The conditions under which the @ref orxonox::QuestEffect "QuestEffects" are invoked on the player are defined by @ref orxonox::Trigger "Triggers" (or really any kind of entity firing events, e.g. @ref oroxnox::EventListener "EventListeners"). The trigger the event originates from, however has to be a @ref orxonox::PlayerTrigger PlayerTrigger.
A QuestEffectBeacon can be executed a defined number of times.
- A QuestEffectBeacon can be inactive or active.
+ A QuestEffectBeacon can be inactive or active. While inactive it can't be executed.
Creating a QuestEffectBeacon through XML goes as follows:
-
@code
<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.
<effects>
Modified: code/trunk/src/modules/questsystem/QuestHint.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestHint.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestHint.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestHint.cc
@brief Implementation of the QuestHint class.
*/
@@ -35,9 +35,10 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
+#include "Quest.h"
+#include "QuestDescription.h"
#include "QuestManager.h"
-#include "QuestDescription.h"
-#include "Quest.h"
namespace orxonox
{
@@ -70,7 +71,7 @@
{
SUPER(QuestHint, XMLPort, xmlelement, mode);
- QuestManager::getInstance().registerHint(this); //!< Registers the QuestHint with the QuestManager.
+ QuestManager::getInstance().registerHint(this); // Registers the QuestHint with the QuestManager.
COUT(4) << "New QuestHint {" << this->getId() << "} created." << std::endl;
}
@@ -88,18 +89,17 @@
*/
bool QuestHint::isActive(const PlayerInfo* player) const
{
- if(player == NULL) //!< NULL-Pointers are ugly!
+ //TODO: Replace with asser.
+ if(player == NULL) // NULL-Pointers are ugly!
{
ThrowException(Argument, "The input PlayerInfo* is NULL.");
return false;
}
- //! Find the player.
+ // Find the player.
std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player);
- if (it != this->playerStatus_.end()) //!< If the player is in the map.
- {
+ if (it != this->playerStatus_.end()) // If the player is in the map.
return it->second;
- }
return QuestStatus::Inactive;
}
@@ -114,9 +114,9 @@
*/
bool QuestHint::setActive(PlayerInfo* player)
{
- if(this->quest_->isActive(player)) //!< For a hint to get activated the quest must be active.
+ if(this->quest_->isActive(player)) // For a hint to get activated the quest must be active.
{
- if(!(this->isActive(player))) //!< If the hint is already active, activation is pointless.
+ if(!(this->isActive(player))) // If the hint is already active, activation is pointless.
{
this->playerStatus_[player] = QuestHintStatus::Active;
@@ -144,7 +144,8 @@
*/
bool QuestHint::setQuest(Quest* quest)
{
- if(quest == NULL) //!< NULL-Pointer. Again..?
+ //TODO: Replace with assert.
+ if(quest == NULL) // NULL-Pointer. Again..?
{
COUT(2) << "The input Quest* is NULL." << std::endl;
return false;
Modified: code/trunk/src/modules/questsystem/QuestHint.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestHint.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestHint.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestHint.h
@brief Definition of the QuestHint class.
+ @ingroup Questsystem
*/
#ifndef _QuestHint_H__
@@ -41,9 +42,10 @@
namespace orxonox // tolua_export
{ // tolua_export
+
namespace QuestHintStatus
{
- //! The state of the hint.
+ //! The state of the @ref orxonox::QuestHint "QuestHint".
enum Value
{
Inactive,
@@ -53,12 +55,11 @@
/**
@brief
- Represents a hint in the game towards completing a Quest.
- Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
+ Represents a hint in the game that gives aid towards completing a @ref orxonox::Quest "Quest".
+ Consists of title and description (which is stored in a @ref orxonox::QuestDescription "QuestDescription" object) in textual form and must belong to a quest.
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.
Creating a QuestHint through XML goes as follows:
-
@code
<QuestHint id="hintId">
<QuestDesctription title="" description="" />
Modified: code/trunk/src/modules/questsystem/QuestItem.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestItem.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestItem.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestItem.cc
@brief Implementation of the QuestItem class.
*/
@@ -35,6 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "QuestDescription.h"
namespace orxonox
@@ -85,7 +86,7 @@
*/
void QuestItem::setId(const std::string & id)
{
- if(id.compare(BLANKSTRING) == 0) //!< Checks whether the id is a valid id.
+ if(id.compare(BLANKSTRING) == 0) // Checks whether the id is a valid id.
{
COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
return;
Modified: code/trunk/src/modules/questsystem/QuestItem.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestItem.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestItem.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,9 +27,10 @@
*/
/**
- @file
+ @file QuestItem.h
@brief Definition of the QuestItem class.
- The QuestItem is the parent class of Quest and QuestHint.
+ The @ref orxonox::QuestItem "QuestItem" is the parent class of @ref orxonox::Quest "Quest" and @ref orxonox::QuestHint "QuestHint".
+ @ingroup Questsystem
*/
@@ -46,8 +47,8 @@
{
/**
@brief
- Functions as a base class for quest classes such as Quest or QuestHint.
- Has a unique identifier and a description.
+ Functions as a base class for quest classes such as @ref orxonox::Quest "Quest" or @ref orxonox::QuestHint "QuestHint".
+ Has a unique identifier and a @ref orxonox::QuestDescription "QuestDescription".
@author
Damian 'Mozork' Frick
*/
Modified: code/trunk/src/modules/questsystem/QuestListener.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestListener.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestListener.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file QuestListener.cc
@brief Implementation of the QuestListener class.
*/
@@ -35,6 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "Quest.h"
#include "QuestManager.h"
@@ -42,6 +43,12 @@
{
CreateFactory(QuestListener);
+ //! Initialization of the static variables for the modes as strings.
+ /*static*/ const std::string QuestListener::ALL = "all";
+ /*static*/ const std::string QuestListener::START = "start";
+ /*static*/ const std::string QuestListener::FAIL = "fail";
+ /*static*/ const std::string QuestListener::COMPLETE = "complete";
+
/**
@brief
Constructor. Registers the object and initializes variables.
@@ -74,7 +81,7 @@
XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode);
if(this->quest_ != NULL)
- this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
+ this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners.
COUT(4) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
}
@@ -89,13 +96,11 @@
*/
/* static */ void QuestListener::advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status)
{
- for (std::list<QuestListener*>::iterator it = listeners.begin(); it != listeners.end(); ++it) //!< Iterate through all QuestListeners
+ for (std::list<QuestListener*>::iterator it = listeners.begin(); it != listeners.end(); ++it) // Iterate through all QuestListeners
{
QuestListener* listener = *it;
- if(listener->getMode() == status || listener->getMode() == "all") //!< Check whether the status change affects the give QuestListener.
- {
+ if(listener->getMode() == status || listener->getMode() == QuestListener::ALL) // Check whether the status change affects the give QuestListener.
listener->execute();
- }
}
}
@@ -109,9 +114,9 @@
*/
bool QuestListener::setQuestId(const std::string & id)
{
- this->quest_ = QuestManager::getInstance().findQuest(id); //!< Find the Quest corresponding to the given questId.
+ this->quest_ = QuestManager::getInstance().findQuest(id); // Find the Quest corresponding to the given questId.
- if(this->quest_ == NULL) //!< If there is no such Quest.
+ if(this->quest_ == NULL) // If there is no such Quest.
{
ThrowException(Argument, "This is bad! The QuestListener has not found a Quest with a corresponding id..");
return false;
@@ -130,27 +135,19 @@
*/
bool QuestListener::setMode(const std::string & mode)
{
- if(mode == "all")
- {
+ if(mode == QuestListener::ALL)
this->mode_ = QuestListenerMode::All;
- }
- else if(mode == "start")
- {
+ else if(mode == QuestListener::START)
this->mode_ = QuestListenerMode::Start;
- }
- else if(mode == "fail")
- {
+ else if(mode == QuestListener::FAIL)
this->mode_ = QuestListenerMode::Fail;
- }
- else if(mode == "complete")
- {
+ else if(mode == QuestListener::COMPLETE)
this->mode_ = QuestListenerMode::Complete;
- }
else
{
COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl;
- this->mode_ = QuestListenerMode::All;
- return false;
+ this->mode_ = QuestListenerMode::All;
+ return false;
}
return true;
@@ -160,31 +157,23 @@
@brief
Get the mode of the QuestListener.
@return
- Return the mode of the QuestListener. Can be eighter 'all', 'start', 'fail' or 'complete'.
+ Return the mode of the QuestListener. Can be either 'all', 'start', 'fail' or 'complete'.
*/
std::string QuestListener::getMode(void)
{
- if(this->mode_ == QuestListenerMode::All)
+ switch(this->mode_)
{
- return "all";
+ case QuestListenerMode::All:
+ return QuestListener::ALL;
+ case QuestListenerMode::Start:
+ return QuestListener::START;
+ case QuestListenerMode::Fail:
+ return QuestListener::FAIL;
+ case QuestListenerMode::Complete:
+ return QuestListener::COMPLETE;
+ default: // This will never happen.
+ return QuestListener::ALL;
}
- else if(this->mode_ == QuestListenerMode::Start)
- {
- return "start";
- }
- else if(this->mode_ == QuestListenerMode::Fail)
- {
- return "fail";
- }
- else if(this->mode_ == QuestListenerMode::Complete)
- {
- return "complete";
- }
- else
- {
- COUT(1) << "An unforseen, never to happen, Error has occurred. This is impossible!" << std::endl;
- return "";
- }
}
/**
Modified: code/trunk/src/modules/questsystem/QuestListener.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestListener.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestListener.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestListener.h
@brief Definition of the QuestListener class.
+ @ingroup Questsystem
*/
#ifndef _QuestListener_H__
@@ -44,7 +45,7 @@
{
namespace QuestListenerMode
{
- //! The mode of the QuestListener.
+ //! The mode of the @ref orxonox::QuestListener "QuestListener".
enum Value
{
All,
@@ -56,11 +57,9 @@
/**
@brief
- Provides a way to react to the starting, completing and failing of Quests.
+ Provides a way to react to the starting, completing and failing of @ref orxonox::Quest "Quests".
The XML representation goes as follows:
- 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.
-
@code
<BaseObject> // The object that should react to the status change of a Quest.
<events>
@@ -70,31 +69,40 @@
</events>
</BaseObject>
@endcode
+
+ You can use the QuestListener as if it were a @ref orxonox::Trigger "Trigger" or @ref orxonox::EventListener "EventListener", that fires an Event when the status (depending on the set mode) of the given @ref orxonox::Quest "Quest" changes.
@author
Damian 'Mozork' Frick
*/
class _QuestsystemExport QuestListener : public BaseObject
{
- public:
- QuestListener(BaseObject* creator);
- virtual ~QuestListener();
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
+ public:
+ QuestListener(BaseObject* creator);
+ virtual ~QuestListener();
- 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.
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
- bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
- bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
+ 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.
- std::string getMode(void); //!< Get the mode of the QuestListener.
+ bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
+ bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
- const std::string & getQuestId(void);
- bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
+ std::string getMode(void); //!< Get the mode of the QuestListener.
- private:
- QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
- Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
+ const std::string & getQuestId(void);
+ bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
+ private:
+ QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
+ Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
+
+ //! Static variables for the modes as strings.
+ static const std::string ALL;
+ static const std::string START;
+ static const std::string FAIL;
+ static const std::string COMPLETE;
+
};
}
Modified: code/trunk/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestManager.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,28 +27,27 @@
*/
/**
- @file
+ @file QuestManager.cc
@brief Implementation of the QuestManager class.
*/
#include "QuestManager.h"
-#include <CEGUIWindow.h>
-
#include "util/Exception.h"
#include "util/ScopedSingletonManager.h"
+#include "core/command/ConsoleCommand.h"
#include "core/CoreIncludes.h"
#include "core/GUIManager.h"
#include "core/LuaState.h"
-#include "core/command/ConsoleCommand.h"
+
#include "infos/PlayerInfo.h"
-#include "overlays/GUIOverlay.h"
-#include "ToluaBindQuestsystem.h"
#include "Quest.h"
#include "QuestHint.h"
#include "QuestItem.h"
+#include "ToluaBindQuestsystem.h"
+
namespace orxonox
{
// Register tolua_open function when loading the library
@@ -65,6 +64,8 @@
QuestManager::QuestManager()
{
RegisterRootObject(QuestManager);
+
+ COUT(3) << "QuestManager created." << std::endl;
}
/**
@@ -73,7 +74,7 @@
*/
QuestManager::~QuestManager()
{
-
+ COUT(3) << "QuestManager destroyed." << std::endl;
}
/**
@@ -98,16 +99,17 @@
*/
bool QuestManager::registerQuest(Quest* quest)
{
- if(quest == NULL) //!< Doh! Just as if there were actual quests behind NULL-pointers.
+ //TODO: Replace with assert.
+ if(quest == NULL) // Doh! Just as if there were actual quests behind NULL-pointers.
{
COUT(2) << "Registration of Quest in QuestManager failed, because inserted Quest-pointer was NULL." << std::endl;
return false;
}
std::pair<std::map<std::string, Quest*>::iterator,bool> result;
- result = this->questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the Quest.
+ result = this->questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); // Inserting the Quest.
- if(result.second) //!< If inserting was a success.
+ if(result.second) // If inserting was a success.
{
quest->setRegistered();
COUT(4) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
@@ -140,16 +142,17 @@
*/
bool QuestManager::registerHint(QuestHint* hint)
{
- if(hint == NULL) //!< Still not liking NULL-pointers.
+ //TODO: Replace with assert.
+ if(hint == NULL) // Still not liking NULL-pointers.
{
COUT(2) << "Registration of QuestHint in QuestManager failed, because inserted QuestHint-pointer was NULL." << std::endl;
return false;
}
std::pair<std::map<std::string, QuestHint*>::iterator,bool> result;
- result = this->hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the QuestHSint.
+ result = this->hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); // Inserting the QuestHSint.
- if(result.second) //!< If inserting was a success.
+ if(result.second) // If inserting was a success.
{
hint->setRegistered();
COUT(4) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
@@ -184,17 +187,13 @@
*/
Quest* QuestManager::findQuest(const std::string & questId)
{
- if(questId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
- {
+ if(questId.compare(BLANKSTRING) == 1) // Check vor validity of the given id.
ThrowException(Argument, "Invalid questId.");
- }
Quest* quest;
std::map<std::string, Quest*>::iterator it = this->questMap_.find(questId);
- if (it != this->questMap_.end()) //!< If the Quest is registered.
- {
+ if (it != this->questMap_.end()) // If the Quest is registered.
quest = it->second;
- }
else
{
quest = NULL;
@@ -202,7 +201,6 @@
}
return quest;
-
}
/**
@@ -218,17 +216,13 @@
*/
QuestHint* QuestManager::findHint(const std::string & hintId)
{
- if(hintId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
- {
+ if(hintId.compare(BLANKSTRING) == 1) // Check vor validity of the given id.
ThrowException(Argument, "Invalid hintId.");
- }
QuestHint* hint;
std::map<std::string, QuestHint*>::iterator it = this->hintMap_.find(hintId);
- if (it != this->hintMap_.end()) //!< If the QuestHint is registered.
- {
+ if (it != this->hintMap_.end()) // If the QuestHint is registered.
hint = it->second;
- }
else
{
hint = NULL;
@@ -236,10 +230,17 @@
}
return hint;
-
}
- int QuestManager::getNumParentQuests(PlayerInfo* player)
+ /**
+ @brief
+ Get the number of Quests the input player has, that are root quests.
+ @param player
+ The player.
+ @return
+ Returns the number of Quests the input player has, that are root quests.
+ */
+ int QuestManager::getNumRootQuests(PlayerInfo* player)
{
int numQuests = 0;
for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
@@ -250,7 +251,17 @@
return numQuests;
}
- Quest* QuestManager::getParentQuest(PlayerInfo* player, int index)
+ /**
+ @brief
+ Get the index-th root quest of the input player.
+ @param player
+ The player.
+ @param index
+ The index of the root quest.
+ @return
+ Returns the index-th root quest of the input player.
+ */
+ Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
{
for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
{
@@ -260,6 +271,16 @@
return NULL;
}
+ /**
+ @brief
+ Get the number of sub-quest of an input Quest for the input player.
+ @param quest
+ The quest to get the sub-quests of.
+ @param player
+ The player.
+ @return
+ Returns the number of sub-quest of an input Quest for the input player.
+ */
int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
{
std::list<Quest*> quests = quest->getSubQuestList();
@@ -272,6 +293,16 @@
return numQuests;
}
+ /**
+ @brief
+ Get the index-th sub-quest of the input Quest for the input player.
+ @param quest
+ The Quest to get the sub-quest of.
+ @param player
+ The player.
+ @param index
+ The index of the sub-quest.
+ */
Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
{
std::list<Quest*> quests = quest->getSubQuestList();
@@ -283,6 +314,15 @@
return NULL;
}
+ /**
+ @brief
+ Get the number of QuestHints of the input Quest for the input player.
+ @param quest
+ The quest to get the hints of.
+ @param player
+ The player.
+ @return Returns the number of QuestHints of the input Quest for the input player.
+ */
int QuestManager::getNumHints(Quest* quest, PlayerInfo* player)
{
std::list<QuestHint*> hints = quest->getHintsList();
@@ -295,6 +335,16 @@
return numHints;
}
+ /**
+ @brief
+ Get the index-th QuestHint of the input Quest for the input player.
+ @param quest
+ The Quest to get the QuestHint of.
+ @param player
+ The player.
+ @param index
+ The index of the QuestHint.
+ */
QuestHint* QuestManager::getHints(Quest* quest, PlayerInfo* player, int index)
{
std::list<QuestHint*> hints = quest->getHintsList();
@@ -306,11 +356,27 @@
return NULL;
}
+ /**
+ @brief
+ Get the QuestDescription of the input Quest.
+ @param item
+ The Quest to get the QuestDescription of.
+ @return
+ Return a pointer ot the QuestDescription of the input Quest.
+ */
QuestDescription* QuestManager::getDescription(Quest* item)
{
return item->getDescription();
}
+ /**
+ @brief
+ Get the QuestDescription of the input QuestHint.
+ @param item
+ The QuestHint to get the QuestDescription of.
+ @return
+ Returns a pointer to the QuestDescription of the input QuestHint.
+ */
QuestDescription* QuestManager::getDescription(QuestHint* item)
{
return item->getDescription();
Modified: code/trunk/src/modules/questsystem/QuestManager.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestManager.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file QuestManager.h
@brief Definition of the QuestManager class.
+ @ingroup Questsystem
*/
#ifndef _QuestManager_H__
@@ -43,18 +44,16 @@
#include "util/Singleton.h"
#include "core/OrxonoxClass.h"
-// tolua_begin
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
/**
@brief
- Is a Singleton and manages Quests, by registering every Quest/QuestHint (through registerX()) and making them globally accessible (through findX()).
- Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way.
+ Is a Singleton and manages @ref orxonox::Quest "Quests", by registering every @ref orxonox::Quest "Quest" / @ref orxonox::QuestHint "QuestHint" (through registerX()) and making them globally accessible (through findX()).
+ @ref orxonox::Quest "Quests" (and @ref orxonox::QuestHint 2) are registered in the QuestManager with their id, and can be accessed in the same way.
@author
Damian 'Mozork' Frick
*/
- class _QuestsystemExport QuestManager
-// tolua_end
+ class _QuestsystemExport QuestManager // tolua_export
: public Singleton<QuestManager>, public orxonox::OrxonoxClass
{ // tolua_export
@@ -64,18 +63,18 @@
QuestManager();
virtual ~QuestManager();
- //! Returns a reference to the single instance of the Quest Manager.
+ //! Returns a reference to the single instance of the QuestManager.
static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
// tolua_begin
- int getNumParentQuests(orxonox::PlayerInfo* player);
- Quest* getParentQuest(orxonox::PlayerInfo* player, int index);
+ int getNumRootQuests(orxonox::PlayerInfo* player); //!< Get the number of Quests the input player has, that are root quests.
+ Quest* getRootQuest(orxonox::PlayerInfo* player, int index); //!< Get the index-th root quest of the input player.
- int getNumSubQuests(Quest* quest, orxonox::PlayerInfo* player);
- Quest* getSubQuest(Quest* quest, orxonox::PlayerInfo* player, int index);
+ int getNumSubQuests(Quest* quest, orxonox::PlayerInfo* player); //!< Get the number of sub-quest of an input Quest for an input player.
+ Quest* getSubQuest(Quest* quest, orxonox::PlayerInfo* player, int index); //!< Get the index-th sub-quest of the input Quest for the input player.
- int getNumHints(Quest* quest, orxonox::PlayerInfo* player);
- QuestHint* getHints(Quest* quest, orxonox::PlayerInfo* player, int index);
+ int getNumHints(Quest* quest, orxonox::PlayerInfo* player); //!< Get the number of QuestHints of the input Quest for the input player.
+ QuestHint* getHints(Quest* quest, orxonox::PlayerInfo* player, int index); //!< Get the index-th QuestHint of the input Quest for the input player.
QuestDescription* getDescription(Quest* item);
QuestDescription* getDescription(QuestHint* item);
Modified: code/trunk/src/modules/questsystem/QuestNotification.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestNotification.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestNotification.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -26,6 +26,11 @@
*
*/
+/**
+ @file QuestNotification.cc
+ @brief Implementation of the QuestNotification class.
+*/
+
#include "QuestNotification.h"
#include "core/CoreIncludes.h"
#include "infos/PlayerInfo.h"
Modified: code/trunk/src/modules/questsystem/QuestNotification.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestNotification.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/QuestNotification.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -26,6 +26,12 @@
*
*/
+/**
+ @file QuestNotification.h
+ @brief Definition of the QuestNotification class.
+ @ingroup Questsystem
+*/
+
#ifndef _QuestNotification_H__
#define _QuestNotification_H__
Modified: code/trunk/src/modules/questsystem/effects/AddQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddQuest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddQuest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,16 +27,18 @@
*/
/**
- @file
+ @file AddQuest.cc
@brief Implementation of the AddQuest class.
*/
#include "AddQuest.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
#include "util/Exception.h"
-#include "core/CoreIncludes.h"
+
+#include "questsystem/Quest.h"
#include "questsystem/QuestManager.h"
-#include "questsystem/Quest.h"
namespace orxonox
{
@@ -80,7 +82,8 @@
*/
bool AddQuest::invoke(PlayerInfo* player)
{
- if(player == NULL) //!< Null-pointers are badass.
+ //TODO: Replace with assert?
+ if(player == NULL) // Null-pointers are badass.
{
COUT(2) << "Input player is NULL." << std::endl;
return false;
@@ -92,9 +95,7 @@
{
Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId());
if(quest == NULL || !quest->start(player))
- {
return false;
- }
}
catch(const orxonox::Exception& ex)
{
Modified: code/trunk/src/modules/questsystem/effects/AddQuest.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddQuest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddQuest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file AddQuest.h
@brief Definition of the AddQuest class.
+ @ingroup QuestEffects
*/
#ifndef _AddQuest_H__
@@ -41,10 +42,9 @@
{
/**
@brief
- Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.
+ Adds a @ref orxonox::Quest "Quest", resp. changes the @ref orxonox::Quest "Quests" status to active for the player invoking the @ref orxonox::Quest "Quest".
- Creating a AddQuest through XML goes as follows:
-
+ Creating an AddQuest through XML goes as follows:
@code
<AddQuest questId="id" /> //Where id identifies the Quest that should be added.
@endcode
Modified: code/trunk/src/modules/questsystem/effects/AddQuestHint.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddQuestHint.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddQuestHint.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,18 +27,19 @@
*/
/**
- @file
+ @file AddQuestHint.cc
@brief Implementation of the AddQuestHint class.
*/
#include "AddQuestHint.h"
-#include "util/Exception.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+#include "util/Exception.h"
+
+#include "questsystem/QuestHint.h"
#include "questsystem/QuestManager.h"
#include "questsystem/QuestItem.h"
-#include "questsystem/QuestHint.h"
namespace orxonox
{
@@ -104,7 +105,8 @@
*/
bool AddQuestHint::invoke(PlayerInfo* player)
{
- if(player == NULL) //!< NULL-pointers are evil!
+ //TODO: Replace with assert?
+ if(player == NULL) // NULL-pointers are evil!
{
COUT(2) << "The input player is NULL." << std::endl;
return false;
@@ -116,9 +118,7 @@
{
QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_);
if(hint == NULL || !hint->setActive(player))
- {
return false;
- }
}
catch(const Exception& e)
{
Modified: code/trunk/src/modules/questsystem/effects/AddQuestHint.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddQuestHint.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddQuestHint.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file AddQuestHint.h
@brief Definition of the AddQuestHint class.
+ @ingroup QuestEffects
*/
#ifndef _AddQuestHint_H__
@@ -43,10 +44,9 @@
{
/**
@brief
- Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on.
+ Adds a @ref orxonox::QuestHint "QuestHint", resp. activates the @ref orxonox::QuestHint "QuestHint" of the given id for the player the QuestEffect is invoked on.
Creating a AddQuestHint through XML goes as follows:
-
@code
<AddQuestHint hintId="id" /> //Where id identifies the QuestHint that should be added.
@endcode
Modified: code/trunk/src/modules/questsystem/effects/AddReward.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddReward.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddReward.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file AddReward.cc
@brief Implementation of the AddReward class.
*/
@@ -35,6 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "interfaces/Rewardable.h"
namespace orxonox
@@ -56,6 +57,7 @@
*/
AddReward::~AddReward()
{
+
}
/**
@@ -84,9 +86,7 @@
for (std::list<Rewardable*>::const_iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward)
{
if(i == 0)
- {
return *reward;
- }
i--;
}
return NULL;
@@ -106,9 +106,7 @@
bool check = true;
for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
- {
check = check && (*reward)->reward(player);
- }
COUT(4) << "Rewardable successfully added to player." << player << " ." << std::endl;
Modified: code/trunk/src/modules/questsystem/effects/AddReward.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/AddReward.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/AddReward.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file AddReward.h
@brief Definition of the AddReward class.
+ @ingroup QuestEffects
*/
#ifndef _AddReward_H__
@@ -43,10 +44,9 @@
{
/**
@brief
- Adds a list of Rewardables to a player.
+ Adds a list of @ref orxonox::Rewardable "Rewardables" to a player.
Creating a AddReward through XML goes as follows:
-
@code
<AddReward>
<Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations.
Modified: code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,14 +27,16 @@
*/
/**
- @file
+ @file ChangeQuestStatus.cc
@brief Implementation of the ChangeQuestStatus class.
+ @ingroup QuestEffects
*/
#include "ChangeQuestStatus.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
#include "questsystem/QuestItem.h"
namespace orxonox
@@ -54,6 +56,7 @@
*/
ChangeQuestStatus::~ChangeQuestStatus()
{
+
}
/**
Modified: code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file ChangeQuestStatus.h
@brief Definition of the ChangeQuestStatus class.
+ @ingroup QuestEffects
*/
#ifndef _ChangeQuestStatus_H__
@@ -43,7 +44,7 @@
{
/**
@brief
- A QuestEffect which changes the status of a specified Quest for the player invoking the QuestEffect.
+ A QuestEffect which changes the status of a specified @ref orxonox::Quest "Quest" for the player invoking the QuestEffect.
@author
Damian 'Mozork' Frick
*/
Modified: code/trunk/src/modules/questsystem/effects/CompleteQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/CompleteQuest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/CompleteQuest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file CompleteQuest.cc
@brief Implementation of the CompleteQuest class.
*/
@@ -35,8 +35,9 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
+#include "questsystem/Quest.h"
#include "questsystem/QuestManager.h"
-#include "questsystem/Quest.h"
namespace orxonox
{
@@ -57,6 +58,7 @@
*/
CompleteQuest::~CompleteQuest()
{
+
}
/**
@@ -80,7 +82,8 @@
*/
bool CompleteQuest::invoke(PlayerInfo* player)
{
- if(player == NULL) //!< You know, what we think of NULL-pointers...
+ //TODO: Replace with assert?
+ if(player == NULL) // You know, what we think of NULL-pointers...
{
COUT(2) << "Input player is NULL." << std::endl;
return false;
@@ -94,9 +97,7 @@
{
quest = QuestManager::getInstance().findQuest(this->getQuestId());
if(quest == NULL || !quest->complete(player))
- {
return false;
- }
}
catch(const Exception& e)
{
Modified: code/trunk/src/modules/questsystem/effects/CompleteQuest.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/CompleteQuest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/CompleteQuest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file CompleteQuest.h
@brief Definition of the CompleteQuest class.
+ @ingroup QuestEffects
*/
#ifndef _CompleteQuest_H__
@@ -41,10 +42,9 @@
{
/**
@brief
- Completes a Quest (with a specified id) for the player invoking the QuestEffect.
+ Completes a @ref orxonox::Quest "Quest" (with a specified id) for the player invoking the QuestEffect.
Creating a CompleteQuest through XML goes as follows:
-
@code
<CompleteQuest questId="id" /> //Where id identifies the Quest that should be completed.
@endcode
Modified: code/trunk/src/modules/questsystem/effects/FailQuest.cc
===================================================================
--- code/trunk/src/modules/questsystem/effects/FailQuest.cc 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/FailQuest.cc 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,7 +27,7 @@
*/
/**
- @file
+ @file FailQuest.cc
@brief Implementation of the FailQuest class.
*/
@@ -35,8 +35,9 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+
+#include "questsystem/Quest.h"
#include "questsystem/QuestManager.h"
-#include "questsystem/Quest.h"
namespace orxonox
{
@@ -57,6 +58,7 @@
*/
FailQuest::~FailQuest()
{
+
}
/**
@@ -67,7 +69,7 @@
{
SUPER(FailQuest, XMLPort, xmlelement, mode);
- COUT(4) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
+ COUT(4) << "New FailQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
}
/**
@@ -80,7 +82,8 @@
*/
bool FailQuest::invoke(PlayerInfo* player)
{
- if(player == NULL) //!< We don't know what to do with no player.
+ //TODO: Replace with assert?
+ if(player == NULL) // We don't know what to do with no player.
{
COUT(2) << "Input player is NULL." << std::endl;
return false;
@@ -93,9 +96,7 @@
{
quest = QuestManager::getInstance().findQuest(this->getQuestId());
if(quest == NULL || !quest->fail(player))
- {
return false;
- }
}
catch(const Exception& e)
{
Modified: code/trunk/src/modules/questsystem/effects/FailQuest.h
===================================================================
--- code/trunk/src/modules/questsystem/effects/FailQuest.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/modules/questsystem/effects/FailQuest.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -27,8 +27,9 @@
*/
/**
- @file
+ @file FailQuest.h
@brief Definition of the FailQuest class.
+ @ingroup QuestEffects
*/
#ifndef _FailQuest_H__
@@ -41,10 +42,9 @@
{
/**
@brief
- Fails a quest (with a specified id) for the player invoking the QuestEffect.
+ Fails a @ref orxonox::Quest "Quest" (with a specified id) for the player invoking the QuestEffect.
Creating a FailQuest through XML goes as follows:
-
@code
<FailQuest questId="id" /> //Where id identifies the Quest that should be failed.
@endcode
Modified: code/trunk/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupCarrier.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/orxonox/interfaces/PickupCarrier.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupCarrier.h
@brief Definition of the PickupCarrier class.
+ @ingroup Pickup
*/
#ifndef _PickupCarrier_H__
Modified: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file Pickupable.h
@brief Definition of the Pickupable class.
+ @ingroup Pickup
*/
#ifndef _Pickupable_H__
Modified: code/trunk/src/orxonox/pickup/PickupIdentifier.h
===================================================================
--- code/trunk/src/orxonox/pickup/PickupIdentifier.h 2010-09-15 16:14:37 UTC (rev 7455)
+++ code/trunk/src/orxonox/pickup/PickupIdentifier.h 2010-09-15 17:29:16 UTC (rev 7456)
@@ -29,6 +29,7 @@
/**
@file PickupIdentifier.h
@brief Definition of the PickupIdentifier class.
+ @ingroup Pickup
*/
#ifndef _PickupIdentifier_H__
More information about the Orxonox-commit
mailing list