Orxonox
0.0.5 Codename: Arcturus
|
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>
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... | |
PickupCarrier * | getCarrier (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... | |
Context * | getContext () 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 void * | getDerivedPointer (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... | |
Identifier * | getIdentifier () 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 | |
PickupCollection * | collection_ |
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... | |
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).
orxonox::CollectiblePickup::CollectiblePickup | ( | ) |
Constructor.
Registers the object and initializes variables.
|
virtual |
Destructor.
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.
Destructor.
Is called when the pickup has transited from used to unused or the other way around.
Reimplemented from orxonox::Pickupable.
Reimplemented in orxonox::HealthPickup, orxonox::MetaPickup, orxonox::ShieldPickup, orxonox::SpeedPickup, orxonox::ShrinkPickup, orxonox::PickupCollection, orxonox::InvisiblePickup, orxonox::DronePickup, orxonox::MunitionPickup, orxonox::BoostPickup, and orxonox::DamageBoostPickup.
|
inline |
Check whether the given CollectiblePickup is par of a PickupCollection.
|
private |
Notifies this CollectiblePickup that it was added to a PickupCollection.
collection | A pointer to the PickupCollection to which the CollectiblePickup should be added. |
Notifies this CollectiblePickup that it was removed from its PickupCollection.
|
friend |
|
private |
A pointer to the PickupCollection this CollectiblePickup is in.