Loading...
Searching...
No Matches
CDamageableObject Class Referenceabstract

Interface for objects that generate particles when hit. More...

`#include <src/object/interface/damageable_object.h>`

Inheritance diagram for CDamageableObject:
[legend]

## Public Member Functions

| CDamageableObject (ObjectInterfaceTypes &types)
virtual bool | DamageObject (DamageType type, float force=std::numeric_limits< float >::infinity(), CObject *killer=nullptr)=0
| Damage the object, with the given force. Returns true if the object has been fully destroyed (assuming the object is destroyable, of course). If force == infinity, destroy immediately (this is the default value).
virtual void | SetDamaging (bool damaging)=0
| Set the status that means the object is currently taking damage.
virtual bool | IsDamaging ()=0
| Is object currently taking damage?

## Detailed Description

Interface for objects that generate particles when hit.

## Member Function Documentation

## DamageObject()

virtual bool CDamageableObject::DamageObject | ( | DamageType | type,
|  | float | force = std::numeric_limits< float >::infinity(),
|  | CObject * | killer = nullptr )

pure virtual

Damage the object, with the given force. Returns true if the object has been fully destroyed (assuming the object is destroyable, of course). If force == infinity, destroy immediately (this is the default value).

NOTE: You should never assume that after this function exits, the object is destroyed, unless it returns true. Even if you specify force = infinity, if may still sometimes decide not to destroy the object.

Implemented in COldObject.

## SetDamaging()

virtual void CDamageableObject::SetDamaging | ( | bool | damaging | ) |

pure virtual

Set the status that means the object is currently taking damage.

Implemented in COldObject.

## IsDamaging()

virtual bool CDamageableObject::IsDamaging | ( |  | ) |

pure virtual

Is object currently taking damage?

Implemented in COldObject.

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

- src/object/interface/damageable_object.h