#include <src/orxonox/objects/quest/AddReward.h>
Public Member Functions | |
AddReward (BaseObject *creator) | |
Constructor. Registers the object. | |
virtual bool | invoke (PlayerInfo *player) |
Invokes the QuestEffect. | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
Method for creating a AddReward object through XML. | |
virtual | ~AddReward () |
Destructor. | |
Private Member Functions | |
void | addRewardable (Rewardable *reward) |
Add a Rewardable object to the list of objects to be awarded to the player invoking the QuestEffect. | |
const Rewardable * | getRewardables (unsigned int index) const |
Returns the Rewardable object at the given index. | |
Private Attributes | |
std::list< Rewardable * > | rewards_ |
A list of Rewardables to be added to the player invoking the QuestEffect. |
Creating a AddReward through XML goes as follows:
<AddReward> <Rewardable> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations. ... <Rewardable> </AddReward>
orxonox::AddReward::AddReward | ( | BaseObject * | creator | ) |
orxonox::AddReward::~AddReward | ( | ) | [virtual] |
Destructor.
void orxonox::AddReward::addRewardable | ( | Rewardable * | reward | ) | [inline, private] |
Add a Rewardable object to the list of objects to be awarded to the player invoking the QuestEffect.
reward | Pointer to the Rewardable to be added. |
Referenced by XMLPort().
const Rewardable * orxonox::AddReward::getRewardables | ( | unsigned int | index | ) | const [private] |
Returns the Rewardable object at the given index.
index | The index. |
References rewards_.
Referenced by XMLPort().
bool orxonox::AddReward::invoke | ( | PlayerInfo * | player | ) | [virtual] |
Invokes the QuestEffect.
player | The player. |
Implements orxonox::QuestEffect.
void orxonox::AddReward::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
Method for creating a AddReward object through XML.
Method for creating a AddReward object through XML.
Reimplemented from orxonox::BaseObject.
References addRewardable(), COUT, getRewardables(), rewards_, SUPER, and XMLPortObject.
std::list<Rewardable*> orxonox::AddReward::rewards_ [private] |
A list of Rewardables to be added to the player invoking the QuestEffect.
Referenced by getRewardables(), invoke(), and XMLPort().