Colobot
Public Member Functions | List of all members
CDestroyableObject Class Referenceabstract

Interface for objects that can be destroyed. More...

#include <destroyable_object.h>

Inheritance diagram for CDestroyableObject:
Inheritance graph
[legend]

Public Member Functions

 CDestroyableObject (ObjectInterfaceTypes &types)
 
virtual void DestroyObject (DestructionType type)=0
 Destroy the object immediately. Use this only if you are 100% sure this is what you want, because object with magnifyDamage=0 should be able to bypass all damage. It's recommended to use CDamageableObject::DamageObject() instead. More...
 
virtual float GetLightningHitProbability ()=0
 Returns the distance modifier for CLightning, used to modify hit probability. Value in range [0..1], where 0 is never and 1 is normal probability. More...
 
virtual void SetDying (DeathType deathType)=0
 Set the status that means the object is currently dying. More...
 
virtual DeathType GetDying ()=0
 Return object death type. More...
 
virtual bool IsDying ()=0
 Is object currently dying? More...
 
- Public Member Functions inherited from CDamageableObject
 CDamageableObject (ObjectInterfaceTypes &types)
 
virtual bool DamageObject (DamageType type, float force=std::numeric_limits< float >::infinity())=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) More...
 

Detailed Description

Interface for objects that can be destroyed.

NOTE: None of the objects should inherit this class directly. Instead, inherit one of the subclasses (CShieldedObject or CFragileObject)

Member Function Documentation

virtual void CDestroyableObject::DestroyObject ( DestructionType  type)
pure virtual

Destroy the object immediately. Use this only if you are 100% sure this is what you want, because object with magnifyDamage=0 should be able to bypass all damage. It's recommended to use CDamageableObject::DamageObject() instead.

NOTE: After this function exits, you can assume the object has been definetly destroyed

Implemented in COldObject.

virtual float CDestroyableObject::GetLightningHitProbability ( )
pure virtual

Returns the distance modifier for CLightning, used to modify hit probability. Value in range [0..1], where 0 is never and 1 is normal probability.

Implemented in COldObject.

virtual void CDestroyableObject::SetDying ( DeathType  deathType)
pure virtual

Set the status that means the object is currently dying.

Implemented in COldObject.

virtual DeathType CDestroyableObject::GetDying ( )
pure virtual

Return object death type.

Implemented in COldObject.

virtual bool CDestroyableObject::IsDying ( )
pure virtual

Is object currently dying?

Implemented in COldObject.


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