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::ExplosionBState Class Reference

Explosion state not only handles explosions, but also bullet impacts! Refactoring tip : ImpactBState. More...

#include <ExplosionBState.h>

Inheritance diagram for OpenXcom::ExplosionBState:
OpenXcom::BattleState

Public Member Functions

 ExplosionBState (BattlescapeGame *parent, Position center, BattleItem *item, BattleUnit *unit, Tile *tile=0, bool lowerWeapon=false)
 Creates a new ExplosionBState class. More...
 
 ~ExplosionBState ()
 Cleans up the ExplosionBState. More...
 
void init ()
 Initializes the state. More...
 
void cancel ()
 Handles a cancel request. More...
 
void think ()
 Runs state functionality every cycle. More...
 
std::string getResult () const
 Gets the result of the state.
 
- Public Member Functions inherited from OpenXcom::BattleState
 BattleState (BattlescapeGame *parent, BattleAction action)
 Creates a new BattleState linked to the game. More...
 
 BattleState (BattlescapeGame *parent)
 Creates a new BattleState linked to the game. More...
 
virtual ~BattleState ()
 Cleans up the BattleState. More...
 
BattleAction getAction () const
 Gets a copy of the action. More...
 

Detailed Description

Explosion state not only handles explosions, but also bullet impacts! Refactoring tip : ImpactBState.

Constructor & Destructor Documentation

OpenXcom::ExplosionBState::ExplosionBState ( BattlescapeGame parent,
Position  center,
BattleItem item,
BattleUnit unit,
Tile tile = 0,
bool  lowerWeapon = false 
)

Creates a new ExplosionBState class.

Sets up an ExplosionBState.

Parameters
parentPointer to the BattleScape.
centerCenter position in voxelspace.
itemItem involved in the explosion (eg grenade).
unitUnit involved in the explosion (eg unit throwing the grenade).
tileTile the explosion is on.
lowerWeaponWhether the unit causing this explosion should now lower their weapon.
OpenXcom::ExplosionBState::~ExplosionBState ( )

Cleans up the ExplosionBState.

Deletes the ExplosionBState.

Member Function Documentation

void OpenXcom::ExplosionBState::cancel ( )
virtual

Handles a cancel request.

Explosions cannot be cancelled.

Reimplemented from OpenXcom::BattleState.

void OpenXcom::ExplosionBState::init ( )
virtual

Initializes the state.

Initializes the explosion.

The animation and sound starts here. If the animation is finished, the actual effect takes place.

Reimplemented from OpenXcom::BattleState.

void OpenXcom::ExplosionBState::think ( )
virtual

Runs state functionality every cycle.

Animates explosion sprites.

If their animation is finished remove them from the list. If the list is empty, this state is finished and the actual calculations take place.

Reimplemented from OpenXcom::BattleState.


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