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

This class is used by the BattleUnit AI. More...

#include <BattleAIState.h>

Inheritance diagram for OpenXcom::BattleAIState:
OpenXcom::AlienBAIState OpenXcom::CivilianBAIState

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...
 

Detailed Description

This class is used by the BattleUnit AI.

Constructor & Destructor Documentation

OpenXcom::BattleAIState::BattleAIState ( SavedBattleGame save,
BattleUnit unit 
)

Creates a new BattleAIState linked to the game and a certain unit.

Sets up a BattleAIState.

Parameters
savePointer to the battle game.
unitPointer to the unit.
OpenXcom::BattleAIState::~BattleAIState ( )
virtual

Cleans up the BattleAIState.

Deletes the BattleAIState.

Member Function Documentation

void OpenXcom::BattleAIState::enter ( )
virtual

Enters the state.

Enters the current AI state.

Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.

void OpenXcom::BattleAIState::exit ( )
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.

Parameters
nodeYAML node.
YAML::Node OpenXcom::BattleAIState::save ( ) const
virtual

Saves the AI state to YAML.

Saves the AI state to a YAML file.

Returns
YAML node.

Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.

void OpenXcom::BattleAIState::think ( BattleAction action)
virtual

Runs state functionality every AI cycle.

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

Parameters
action(possible) AI action to execute after thinking is done.

Reimplemented in OpenXcom::AlienBAIState, and OpenXcom::CivilianBAIState.


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