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

This class sets the battlescape in a certain sub-state. More...

#include <BattleState.h>

Inheritance diagram for OpenXcom::BattleState:
OpenXcom::DelayedSaveState OpenXcom::ExplosionBState OpenXcom::ProjectileFlyBState OpenXcom::UnitDieBState OpenXcom::UnitFallBState OpenXcom::UnitPanicBState OpenXcom::UnitTurnBState OpenXcom::UnitWalkBState

Public Member Functions

 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...
 
virtual void init ()
 Initializes the state. More...
 
virtual void cancel ()
 Handles a cancel request. More...
 
virtual void think ()
 Runs state functionality every cycle. More...
 
BattleAction getAction () const
 Gets a copy of the action. More...
 

Detailed Description

This class sets the battlescape in a certain sub-state.

These states can be triggered by the player or the AI.

Constructor & Destructor Documentation

OpenXcom::BattleState::BattleState ( BattlescapeGame parent,
BattleAction  action 
)

Creates a new BattleState linked to the game.

Sets up a BattleState.

Parameters
parentPointer to the parent state.
actionStruct containing info about the action.
OpenXcom::BattleState::BattleState ( BattlescapeGame parent)

Creates a new BattleState linked to the game.

Sets up a BattleState.

Parameters
parentPointer to the parent state.
OpenXcom::BattleState::~BattleState ( )
virtual

Cleans up the BattleState.

Deletes the BattleState.

Member Function Documentation

void OpenXcom::BattleState::cancel ( )
virtual
BattleAction OpenXcom::BattleState::getAction ( ) const

Gets a copy of the action.

Gets the action result.

Returns error messages or an empty string when everything went fine.

Returns
Error or empty string when everything is fine.
void OpenXcom::BattleState::init ( )
virtual
void OpenXcom::BattleState::think ( )
virtual

Runs state functionality every cycle.

Runs any code the state needs to keep updating every game cycle.

Reimplemented in OpenXcom::UnitWalkBState, OpenXcom::ExplosionBState, OpenXcom::ProjectileFlyBState, OpenXcom::UnitDieBState, OpenXcom::UnitFallBState, OpenXcom::UnitTurnBState, OpenXcom::UnitPanicBState, and OpenXcom::DelayedSaveState.


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