OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::RuleAlienMission Class Reference

Stores fixed information about a mission type. More...

#include <RuleAlienMission.h>

Public Member Functions

 ~RuleAlienMission ()
 Releases all resources held by the mission. More...
 
const std::string & getType () const
 Gets the mission's type.
 
std::string generateRace (const size_t monthsPassed) const
 Gets a race based on the game time and the racial distribution. More...
 
void load (const YAML::Node &node)
 Loads alien mission data from YAML. More...
 
size_t getWaveCount () const
 Gets the number of waves.
 
const MissionWavegetWave (size_t index) const
 Gets the full wave information.
 
int getPoints () const
 Gets the score for this mission. More...
 
MissionObjective getObjective () const
 Gets the objective for this mission.
 
const std::string & getSpawnUfo () const
 Gets the UFO type for special spawns.
 
int getSpawnZone () const
 Gets the zone for spawning an alien site or base.
 
int getWeight (const size_t monthsPassed) const
 Gets the chances of this mission based on the game time. More...
 
int getRetaliationOdds () const
 Gets the inherent odds of this mission spawning a retaliation mission. More...
 
std::string getSiteType () const
 the type of missionSite to spawn (if any)
 

Detailed Description

Stores fixed information about a mission type.

It stores the mission waves and the distribution of the races that can undertake the mission based on game date.

Constructor & Destructor Documentation

◆ ~RuleAlienMission()

OpenXcom::RuleAlienMission::~RuleAlienMission ( )

Releases all resources held by the mission.

Ensures the allocated memory is released.

Member Function Documentation

◆ generateRace()

std::string OpenXcom::RuleAlienMission::generateRace ( const size_t  monthsPassed) const

Gets a race based on the game time and the racial distribution.

Chooses one of the available races for this mission.

The racial distribution may vary based on the current game date.

Parameters
monthsPassedThe number of months that have passed in the game world.
Returns
The string id of the race.

◆ getPoints()

int OpenXcom::RuleAlienMission::getPoints ( ) const

Gets the score for this mission.

Returns the Alien score for this mission.

Returns
Amount of points.

◆ getRetaliationOdds()

int OpenXcom::RuleAlienMission::getRetaliationOdds ( ) const

Gets the inherent odds of this mission spawning a retaliation mission.

Returns the Alien score for this mission.

Returns
Amount of points.

◆ getWeight()

int OpenXcom::RuleAlienMission::getWeight ( const size_t  monthsPassed) const

Gets the chances of this mission based on the game time.

Returns the chances of this mission being generated based on the current game date.

Parameters
monthsPassedThe number of months that have passed in the game world.
Returns
The weight.

◆ load()

void OpenXcom::RuleAlienMission::load ( const YAML::Node &  node)

Loads alien mission data from YAML.

Loads the mission data from a YAML node.

Parameters
nodeYAML node.

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