Orxonox
0.0.5 Codename: Arcturus
|
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>
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... | |
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. 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... | |
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... | |
Protected Member Functions | |
virtual std::vector< PickupCarrier * > * | getCarrierChildren (void) const =0 |
Get all direct children of this PickupSpawner. More... | |
virtual PickupCarrier * | getCarrierParent (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 |
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.
orxonox::PickupCarrier::PickupCarrier | ( | ) |
Constructor.
Registers the object.
|
virtual |
Destructor.
|
private |
Adds a Pickupable to the list of pickups that are carried by this PickupCarrier.
pickup | A pointer to the pickup to be added. |
|
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.
Implemented in orxonox::Pawn.
|
protectedpure virtual |
Get the parent of this PickupSpawner.
This method needs to be implemented by any direct derivative class of PickupCarrier.
Implemented in orxonox::Pawn.
|
pure virtual |
Get the (absolute) position of the PickupCarrier.
This method needs to be implemented by any direct derivative class of PickupCarrier.
Implemented in orxonox::Pawn.
|
inlineprotected |
Get 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.
pickup | A pounter to the 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.
pickup | A pointer to the Pickupable. |
Is called before the PickupCarrier is effectively destroyed.
Reimplemented from orxonox::Destroyable.
Reimplemented in orxonox::Pawn.
|
private |
Removes a Pickupable from the list of pickups that are carried by this PickupCarrier.
pickup | A pointer to the pickup to be removed. |
|
friend |
|
friend |
|
friend |
|
private |
The list of Pickupables carried by this PickupCarrier.