Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
orxonox::PickupCarrier Class Referenceabstract

The PickupCarrier interface provides the means, for any class implementing it, to possess Pickupables. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/interfaces/PickupCarrier.h>

Inheritance diagram for orxonox::PickupCarrier:
orxonox::OrxonoxInterface orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Identifiable orxonox::Pawn orxonox::AsteroidMinable orxonox::Asteroids2DStone orxonox::Drone orxonox::FpsPlayer orxonox::InvaderEnemy orxonox::ScriptableControllerDrone orxonox::ShootableObstacle orxonox::SpaceShip orxonox::TeamBaseMatchBase orxonox::Turret orxonox::WagnisProvince

Public Member Functions

 PickupCarrier ()
 Constructor. More...
 
virtual ~PickupCarrier ()
 Destructor. More...
 
virtual const Vector3 & getCarrierPosition (void) const =0
 Get the (absolute) position of the PickupCarrier. More...
 
PickupCarriergetTarget (const Pickupable *pickup)
 Get the carrier that is both a child of the PickupCarrier (or the PickupCarrier itself) and a target of the input Pickupable. More...
 
bool isTarget (const Pickupable *pickup) const
 Can be used to check whether the PickupCarrier or a child of his is a target ot the input Pickupable. More...
 
virtual void preDestroy (void) override
 Is called before the PickupCarrier is effectively destroyed. More...
 
- Public Member Functions inherited from orxonox::OrxonoxInterface
 OrxonoxInterface ()
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 
- Public Member Functions inherited from orxonox::Destroyable
 Destroyable ()
 Constructor: Sets the default values. More...
 
virtual ~Destroyable ()
 Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More...
 
void destroy ()
 Deletes the object if no strong pointers point to this object. More...
 
void destroyLater ()
 Works like destroy() but doesn't destroy the object until the current tick has ended. More...
 
unsigned int getReferenceCount () const
 Returns the number of strong pointers that point to this object. More...
 

Protected Member Functions

virtual std::vector< PickupCarrier * > * getCarrierChildren (void) const =0
 Get all direct children of this PickupSpawner. More...
 
virtual PickupCarriergetCarrierParent (void) const =0
 Get the parent of this PickupSpawner. More...
 
std::set< Pickupable * > & getPickups (void)
 Get all Pickupables this PickupCarrier has. More...
 

Private Member Functions

bool addPickup (Pickupable *pickup)
 Adds a Pickupable to the list of pickups that are carried by this PickupCarrier. More...
 
bool removePickup (Pickupable *pickup)
 Removes a Pickupable from the list of pickups that are carried by this PickupCarrier. More...
 

Private Attributes

std::set< Pickupable * > pickups_
 The list of Pickupables carried by this PickupCarrier. More...
 

Friends

class MetaPickup
 
class Pickupable
 
class PickupManager
 

Detailed Description

The PickupCarrier interface provides the means, for any class implementing it, to possess Pickupables.

For a class to use the PickupCarrier interface it must implement the follwing three methods:

Different PickupCarriers are structured hierarchically, a pickup can be picked up by a PickupCarrier that can't really carry that particular pickup but one of its children (or one of their children) can, and thus it gets "handed down" until it is at the right place. But this structure has to be established first.

Author
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::PickupCarrier::PickupCarrier ( )

Constructor.

Registers the object.

orxonox::PickupCarrier::~PickupCarrier ( )
virtual

Destructor.

Member Function Documentation

bool orxonox::PickupCarrier::addPickup ( Pickupable pickup)
private

Adds a Pickupable to the list of pickups that are carried by this PickupCarrier.

Parameters
pickupA pointer to the pickup to be added.
Returns
Returns true if successfull, false if the Pickupable was already present.
virtual std::vector<PickupCarrier*>* orxonox::PickupCarrier::getCarrierChildren ( void  ) const
protectedpure virtual

Get all direct children of this PickupSpawner.

This method needs to be implemented by any direct derivative class of PickupCarrier. The returned list will be deleted by the methods calling this function.

Returns
Returns a pointer to a list of all direct children.

Implemented in orxonox::Pawn.

virtual PickupCarrier* orxonox::PickupCarrier::getCarrierParent ( void  ) const
protectedpure virtual

Get the parent of this PickupSpawner.

This method needs to be implemented by any direct derivative class of PickupCarrier.

Returns
Returns a pointer to the parent.

Implemented in orxonox::Pawn.

virtual const Vector3& orxonox::PickupCarrier::getCarrierPosition ( void  ) const
pure virtual

Get the (absolute) position of the PickupCarrier.

This method needs to be implemented by any direct derivative class of PickupCarrier.

Returns
Returns the position as a Vector3.

Implemented in orxonox::Pawn.

std::set<Pickupable*>& orxonox::PickupCarrier::getPickups ( void  )
inlineprotected

Get all Pickupables this PickupCarrier has.

Returns
Returns the set of all Pickupables this PickupCarrier has.
PickupCarrier * orxonox::PickupCarrier::getTarget ( const Pickupable pickup)

Get the carrier that is both a child of the PickupCarrier (or the PickupCarrier itself) and a target of the input Pickupable.

Parameters
pickupA pounter to the Pickupable.
Returns
Returns a pointer to the PickupCarrier that is the target of the input Pickupable.
bool orxonox::PickupCarrier::isTarget ( const Pickupable pickup) const

Can be used to check whether the PickupCarrier or a child of his is a target ot the input Pickupable.

Parameters
pickupA pointer to the Pickupable.
Returns
Returns true if the PickupCarrier or one of its children is a target, false if not.
void orxonox::PickupCarrier::preDestroy ( void  )
overridevirtual

Is called before the PickupCarrier is effectively destroyed.

Reimplemented from orxonox::Destroyable.

Reimplemented in orxonox::Pawn.

bool orxonox::PickupCarrier::removePickup ( Pickupable pickup)
private

Removes a Pickupable from the list of pickups that are carried by this PickupCarrier.

Parameters
pickupA pointer to the pickup to be removed.
Returns
Returns true if successfull, false if the Pickupable was not present in the list.

Friends And Related Function Documentation

friend class MetaPickup
friend
friend class Pickupable
friend
friend class PickupManager
friend

Member Data Documentation

std::set<Pickupable*> orxonox::PickupCarrier::pickups_
private

The list of Pickupables carried by this PickupCarrier.


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