OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::Explosion Class Reference

A class that represents an explosion animation. More...

#include <Explosion.h>

Public Member Functions

 Explosion (Position _position, int startFrame, bool big, bool hit=false)
 Creates a new Explosion. More...
 
 ~Explosion ()
 Cleans up the Explosion. More...
 
bool animate ()
 Moves the Explosion on one frame. More...
 
Position getPosition () const
 Gets the current position in voxel space. More...
 
int getCurrentFrame () const
 Gets the current frame. More...
 
bool isBig () const
 Checks if this is a real explosion. More...
 
bool isHit () const
 Checks if this is a melee or psi hit. More...
 

Detailed Description

A class that represents an explosion animation.

Map is the owner of an instance of this class during its short life. It represents both a bullet hit, as a real explosion animation.

Constructor & Destructor Documentation

OpenXcom::Explosion::Explosion ( Position  position,
int  startFrame,
bool  big,
bool  hit = false 
)

Creates a new Explosion.

Sets up a Explosion sprite with the specified size and position.

Parameters
positionExplosion center position in voxel x/y/z.
startFrameA startframe - can be used to offset different explosions at different frames.
bigFlag to indicate it is a bullet hit (false), or a real explosion (true).
hitTrue for melee and psi attacks.
OpenXcom::Explosion::~Explosion ( )

Cleans up the Explosion.

Deletes the Explosion.

Member Function Documentation

bool OpenXcom::Explosion::animate ( )

Moves the Explosion on one frame.

Animates the explosion further.

Returns
false If the animation is finished.
int OpenXcom::Explosion::getCurrentFrame ( ) const

Gets the current frame.

Gets the current frame in the animation.

Returns
frame number.
Position OpenXcom::Explosion::getPosition ( ) const

Gets the current position in voxel space.

Returns
position in voxel space.
bool OpenXcom::Explosion::isBig ( ) const

Checks if this is a real explosion.

Returns flag to indicate if it is a bullet hit (false), or a real explosion (true).

Returns
True if it is a real explosion, false if it is a bullet hit.
bool OpenXcom::Explosion::isHit ( ) const

Checks if this is a melee or psi hit.

Returns flag to indicate if it is a melee or psi hit.

Returns
True if it is a melee hit or psi hit.

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