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

Stores the information about alien strategy. More...

#include <AlienStrategy.h>

Public Member Functions

 AlienStrategy ()
 Create an AlienStrategy with no data. More...
 
 ~AlienStrategy ()
 Free resources used by the AlienStrategy. More...
 
void init (const Ruleset *rules)
 Initialize values according to the rules. More...
 
void load (const Ruleset *rules, const YAML::Node &node)
 Loads the data from YAML. More...
 
YAML::Node save () const
 Saves the data to YAML. More...
 
const std::string chooseRandomRegion (const Ruleset *rules)
 Choose a random region for a regular mission. More...
 
const std::string chooseRandomMission (const std::string &region) const
 Choose a random mission for a region. More...
 
bool removeMission (const std::string &region, const std::string &mission)
 Remove a region and mission from the list of posibilities. More...
 

Detailed Description

Stores the information about alien strategy.

Constructor & Destructor Documentation

OpenXcom::AlienStrategy::AlienStrategy ( )

Create an AlienStrategy with no data.

Create an AlienStrategy with no values.

Running a game like this will most likely crash.

OpenXcom::AlienStrategy::~AlienStrategy ( )

Free resources used by the AlienStrategy.

Free all resources used by this AlienStrategy.

Member Function Documentation

const std::string OpenXcom::AlienStrategy::chooseRandomMission ( const std::string &  region) const

Choose a random mission for a region.

Choose one missions available for region.

Parameters
regionThe region id.
Returns
The mission id.
const std::string OpenXcom::AlienStrategy::chooseRandomRegion ( const Ruleset rules)

Choose a random region for a regular mission.

Choose one of the regions for a mission.

Parameters
rulesPointer to the ruleset.
Returns
The region id.
void OpenXcom::AlienStrategy::init ( const Ruleset rules)

Initialize values according to the rules.

Get starting values from the rules.

Parameters
rulesPointer to the game ruleset.
void OpenXcom::AlienStrategy::load ( const Ruleset rules,
const YAML::Node &  node 
)

Loads the data from YAML.

Loads the data from a YAML file.

Parameters
rulesPointer to the game ruleset.
nodeYAML node.
bool OpenXcom::AlienStrategy::removeMission ( const std::string &  region,
const std::string &  mission 
)

Remove a region and mission from the list of posibilities.

Remove mission from the list of possible missions for region.

Parameters
regionThe region id.
missionThe mission id.
Returns
If there are no more regions with missions available.
YAML::Node OpenXcom::AlienStrategy::save ( ) const

Saves the data to YAML.

Saves the alien data to a YAML file.

Returns
YAML node.

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