orxonox::AddReward Class Reference

Adds a list of Rewardables to a player. More...

#include <src/orxonox/objects/quest/AddReward.h>

Inheritance diagram for orxonox::AddReward:

orxonox::QuestEffect orxonox::BaseObject orxonox::OrxonoxClass

List of all members.

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 RewardablegetRewardables (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.


Detailed Description

Adds a list of Rewardables to a player.

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>

Author:
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::AddReward::AddReward ( BaseObject creator  ) 

Constructor. Registers the object.

References RegisterObject.

orxonox::AddReward::~AddReward (  )  [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
index The index.
Returns:
Returns a pointer to the Rewardable object at the given index.

References rewards_.

Referenced by XMLPort().

bool orxonox::AddReward::invoke ( PlayerInfo player  )  [virtual]

Invokes the QuestEffect.

Parameters:
player The player.
Returns:
Returns true if the QuestEffect was invoked successfully.

Implements orxonox::QuestEffect.

References COUT, and rewards_.

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.


Member Data Documentation

A list of Rewardables to be added to the player invoking the QuestEffect.

Referenced by getRewardables(), invoke(), and XMLPort().


The documentation for this class was generated from the following files:

Generated on Tue Jul 28 16:22:20 2009 for Orxonox by  doxygen 1.5.6