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

Contains all the game-specific static data that never changes throughout the game, like rulesets and resources. More...

#include <Mod.h>

Public Member Functions

 Mod ()
 Creates a blank mod. More...
 
 ~Mod ()
 Cleans up the mod. More...
 
const std::map< std::string, int > & getUfopaediaSections () const
 For internal use only.
 
FontgetFont (const std::string &name, bool error=true) const
 Gets a particular font. More...
 
SurfacegetSurface (const std::string &name, bool error=true)
 Gets a particular surface. More...
 
SurfaceSetgetSurfaceSet (const std::string &name, bool error=true)
 Gets a particular surface set. More...
 
MusicgetMusic (const std::string &name, bool error=true) const
 Gets a particular music. More...
 
void playMusic (const std::string &name, int id=0)
 Plays a particular music. More...
 
SoundgetSound (const std::string &set, unsigned int sound, bool error=true) const
 Gets a particular sound. More...
 
PalettegetPalette (const std::string &name, bool error=true) const
 Gets a particular palette. More...
 
void setPalette (SDL_Color *colors, int firstcolor=0, int ncolors=256)
 Sets a new palette. More...
 
std::vector< Uint16 > * getVoxelData ()
 Gets list of voxel data. More...
 
SoundgetSoundByDepth (unsigned int depth, unsigned int sound, bool error=true) const
 Returns a specific sound from either the land or underwater sound set. More...
 
const std::vector< std::vector< Uint8 > > * getLUTs () const
 Gets list of LUT data. More...
 
int getModOffset () const
 Gets the mod offset. More...
 
int getSpriteOffset (int sprite, const std::string &set) const
 Gets the mod offset for a certain sprite. More...
 
int getSoundOffset (int sound, const std::string &set) const
 Gets the mod offset for a certain sound. More...
 
int getOffset (int id, int max) const
 Gets the mod offset for a generic value. More...
 
void loadAll (const std::vector< std::pair< std::string, std::vector< std::string > > > &mods)
 Loads a list of mods. More...
 
SavedGamenewSave () const
 Generates the starting saved game. More...
 
RuleCountrygetCountry (const std::string &id, bool error=false) const
 Gets the ruleset for a country type. More...
 
const std::vector< std::string > & getCountriesList () const
 Gets the available countries. More...
 
RuleRegiongetRegion (const std::string &id, bool error=false) const
 Gets the ruleset for a region type. More...
 
const std::vector< std::string > & getRegionsList () const
 Gets the available regions. More...
 
RuleBaseFacilitygetBaseFacility (const std::string &id, bool error=false) const
 Gets the ruleset for a facility type. More...
 
const std::vector< std::string > & getBaseFacilitiesList () const
 Gets the available facilities. More...
 
RuleCraftgetCraft (const std::string &id, bool error=false) const
 Gets the ruleset for a craft type. More...
 
const std::vector< std::string > & getCraftsList () const
 Gets the available crafts. More...
 
RuleCraftWeapongetCraftWeapon (const std::string &id, bool error=false) const
 Gets the ruleset for a craft weapon type. More...
 
const std::vector< std::string > & getCraftWeaponsList () const
 Gets the available craft weapons. More...
 
RuleItemgetItem (const std::string &id, bool error=false) const
 Gets the ruleset for an item type. More...
 
const std::vector< std::string > & getItemsList () const
 Gets the available items. More...
 
RuleUfogetUfo (const std::string &id, bool error=false) const
 Gets the ruleset for a UFO type. More...
 
const std::vector< std::string > & getUfosList () const
 Gets the available UFOs. More...
 
RuleTerraingetTerrain (const std::string &name, bool error=false) const
 Gets terrains for battlescape games. More...
 
const std::vector< std::string > & getTerrainList () const
 Gets the available terrains. More...
 
MapDataSetgetMapDataSet (const std::string &name)
 Gets mapdatafile for battlescape games. More...
 
RuleSoldiergetSoldier (const std::string &name, bool error=false) const
 Gets soldier unit rules. More...
 
const std::vector< std::string > & getSoldiersList () const
 Gets the available soldiers. More...
 
RuleCommendationsgetCommendation (const std::string &id, bool error=false) const
 Gets commendation rules. More...
 
const std::map< std::string, RuleCommendations * > & getCommendationsList () const
 Gets the available commendations. More...
 
UnitgetUnit (const std::string &name, bool error=false) const
 Gets generated unit rules. More...
 
AlienRacegetAlienRace (const std::string &name, bool error=false) const
 Gets alien race rules. More...
 
const std::vector< std::string > & getAlienRacesList () const
 Gets the available alien races. More...
 
AlienDeploymentgetDeployment (const std::string &name, bool error=false) const
 Gets deployment rules. More...
 
const std::vector< std::string > & getDeploymentsList () const
 Gets the available alien deployments. More...
 
ArmorgetArmor (const std::string &name, bool error=false) const
 Gets armor rules. More...
 
const std::vector< std::string > & getArmorsList () const
 Gets the available armors. More...
 
ArticleDefinitiongetUfopaediaArticle (const std::string &name, bool error=false) const
 Gets Ufopaedia article definition. More...
 
const std::vector< std::string > & getUfopaediaList () const
 Gets the available articles. More...
 
const std::vector< std::string > & getUfopaediaCategoryList () const
 Gets the available article categories. More...
 
std::map< std::string, RuleInventory * > * getInventories ()
 Gets the inventory list. More...
 
RuleInventorygetInventory (const std::string &id, bool error=false) const
 Gets the ruleset for a specific inventory. More...
 
int getEngineerCost () const
 Gets the cost of an engineer. More...
 
int getScientistCost () const
 Gets the cost of a scientist. More...
 
int getPersonnelTime () const
 Gets the transfer time of personnel. More...
 
RuleResearchgetResearch (const std::string &id, bool error=false) const
 Gets the ruleset for a specific research project. More...
 
const std::vector< std::string > & getResearchList () const
 Gets the list of all research projects. More...
 
RuleManufacturegetManufacture (const std::string &id, bool error=false) const
 Gets the ruleset for a specific manufacture project. More...
 
const std::vector< std::string > & getManufactureList () const
 Gets the list of all manufacture projects. More...
 
std::vector< RuleBaseFacility * > getCustomBaseFacilities () const
 Gets facilities for custom bases. More...
 
const UfoTrajectorygetUfoTrajectory (const std::string &id, bool error=false) const
 Gets a specific UfoTrajectory. More...
 
const RuleAlienMissiongetAlienMission (const std::string &id, bool error=false) const
 Gets the ruleset for a specific alien mission. More...
 
const RuleAlienMissiongetRandomMission (MissionObjective objective, size_t monthsPassed) const
 Gets the ruleset for a random alien mission. More...
 
const std::vector< std::string > & getAlienMissionList () const
 Gets the list of all alien missions. More...
 
const std::vector< std::vector< int > > & getAlienItemLevels () const
 Gets the alien item level table. More...
 
const YAML::Node & getStartingBase () const
 Gets the player starting base. More...
 
const GameTimegetStartingTime () const
 Gets the game starting time. More...
 
MCDPatchgetMCDPatch (const std::string &id) const
 Gets an MCDPatch. More...
 
const std::map< std::string, std::vector< ExtraSprites * > > & getExtraSprites () const
 Gets the list of external Sprites. More...
 
const std::vector< std::pair< std::string, ExtraSounds * > > & getExtraSounds () const
 Gets the list of external Sounds. More...
 
const std::map< std::string, ExtraStrings * > & getExtraStrings () const
 Gets the list of external Strings. More...
 
const std::vector< StatString * > & getStatStrings () const
 Gets the list of StatStrings. More...
 
const std::vector< std::string > & getPsiRequirements () const
 Gets the research-requirements for Psi-Lab (it's a cache for psiStrengthEval)
 
const std::vector< std::string > & getInvsList () const
 Returns the sorted list of inventories. More...
 
SoldiergenSoldier (SavedGame *save, std::string type="") const
 Generates a new soldier. More...
 
std::string getAlienFuelName () const
 Gets the item to be used as fuel for ships. More...
 
int getAlienFuelQuantity () const
 Gets the amount of alien fuel to recover. More...
 
std::string getFontName () const
 Gets the font name. More...
 
int getTurnAIUseGrenade () const
 Gets first turn when AI can use grenade.
 
int getTurnAIUseBlaster () const
 Gets first turn when AI can use Blaster launcher.
 
int getMinRadarRange () const
 Gets the minimum radar's range. More...
 
RuleInterfacegetInterface (const std::string &id, bool error=true) const
 Gets information on an interface element. More...
 
RuleGlobegetGlobe () const
 Gets the ruleset for the globe. More...
 
RuleConvertergetConverter () const
 Gets the ruleset for the converter. More...
 
const std::map< std::string, SoundDefinition * > * getSoundDefinitions () const
 Gets the list of selective files for insertion into our cat files.
 
const std::vector< SDL_Color > * getTransparencies () const
 Gets the list of transparency colors,.
 
RuleVideogetVideo (const std::string &id, bool error=false) const
 Gets a video for intro/outro etc. More...
 
int getDefeatScore () const
 Returns the minimum amount of score the player can have, otherwise they are defeated. More...
 
int getDefeatFunds () const
 Returns the minimum amount of funds the player can have, otherwise they are defeated. More...
 

Detailed Description

Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.

Constructor & Destructor Documentation

◆ Mod()

OpenXcom::Mod::Mod ( )

Creates a blank mod.

Creates an empty mod.

◆ ~Mod()

OpenXcom::Mod::~Mod ( )

Cleans up the mod.

Deletes all the mod data from memory.

Member Function Documentation

◆ genSoldier()

Soldier * OpenXcom::Mod::genSoldier ( SavedGame save,
std::string  type = "" 
) const

Generates a new soldier.

Creates a new randomly-generated soldier.

Parameters
saveSaved game the soldier belongs to.
typeThe soldier type to generate.
Returns
Newly generated soldier.

◆ getAlienFuelName()

std::string OpenXcom::Mod::getAlienFuelName ( ) const

Gets the item to be used as fuel for ships.

Gets the name of the item to be used as alien fuel.

Returns
the name of the fuel.

◆ getAlienFuelQuantity()

int OpenXcom::Mod::getAlienFuelQuantity ( ) const

Gets the amount of alien fuel to recover.

Returns
the amount to recover.

◆ getAlienItemLevels()

const std::vector< std::vector< int > > & OpenXcom::Mod::getAlienItemLevels ( ) const

Gets the alien item level table.

Returns
A deep array containing the alien item levels.

◆ getAlienMission()

const RuleAlienMission * OpenXcom::Mod::getAlienMission ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a specific alien mission.

Returns the rules for the specified alien mission.

Parameters
idAlien mission type.
Returns
Rules for the alien mission.

◆ getAlienMissionList()

const std::vector< std::string > & OpenXcom::Mod::getAlienMissionList ( ) const

Gets the list of all alien missions.

Returns the list of alien mission types.

Returns
The list of alien mission types.

◆ getAlienRace()

AlienRace * OpenXcom::Mod::getAlienRace ( const std::string &  name,
bool  error = false 
) const

Gets alien race rules.

Returns the info about a specific alien race.

Parameters
nameRace name.
Returns
Rules for the race.

◆ getAlienRacesList()

const std::vector< std::string > & OpenXcom::Mod::getAlienRacesList ( ) const

Gets the available alien races.

Returns the list of all alien races.

provided by the mod.

Returns
List of alien races.

◆ getArmor()

Armor * OpenXcom::Mod::getArmor ( const std::string &  name,
bool  error = false 
) const

Gets armor rules.

Returns the info about a specific armor.

Parameters
nameArmor name.
Returns
Rules for the armor.

◆ getArmorsList()

const std::vector< std::string > & OpenXcom::Mod::getArmorsList ( ) const

Gets the available armors.

Returns the list of all armors provided by the mod.

Returns
List of armors.

◆ getBaseFacilitiesList()

const std::vector< std::string > & OpenXcom::Mod::getBaseFacilitiesList ( ) const

Gets the available facilities.

Returns the list of all base facilities provided by the mod.

Returns
List of base facilities.

◆ getBaseFacility()

RuleBaseFacility * OpenXcom::Mod::getBaseFacility ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a facility type.

Returns the rules for the specified base facility.

Parameters
idFacility type.
Returns
Rules for the facility.

◆ getCommendation()

RuleCommendations * OpenXcom::Mod::getCommendation ( const std::string &  id,
bool  error = false 
) const

Gets commendation rules.

Returns the rules for the specified commendation.

Parameters
idCommendation type.
Returns
Rules for the commendation.

◆ getCommendationsList()

const std::map< std::string, RuleCommendations * > & OpenXcom::Mod::getCommendationsList ( ) const

Gets the available commendations.

Gets the list of commendations provided by the mod.

Returns
The list of commendations.

◆ getConverter()

RuleConverter * OpenXcom::Mod::getConverter ( ) const

Gets the ruleset for the converter.

Gets the rules for the Save Converter.

Returns
Pointer to converter rules.

◆ getCountriesList()

const std::vector< std::string > & OpenXcom::Mod::getCountriesList ( ) const

Gets the available countries.

Returns the list of all countries provided by the mod.

Returns
List of countries.

◆ getCountry()

RuleCountry * OpenXcom::Mod::getCountry ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a country type.

Returns the rules for the specified country.

Parameters
idCountry type.
Returns
Rules for the country.

◆ getCraft()

RuleCraft * OpenXcom::Mod::getCraft ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a craft type.

Returns the rules for the specified craft.

Parameters
idCraft type.
Returns
Rules for the craft.

◆ getCraftsList()

const std::vector< std::string > & OpenXcom::Mod::getCraftsList ( ) const

Gets the available crafts.

Returns the list of all crafts provided by the mod.

Returns
List of crafts.

◆ getCraftWeapon()

RuleCraftWeapon * OpenXcom::Mod::getCraftWeapon ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a craft weapon type.

Returns the rules for the specified craft weapon.

Parameters
idCraft weapon type.
Returns
Rules for the craft weapon.

◆ getCraftWeaponsList()

const std::vector< std::string > & OpenXcom::Mod::getCraftWeaponsList ( ) const

Gets the available craft weapons.

Returns the list of all craft weapons provided by the mod.

Returns
List of craft weapons.

◆ getCustomBaseFacilities()

std::vector< RuleBaseFacility * > OpenXcom::Mod::getCustomBaseFacilities ( ) const

Gets facilities for custom bases.

Generates and returns a list of facilities for custom bases.

The list contains all the facilities that are listed in the 'startingBase' part of the ruleset.

Returns
The list of facilities for custom bases.

◆ getDefeatFunds()

int OpenXcom::Mod::getDefeatFunds ( ) const

Returns the minimum amount of funds the player can have, otherwise they are defeated.

Returns
Funds.

◆ getDefeatScore()

int OpenXcom::Mod::getDefeatScore ( ) const

Returns the minimum amount of score the player can have, otherwise they are defeated.

Changes based on difficulty.

Returns
Score.

◆ getDeployment()

AlienDeployment * OpenXcom::Mod::getDeployment ( const std::string &  name,
bool  error = false 
) const

Gets deployment rules.

Returns the info about a specific deployment.

Parameters
nameDeployment name.
Returns
Rules for the deployment.

◆ getDeploymentsList()

const std::vector< std::string > & OpenXcom::Mod::getDeploymentsList ( ) const

Gets the available alien deployments.

Returns the list of all alien deployments provided by the mod.

Returns
List of alien deployments.

◆ getEngineerCost()

int OpenXcom::Mod::getEngineerCost ( ) const

Gets the cost of an engineer.

Returns the cost of an individual engineer for purchase/maintenance.

Returns
Cost.

◆ getExtraSounds()

const std::vector< std::pair< std::string, ExtraSounds * > > & OpenXcom::Mod::getExtraSounds ( ) const

Gets the list of external Sounds.

Gets the list of external sounds.

Returns
The list of external sounds.

◆ getExtraSprites()

const std::map< std::string, std::vector< ExtraSprites * > > & OpenXcom::Mod::getExtraSprites ( ) const

Gets the list of external Sprites.

Gets the list of external sprites.

Returns
The list of external sprites.

◆ getExtraStrings()

const std::map< std::string, ExtraStrings * > & OpenXcom::Mod::getExtraStrings ( ) const

Gets the list of external Strings.

Gets the list of external strings.

Returns
The list of external strings.

◆ getFont()

Font * OpenXcom::Mod::getFont ( const std::string &  name,
bool  error = true 
) const

Gets a particular font.

Returns a specific font from the mod.

Parameters
nameName of the font.
Returns
Pointer to the font.

◆ getFontName()

std::string OpenXcom::Mod::getFontName ( ) const

Gets the font name.

Gets name of font collection.

Returns
the name of YAML-file with font data

◆ getGlobe()

RuleGlobe * OpenXcom::Mod::getGlobe ( ) const

Gets the ruleset for the globe.

Gets the rules for the Geoscape globe.

Returns
Pointer to globe rules.

◆ getInterface()

RuleInterface * OpenXcom::Mod::getInterface ( const std::string &  id,
bool  error = true 
) const

Gets information on an interface element.

Gets information on an interface.

Parameters
idthe interface we want info on.
Returns
the interface.

◆ getInventories()

std::map< std::string, RuleInventory * > * OpenXcom::Mod::getInventories ( )

Gets the inventory list.

Returns the list of inventories.

Returns
Pointer to inventory list.

◆ getInventory()

RuleInventory * OpenXcom::Mod::getInventory ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a specific inventory.

Returns the rules for a specific inventory.

Parameters
idInventory type.
Returns
Inventory ruleset.

◆ getInvsList()

const std::vector< std::string > & OpenXcom::Mod::getInvsList ( ) const

Returns the sorted list of inventories.

Returns the list of inventories.

Returns
The list of inventories.

◆ getItem()

RuleItem * OpenXcom::Mod::getItem ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for an item type.

Returns the rules for the specified item.

Parameters
idItem type.
Returns
Rules for the item, or 0 when the item is not found.

◆ getItemsList()

const std::vector< std::string > & OpenXcom::Mod::getItemsList ( ) const

Gets the available items.

Returns the list of all items provided by the mod.

Returns
List of items.

◆ getLUTs()

const std::vector< std::vector< Uint8 > > * OpenXcom::Mod::getLUTs ( ) const

Gets list of LUT data.

Returns the list of color LUTs in the mod.

Returns
Pointer to the list of LUTs.

◆ getManufacture()

RuleManufacture * OpenXcom::Mod::getManufacture ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a specific manufacture project.

Returns the rules for the specified manufacture project.

Parameters
idManufacture project type.
Returns
Rules for the manufacture project.

◆ getManufactureList()

const std::vector< std::string > & OpenXcom::Mod::getManufactureList ( ) const

Gets the list of all manufacture projects.

Returns the list of manufacture projects.

Returns
The list of manufacture projects.

◆ getMapDataSet()

MapDataSet * OpenXcom::Mod::getMapDataSet ( const std::string &  name)

Gets mapdatafile for battlescape games.

Returns the info about a specific map data file.

Parameters
nameDatafile name.
Returns
Rules for the datafile.

◆ getMCDPatch()

MCDPatch * OpenXcom::Mod::getMCDPatch ( const std::string &  id) const

Gets an MCDPatch.

Parameters
idThe ID of the MCDPatch we want.
Returns
The MCDPatch based on ID, or 0 if none defined.

◆ getMinRadarRange()

int OpenXcom::Mod::getMinRadarRange ( ) const

Gets the minimum radar's range.

Returns the minimum facilitie's radar range.

Returns
The minimum range.

◆ getModOffset()

int OpenXcom::Mod::getModOffset ( ) const

Gets the mod offset.

Returns the current mod-based offset for resources.

Returns
Mod offset.

◆ getMusic()

Music * OpenXcom::Mod::getMusic ( const std::string &  name,
bool  error = true 
) const

Gets a particular music.

Returns a specific music from the mod.

Parameters
nameName of the music.
Returns
Pointer to the music.

◆ getOffset()

int OpenXcom::Mod::getOffset ( int  id,
int  max 
) const

Gets the mod offset for a generic value.

Returns the appropriate mod-based offset for a generic ID.

If the ID is bigger than the max, the mod offset is applied.

Parameters
idNumeric ID.
maxMaximum vanilla value.

◆ getPalette()

Palette * OpenXcom::Mod::getPalette ( const std::string &  name,
bool  error = true 
) const

Gets a particular palette.

Returns a specific palette from the mod.

Parameters
nameName of the palette.
Returns
Pointer to the palette.

◆ getPersonnelTime()

int OpenXcom::Mod::getPersonnelTime ( ) const

Gets the transfer time of personnel.

Returns the time it takes to transfer personnel between bases.

Returns
Time in hours.

◆ getRandomMission()

const RuleAlienMission * OpenXcom::Mod::getRandomMission ( MissionObjective  objective,
size_t  monthsPassed 
) const

Gets the ruleset for a random alien mission.

Returns the rules for a random alien mission based on a specific objective.

Parameters
objectiveAlien mission objective.
Returns
Rules for the alien mission.

◆ getRegion()

RuleRegion * OpenXcom::Mod::getRegion ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a region type.

Returns the rules for the specified region.

Parameters
idRegion type.
Returns
Rules for the region.

◆ getRegionsList()

const std::vector< std::string > & OpenXcom::Mod::getRegionsList ( ) const

Gets the available regions.

Returns the list of all regions provided by the mod.

Returns
List of regions.

◆ getResearch()

RuleResearch * OpenXcom::Mod::getResearch ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a specific research project.

Returns the rules for the specified research project.

Parameters
idResearch project type.
Returns
Rules for the research project.

◆ getResearchList()

const std::vector< std::string > & OpenXcom::Mod::getResearchList ( ) const

Gets the list of all research projects.

Returns the list of research projects.

Returns
The list of research projects.

◆ getScientistCost()

int OpenXcom::Mod::getScientistCost ( ) const

Gets the cost of a scientist.

Returns the cost of an individual scientist for purchase/maintenance.

Returns
Cost.

◆ getSoldier()

RuleSoldier * OpenXcom::Mod::getSoldier ( const std::string &  name,
bool  error = false 
) const

Gets soldier unit rules.

Returns the info about a specific unit.

Parameters
nameUnit name.
Returns
Rules for the units.

◆ getSoldiersList()

const std::vector< std::string > & OpenXcom::Mod::getSoldiersList ( ) const

Gets the available soldiers.

Returns the list of all soldiers provided by the mod.

Returns
List of soldiers.

◆ getSound()

Sound * OpenXcom::Mod::getSound ( const std::string &  set,
unsigned int  sound,
bool  error = true 
) const

Gets a particular sound.

Returns a specific sound from the mod.

Parameters
setName of the sound set.
soundID of the sound.
Returns
Pointer to the sound.

◆ getSoundByDepth()

Sound * OpenXcom::Mod::getSoundByDepth ( unsigned int  depth,
unsigned int  sound,
bool  error = true 
) const

Returns a specific sound from either the land or underwater sound set.

Parameters
depththe depth of the battlescape.
soundID of the sound.
Returns
Pointer to the sound.

◆ getSoundOffset()

int OpenXcom::Mod::getSoundOffset ( int  sound,
const std::string &  set 
) const

Gets the mod offset for a certain sound.

Returns the appropriate mod-based offset for a sound.

If the ID is bigger than the soundset contents, the mod offset is applied.

Parameters
soundNumeric ID of the sound.
setName of the soundset to lookup.

◆ getSpriteOffset()

int OpenXcom::Mod::getSpriteOffset ( int  sprite,
const std::string &  set 
) const

Gets the mod offset for a certain sprite.

Returns the appropriate mod-based offset for a sprite.

If the ID is bigger than the surfaceset contents, the mod offset is applied.

Parameters
spriteNumeric ID of the sprite.
setName of the surfaceset to lookup.

◆ getStartingBase()

const YAML::Node & OpenXcom::Mod::getStartingBase ( ) const

Gets the player starting base.

Gets the defined starting base.

Returns
The starting base definition.

◆ getStartingTime()

const GameTime & OpenXcom::Mod::getStartingTime ( ) const

Gets the game starting time.

Gets the defined starting time.

Returns
The time the game starts in.

◆ getStatStrings()

const std::vector< StatString * > & OpenXcom::Mod::getStatStrings ( ) const

Gets the list of StatStrings.

Returns
The list of StatStrings.

◆ getSurface()

Surface * OpenXcom::Mod::getSurface ( const std::string &  name,
bool  error = true 
)

Gets a particular surface.

Returns a specific surface from the mod.

Parameters
nameName of the surface.
Returns
Pointer to the surface.

◆ getSurfaceSet()

SurfaceSet * OpenXcom::Mod::getSurfaceSet ( const std::string &  name,
bool  error = true 
)

Gets a particular surface set.

Returns a specific surface set from the mod.

Parameters
nameName of the surface set.
Returns
Pointer to the surface set.

◆ getTerrain()

RuleTerrain * OpenXcom::Mod::getTerrain ( const std::string &  name,
bool  error = false 
) const

Gets terrains for battlescape games.

Returns the rules for the specified terrain.

Parameters
nameTerrain name.
Returns
Rules for the terrain.

◆ getTerrainList()

const std::vector< std::string > & OpenXcom::Mod::getTerrainList ( ) const

Gets the available terrains.

Returns the list of all terrains provided by the mod.

Returns
List of terrains.

◆ getUfo()

RuleUfo * OpenXcom::Mod::getUfo ( const std::string &  id,
bool  error = false 
) const

Gets the ruleset for a UFO type.

Returns the rules for the specified UFO.

Parameters
idUFO type.
Returns
Rules for the UFO.

◆ getUfopaediaArticle()

ArticleDefinition * OpenXcom::Mod::getUfopaediaArticle ( const std::string &  name,
bool  error = false 
) const

Gets Ufopaedia article definition.

Returns the article definition for a given name.

Parameters
nameArticle name.
Returns
Article definition.

◆ getUfopaediaCategoryList()

const std::vector< std::string > & OpenXcom::Mod::getUfopaediaCategoryList ( ) const

Gets the available article categories.

Returns the list of all article categories provided by the mod.

Returns
List of categories.

◆ getUfopaediaList()

const std::vector< std::string > & OpenXcom::Mod::getUfopaediaList ( ) const

Gets the available articles.

Returns the list of all articles provided by the mod.

Returns
List of articles.

◆ getUfosList()

const std::vector< std::string > & OpenXcom::Mod::getUfosList ( ) const

Gets the available UFOs.

Returns the list of all ufos provided by the mod.

Returns
List of ufos.

◆ getUfoTrajectory()

const UfoTrajectory * OpenXcom::Mod::getUfoTrajectory ( const std::string &  id,
bool  error = false 
) const

Gets a specific UfoTrajectory.

Returns the data for the specified ufo trajectory.

Parameters
idUfo trajectory id.
Returns
A pointer to the data for the specified ufo trajectory.

◆ getUnit()

Unit * OpenXcom::Mod::getUnit ( const std::string &  name,
bool  error = false 
) const

Gets generated unit rules.

Returns the info about a specific unit.

Parameters
nameUnit name.
Returns
Rules for the units.

◆ getVideo()

RuleVideo * OpenXcom::Mod::getVideo ( const std::string &  id,
bool  error = false 
) const

Gets a video for intro/outro etc.

Returns the data for the specified video cutscene.

Parameters
idVideo id.
Returns
A pointer to the data for the specified video.

◆ getVoxelData()

std::vector< Uint16 > * OpenXcom::Mod::getVoxelData ( )

Gets list of voxel data.

Returns the list of voxeldata in the mod.

Returns
Pointer to the list of voxeldata.

◆ loadAll()

void OpenXcom::Mod::loadAll ( const std::vector< std::pair< std::string, std::vector< std::string > > > &  mods)

Loads a list of mods.

Loads a list of mods specified in the options.

Parameters
modsList of <modId, rulesetFiles> pairs.

◆ newSave()

SavedGame * OpenXcom::Mod::newSave ( ) const

Generates the starting saved game.

Generates a brand new saved game with starting data.

Returns
A new saved game.

◆ playMusic()

void OpenXcom::Mod::playMusic ( const std::string &  name,
int  id = 0 
)

Plays a particular music.

Plays the specified track if it's not already playing.

Parameters
nameName of the music.
idId of the music, 0 for random.

◆ setPalette()

void OpenXcom::Mod::setPalette ( SDL_Color *  colors,
int  firstcolor = 0,
int  ncolors = 256 
)

Sets a new palette.

Changes the palette of all the graphics in the mod.

Parameters
colorsPointer to the set of colors.
firstcolorOffset of the first color to replace.
ncolorsAmount of colors to replace.

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