OpenXcom
1.0
Open-source clone of the original X-Com
|
This class sets the battlescape in a certain sub-state. More...
#include <BattleState.h>
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... | |
This class sets the battlescape in a certain sub-state.
These states can be triggered by the player or the AI.
OpenXcom::BattleState::BattleState | ( | BattlescapeGame * | parent, |
BattleAction | action | ||
) |
Creates a new BattleState linked to the game.
Sets up a BattleState.
parent | Pointer to the parent state. |
action | Struct containing info about the action. |
OpenXcom::BattleState::BattleState | ( | BattlescapeGame * | parent | ) |
Creates a new BattleState linked to the game.
Sets up a BattleState.
parent | Pointer to the parent state. |
|
virtual |
Cleans up the BattleState.
Deletes the BattleState.
|
virtual |
Handles a cancel request.
Cancels the current BattleState.
Reimplemented in OpenXcom::UnitWalkBState, OpenXcom::ExplosionBState, OpenXcom::ProjectileFlyBState, OpenXcom::UnitDieBState, OpenXcom::UnitTurnBState, and OpenXcom::UnitPanicBState.
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.
|
virtual |
Initializes the state.
Start the current BattleState.
Reimplemented in OpenXcom::UnitWalkBState, OpenXcom::ExplosionBState, OpenXcom::ProjectileFlyBState, OpenXcom::UnitDieBState, OpenXcom::UnitFallBState, OpenXcom::UnitTurnBState, OpenXcom::DelayedSaveState, and OpenXcom::UnitPanicBState.
|
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.