OpenXcom
1.0
Open-source clone of the original X-Com
|
This class is used by the BattleUnit AI. More...
#include <BattleAIState.h>
Public Member Functions | |
BattleAIState (SavedBattleGame *save, BattleUnit *unit) | |
Creates a new BattleAIState linked to the game and a certain unit. More... | |
virtual | ~BattleAIState () |
Cleans up the BattleAIState. More... | |
void | load (const YAML::Node &node) |
Loads the AI state from YAML. More... | |
virtual YAML::Node | save () const |
Saves the AI state to YAML. More... | |
virtual void | enter () |
Enters the state. More... | |
virtual void | exit () |
Exits the state. More... | |
virtual void | think (BattleAction *action) |
Runs state functionality every AI cycle. More... | |
This class is used by the BattleUnit AI.
OpenXcom::BattleAIState::BattleAIState | ( | SavedBattleGame * | save, |
BattleUnit * | unit | ||
) |
Creates a new BattleAIState linked to the game and a certain unit.
Sets up a BattleAIState.
save | Pointer to the battle game. |
unit | Pointer to the unit. |
|
virtual |
Cleans up the BattleAIState.
Deletes the BattleAIState.
|
virtual |
Enters the state.
Enters the current AI state.
Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.
|
virtual |
Exits the state.
Exits the current AI state.
Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.
void OpenXcom::BattleAIState::load | ( | const YAML::Node & | node | ) |
Loads the AI state from YAML.
Loads the AI state from a YAML file.
node | YAML node. |
|
virtual |
Saves the AI state to YAML.
Saves the AI state to a YAML file.
Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.
|
virtual |
Runs state functionality every AI cycle.
Runs any code the state needs to keep updating every AI cycle.
action | (possible) AI action to execute after thinking is done. |
Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.