Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
orxonox::CollectiblePickup Class Reference

The CollectiblePickup class encompasses all Pickupables that can be added to a PickupCollection and thus be part of such. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/pickup/CollectiblePickup.h>

Inheritance diagram for orxonox::CollectiblePickup:
orxonox::Pickupable orxonox::OrxonoxInterface orxonox::Rewardable orxonox::Configurable orxonox::Destroyable orxonox::OrxonoxInterface orxonox::Listable orxonox::Configurable orxonox::Destroyable orxonox::Identifiable orxonox::Listable orxonox::Identifiable orxonox::Pickup orxonox::PickupCollection orxonox::BoostPickup orxonox::DamageBoostPickup orxonox::DronePickup orxonox::HealthPickup orxonox::InvisiblePickup orxonox::MetaPickup orxonox::MunitionPickup orxonox::ShieldPickup orxonox::ShrinkPickup orxonox::SpeedPickup

Public Member Functions

 CollectiblePickup ()
 Constructor. More...
 
virtual ~CollectiblePickup ()
 Destructor. More...
 
virtual void changedPickedUp (void) override
 Is called when the pickup has transited from picked up to dropped or the other way around. More...
 
virtual void changedUsed (void) override
 Destructor. More...
 
bool isInCollection (void) const
 Check whether the given CollectiblePickup is par of a PickupCollection. More...
 
- Public Member Functions inherited from orxonox::Pickupable
virtual ~Pickupable ()
 Default destructor. More...
 
bool addTarget (PickupCarrier *target)
 Add a PickupCarrier as target of this Pickupable. More...
 
bool addTarget (Identifier *identifier)
 Add a class, representetd by the input Identifier, as target of this Pickupable. More...
 
virtual void changedCarrier (void)
 Should be called when the Pickupable has changed its PickupCarrier. More...
 
void destroy (void)
 Is called internally within the Pickupable module to destroy pickups. More...
 
bool drop (bool createSpawner=true)
 Can be called to drop a Pickupable. More...
 
PickupCarriergetCarrier (void)
 Get the carrier of the Pickupable. More...
 
virtual const std::string & getRepresentationName () const =0
 Returns the representation name which refers to the name of the PickupRepresentation that is used to represent this pickup. More...
 
bool isEnabled (void) const
 Returns whether the Pickupable is enabled. More...
 
bool isPickedUp (void) const
 Returns whether the Pickupable is currently picked up. More...
 
virtual bool isTarget (const PickupCarrier *carrier) const
 Get whether the given PickupCarrier is a target of this Pickupable. More...
 
bool isTarget (const Identifier *identifier) const
 Get whether a given class, represented by the input Identifier, is a target of this Pickupable. More...
 
bool isUnusable (void) const
 Returns whether the Pickupable can be unused. More...
 
bool isUsable (void) const
 Returns whether the Pickupable can be used. More...
 
bool isUsed (void) const
 Get whether the Pickupable is currently in use or not. More...
 
bool pickup (PickupCarrier *carrier)
 Can be called to pick up a Pickupable. More...
 
virtual bool reward (PlayerInfo *player) override
 Method to transcribe a Pickupable as a Rewardable to the player. More...
 
bool setCarrier (PickupCarrier *carrier, bool tell=true)
 Sets the carrier of the Pickupable. More...
 
bool setPickedUp (bool pickedUp)
 Helper method to set the Pickupable to either picked up or not picked up. More...
 
bool setUsed (bool used)
 Sets the Pickupable to used or unused, depending on the input. 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...
 
- Public Member Functions inherited from orxonox::Rewardable
 Rewardable ()
 
virtual ~Rewardable ()
 

Private Member Functions

void wasAddedToCollection (PickupCollection *collection)
 Notifies this CollectiblePickup that it was added to a PickupCollection. More...
 
void wasRemovedFromCollection (void)
 Notifies this CollectiblePickup that it was removed from its PickupCollection. More...
 

Private Attributes

PickupCollectioncollection_
 A pointer to the PickupCollection this CollectiblePickup is in. More...
 

Friends

class PickupCollection
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::Pickupable
 Pickupable ()
 Default constructor. More...
 
virtual void carrierDestroyed (void)
 Is called by the PickupCarrier when it is being destroyed. More...
 
virtual bool createSpawner (void)=0
 Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. More...
 
virtual void destroyPickup (void)
 Destroys a Pickupable. More...
 
bool isBeingDestroyed (void)
 Check whether the Pickupable is in the process of being destroyed. More...
 
virtual void preDestroy (void) override
 A method that is called by Destroyable::destroy() before the object is actually destroyed. More...
 
void setDisabled (void)
 Sets the Pickuapble to disabled. More...
 

Detailed Description

The CollectiblePickup class encompasses all Pickupables that can be added to a PickupCollection and thus be part of such.

All you need to do to make your Pickupable a CollectiblePickup is to, in some way, inherit from it. (The Pickup class, for example, is already a CollectiblePickup).

Author
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::CollectiblePickup::CollectiblePickup ( )

Constructor.

Registers the object and initializes variables.

orxonox::CollectiblePickup::~CollectiblePickup ( )
virtual

Destructor.

Member Function Documentation

void orxonox::CollectiblePickup::changedPickedUp ( void  )
overridevirtual

Is called when the pickup has transited from picked up to dropped or the other way around.

Reimplemented from orxonox::Pickupable.

Reimplemented in orxonox::Pickup, orxonox::ShrinkPickup, and orxonox::PickupCollection.

void orxonox::CollectiblePickup::changedUsed ( void  )
overridevirtual
bool orxonox::CollectiblePickup::isInCollection ( void  ) const
inline

Check whether the given CollectiblePickup is par of a PickupCollection.

Returns
Returns true if the CollectiblePickup is part of a PickupCollection.
void orxonox::CollectiblePickup::wasAddedToCollection ( PickupCollection collection)
private

Notifies this CollectiblePickup that it was added to a PickupCollection.

Parameters
collectionA pointer to the PickupCollection to which the CollectiblePickup should be added.
void orxonox::CollectiblePickup::wasRemovedFromCollection ( void  )
private

Notifies this CollectiblePickup that it was removed from its PickupCollection.

Friends And Related Function Documentation

friend class PickupCollection
friend

Member Data Documentation

PickupCollection* orxonox::CollectiblePickup::collection_
private

A pointer to the PickupCollection this CollectiblePickup is in.


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