Planet
navihomeaboutscreenshotsdownloaddevelopmentforum
Orxonox: orxonox::AddReward Class Reference

orxonox::AddReward Class Reference
[Effects]

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

#include <questsystem/effects/AddReward.h>

Inheritance diagram for orxonox::AddReward:
orxonox::QuestEffect orxonox::BaseObject orxonox::OrxonoxClass

List of all members.

Public Member Functions

 AddReward (BaseObject *creator)
 Constructor.
virtual ~AddReward ()
 Destructor.
virtual bool invoke (PlayerInfo *player)
 Invokes the QuestEffect.
virtual void XMLPort (Element &xmlelement, XMLPort::Mode mode)
 Method for creating a AddReward object through XML.

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.

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

void orxonox::AddReward::XMLPort ( Element &  xmlelement,
XMLPort::Mode  mode 
) [virtual]

Method for creating a AddReward object through XML.

Reimplemented from orxonox::BaseObject.


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Sun May 19 06:45:50 2013 for Orxonox by  doxygen 1.6.3