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

The game data that gets written to disk when the game is saved. More...

#include <SavedGame.h>

Public Member Functions

 SavedGame ()
 Creates a new saved game. More...
 
 ~SavedGame ()
 Cleans up the saved game. More...
 
void load (const std::string &filename, Mod *mod)
 Loads a saved game from YAML. More...
 
void save (const std::string &filename) const
 Saves a saved game to YAML. More...
 
std::string getName () const
 Gets the game name. More...
 
void setName (const std::string &name)
 Sets the game name. More...
 
GameDifficulty getDifficulty () const
 Gets the game difficulty. More...
 
void setDifficulty (GameDifficulty difficulty)
 Sets the game difficulty. More...
 
int getDifficultyCoefficient () const
 Gets the game difficulty coefficient. More...
 
GameEnding getEnding () const
 Gets the game ending. More...
 
void setEnding (GameEnding end)
 Sets the game ending. More...
 
bool isIronman () const
 Gets if the game is in ironman mode. More...
 
void setIronman (bool ironman)
 Sets if the game is in ironman mode. More...
 
int64_t getFunds () const
 Gets the current funds. More...
 
std::vector< int64_t > & getFundsList ()
 Gets the list of funds from previous months. More...
 
void setFunds (int64_t funds)
 Sets new funds. More...
 
double getGlobeLongitude () const
 Gets the current globe longitude. More...
 
void setGlobeLongitude (double lon)
 Sets the new globe longitude. More...
 
double getGlobeLatitude () const
 Gets the current globe latitude. More...
 
void setGlobeLatitude (double lat)
 Sets the new globe latitude. More...
 
int getGlobeZoom () const
 Gets the current globe zoom. More...
 
void setGlobeZoom (int zoom)
 Sets the new globe zoom. More...
 
void monthlyFunding ()
 Handles monthly funding. More...
 
GameTimegetTime () const
 Gets the current game time. More...
 
void setTime (const GameTime &time)
 Sets the current game time. More...
 
int getId (const std::string &name)
 Gets the current ID for an object. More...
 
const std::map< std::string, int > & getAllIds () const
 Resets the list of object IDs. More...
 
void setAllIds (const std::map< std::string, int > &ids)
 Resets the list of object IDs. More...
 
std::vector< Country * > * getCountries ()
 Gets the list of countries. More...
 
int getCountryFunding () const
 Gets the total country funding. More...
 
std::vector< Region * > * getRegions ()
 Gets the list of regions. More...
 
std::vector< Base * > * getBases ()
 Gets the list of bases. More...
 
const std::vector< Base * > * getBases () const
 Gets the list of bases. More...
 
int getBaseMaintenance () const
 Gets the total base maintenance. More...
 
std::vector< Ufo * > * getUfos ()
 Gets the list of UFOs. More...
 
std::vector< Waypoint * > * getWaypoints ()
 Gets the list of waypoints. More...
 
std::vector< MissionSite * > * getMissionSites ()
 Gets the list of mission sites. More...
 
SavedBattleGamegetSavedBattle ()
 Gets the current battle game. More...
 
void setBattleGame (SavedBattleGame *battleGame)
 Sets the current battle game. More...
 
void addFinishedResearchSimple (const RuleResearch *research)
 Add a finished ResearchProject. More...
 
void addFinishedResearch (const RuleResearch *research, const Mod *mod, Base *base, bool score=true)
 Add a finished ResearchProject. More...
 
const std::vector< const RuleResearch * > & getDiscoveredResearch () const
 Get the list of already discovered research projects. More...
 
void getAvailableResearchProjects (std::vector< RuleResearch *> &projects, const Mod *mod, Base *base, bool considerDebugMode=false) const
 Get the list of ResearchProject which can be researched in a Base. More...
 
void getNewlyAvailableResearchProjects (std::vector< RuleResearch *> &before, std::vector< RuleResearch *> &after, std::vector< RuleResearch *> &diff) const
 Get the list of newly available research projects once a research has been completed. More...
 
void getAvailableProductions (std::vector< RuleManufacture *> &productions, const Mod *mod, Base *base) const
 Get the list of Productions which can be manufactured in a Base. More...
 
void getDependableManufacture (std::vector< RuleManufacture *> &dependables, const RuleResearch *research, const Mod *mod, Base *base) const
 Get the list of newly available manufacture projects once a research has been completed. More...
 
bool hasUndiscoveredProtectedUnlock (const RuleResearch *r, const Mod *mod) const
 Gets if a research still has undiscovered "protected unlocks". More...
 
bool isResearched (const std::string &research, bool considerDebugMode=true) const
 Gets if a certain research has been completed. More...
 
bool isResearched (const std::vector< std::string > &research, bool considerDebugMode=true) const
 Gets if a certain list of research topics has been completed. More...
 
SoldiergetSoldier (int id) const
 Gets the soldier matching this ID. More...
 
bool handlePromotions (std::vector< Soldier *> &participants)
 Handles the higher promotions. More...
 
void processSoldier (Soldier *soldier, PromotionInfo &soldierData)
 Processes a soldier's promotion. More...
 
SoldierinspectSoldiers (std::vector< Soldier *> &soldiers, std::vector< Soldier *> &participants, int rank)
 Checks how many soldiers of a rank exist and which one has the highest score. More...
 
std::vector< AlienBase * > * getAlienBases ()
 Returns the list of alien bases. More...
 
void setDebugMode ()
 Sets debug mode. More...
 
bool getDebugMode () const
 Gets debug mode. More...
 
std::vector< int64_t > & getMaintenances ()
 return a list of maintenance costs More...
 
void addResearchScore (int score)
 sets the research score for the month More...
 
std::vector< int > & getResearchScores ()
 gets the list of research scores More...
 
std::vector< int64_t > & getIncomes ()
 gets the list of incomes. More...
 
std::vector< int64_t > & getExpenditures ()
 gets the list of expenditures. More...
 
bool getWarned () const
 gets whether or not the player has been warned More...
 
void setWarned (bool warned)
 sets whether or not the player has been warned More...
 
AlienStrategygetAlienStrategy ()
 Full access to the alien strategy data.
 
const AlienStrategygetAlienStrategy () const
 Read-only access to the alien strategy data.
 
std::vector< AlienMission * > & getAlienMissions ()
 Full access to the current alien missions.
 
const std::vector< AlienMission * > & getAlienMissions () const
 Read-only access to the current alien missions.
 
AlienMissionfindAlienMission (const std::string &region, MissionObjective objective) const
 Finds a mission by region and objective. More...
 
RegionlocateRegion (double lon, double lat) const
 Locate a region containing a position. More...
 
RegionlocateRegion (const Target &target) const
 Locate a region containing a Target. More...
 
int getMonthsPassed () const
 Return the month counter.
 
const std::string & getGraphRegionToggles () const
 Return the GraphRegionToggles.
 
const std::string & getGraphCountryToggles () const
 Return the GraphCountryToggles.
 
const std::string & getGraphFinanceToggles () const
 Return the GraphFinanceToggles.
 
void setGraphRegionToggles (const std::string &value)
 Sets the GraphRegionToggles. More...
 
void setGraphCountryToggles (const std::string &value)
 Sets the GraphCountryToggles. More...
 
void setGraphFinanceToggles (const std::string &value)
 Sets the GraphFinanceToggles. More...
 
void addMonth ()
 Increment the month counter.
 
void addPoppedResearch (const RuleResearch *research)
 add a research to the "popped up" array
 
bool wasResearchPopped (const RuleResearch *research)
 check if a research is on the "popped up" array
 
void removePoppedResearch (const RuleResearch *research)
 remove a research from the "popped up" array
 
std::vector< Soldier * > * getDeadSoldiers ()
 Gets the list of dead soldiers. More...
 
BasegetSelectedBase ()
 Gets the last selected player base. More...
 
void setSelectedBase (size_t base)
 Set the last selected player base. More...
 
int getSoldierScore (Soldier *soldier)
 Evaluate the score of a soldier based on all of his stats, missions and kills. More...
 
void setLastSelectedArmor (const std::string &value)
 Sets the last selected armour. More...
 
std::string getLastSelectedArmor () const
 Gets the last selected armour. More...
 
CraftfindCraftByUniqueId (const CraftId &craftId) const
 Returns the craft corresponding to the specified unique id. More...
 
std::vector< MissionStatistics * > * getMissionStatistics ()
 Gets the list of missions statistics. More...
 
std::vector< Soldier * >::iterator killSoldier (Soldier *soldier, BattleUnitKills *cause=0)
 Handles a soldier's death. More...
 

Static Public Member Functions

static std::string sanitizeModName (const std::string &name)
 Sanitizies a mod name in a save. More...
 
static std::vector< SaveInfogetList (Language *lang, bool autoquick)
 Gets list of saves in the user directory. More...
 

Detailed Description

The game data that gets written to disk when the game is saved.

A saved game holds all the variable info in a game like funds, game time, current bases and contents, world activities, score, etc.

Constructor & Destructor Documentation

◆ SavedGame()

OpenXcom::SavedGame::SavedGame ( )

Creates a new saved game.

Initializes a brand new saved game according to the specified difficulty.

◆ ~SavedGame()

OpenXcom::SavedGame::~SavedGame ( )

Cleans up the saved game.

Deletes the game content from memory.

Member Function Documentation

◆ addFinishedResearch()

void OpenXcom::SavedGame::addFinishedResearch ( const RuleResearch research,
const Mod mod,
Base base,
bool  score = true 
)

Add a finished ResearchProject.

Add a ResearchProject to the list of already discovered ResearchProject.

Parameters
researchThe newly found ResearchProject
modthe game Mod
basethe base, in which the project was finished
scoreshould the score be awarded or not?

◆ addFinishedResearchSimple()

void OpenXcom::SavedGame::addFinishedResearchSimple ( const RuleResearch research)

Add a finished ResearchProject.

Add a ResearchProject to the list of already discovered ResearchProject.

Parameters
researchThe newly found ResearchProject

◆ addResearchScore()

void OpenXcom::SavedGame::addResearchScore ( int  score)

sets the research score for the month

adds to this month's research score

Parameters
scorethe amount to add.

◆ findAlienMission()

AlienMission * OpenXcom::SavedGame::findAlienMission ( const std::string &  region,
MissionObjective  objective 
) const

Finds a mission by region and objective.

Find a mission type in the active alien missions.

Parameters
regionThe region string ID.
objectiveThe active mission objective.
Returns
A pointer to the mission, or 0 if no mission matched.

◆ findCraftByUniqueId()

Craft * OpenXcom::SavedGame::findCraftByUniqueId ( const CraftId &  craftId) const

Returns the craft corresponding to the specified unique id.

Parameters
craftIdThe unique craft id to look up.
Returns
The craft with the specified id, or NULL.

◆ getAlienBases()

std::vector< AlienBase * > * OpenXcom::SavedGame::getAlienBases ( )

Returns the list of alien bases.

Returns
Pointer to alien base list.

◆ getAllIds()

const std::map< std::string, int > & OpenXcom::SavedGame::getAllIds ( ) const

Resets the list of object IDs.

Resets the list of unique object IDs.

Parameters
idsNew ID list.

◆ getAvailableProductions()

void OpenXcom::SavedGame::getAvailableProductions ( std::vector< RuleManufacture *> &  productions,
const Mod mod,
Base base 
) const

Get the list of Productions which can be manufactured in a Base.

Get the list of RuleManufacture which can be manufacture in a Base.

Parameters
productionsthe list of Productions which are available.
modthe Game Mod
basea pointer to a Base

◆ getAvailableResearchProjects()

void OpenXcom::SavedGame::getAvailableResearchProjects ( std::vector< RuleResearch *> &  projects,
const Mod mod,
Base base,
bool  considerDebugMode = false 
) const

Get the list of ResearchProject which can be researched in a Base.

Get the list of RuleResearch which can be researched in a Base.

Parameters
projectsthe list of ResearchProject which are available.
modthe game Mod
basea pointer to a Base
considerDebugModeShould debug mode be considered or not.

◆ getBaseMaintenance()

int OpenXcom::SavedGame::getBaseMaintenance ( ) const

Gets the total base maintenance.

Adds up the monthly maintenance of all the bases.

Returns
Total maintenance.

◆ getBases() [1/2]

std::vector< Base * > * OpenXcom::SavedGame::getBases ( )

Gets the list of bases.

Returns the list of player bases.

Returns
Pointer to base list.

◆ getBases() [2/2]

const std::vector< Base * > * OpenXcom::SavedGame::getBases ( ) const

Gets the list of bases.

Returns an immutable list of player bases.

Returns
Pointer to base list.

◆ getCountries()

std::vector< Country * > * OpenXcom::SavedGame::getCountries ( )

Gets the list of countries.

Returns the list of countries in the game world.

Returns
Pointer to country list.

◆ getCountryFunding()

int OpenXcom::SavedGame::getCountryFunding ( ) const

Gets the total country funding.

Adds up the monthly funding of all the countries.

Returns
Total funding.

◆ getDeadSoldiers()

std::vector< Soldier * > * OpenXcom::SavedGame::getDeadSoldiers ( )

Gets the list of dead soldiers.

Returns the list of dead soldiers.

Returns
Pointer to soldier list.

◆ getDebugMode()

bool OpenXcom::SavedGame::getDebugMode ( ) const

Gets debug mode.

Gets the current debug mode.

Returns
Debug mode.

◆ getDependableManufacture()

void OpenXcom::SavedGame::getDependableManufacture ( std::vector< RuleManufacture *> &  dependables,
const RuleResearch research,
const Mod mod,
Base base 
) const

Get the list of newly available manufacture projects once a research has been completed.

Get the list of newly available manufacture projects once a ResearchProject has been completed.

This function check for fake ResearchProject.

Parameters
dependablesthe list of RuleManufacture which are now available.
researchThe RuleResearch which has just been discovered
modthe Game Mod
basea pointer to a Base

◆ getDifficulty()

GameDifficulty OpenXcom::SavedGame::getDifficulty ( ) const

Gets the game difficulty.

Returns the game's difficulty level.

Returns
Difficulty level.

◆ getDifficultyCoefficient()

int OpenXcom::SavedGame::getDifficultyCoefficient ( ) const

Gets the game difficulty coefficient.

Returns the game's difficulty coefficient based on the current level.

Returns
Difficulty coefficient.

◆ getDiscoveredResearch()

const std::vector< const RuleResearch * > & OpenXcom::SavedGame::getDiscoveredResearch ( ) const

Get the list of already discovered research projects.

Returns the list of already discovered ResearchProject.

Returns
the list of already discovered ResearchProject

◆ getEnding()

GameEnding OpenXcom::SavedGame::getEnding ( ) const

Gets the game ending.

Returns the game's current ending.

Returns
Ending state.

◆ getExpenditures()

std::vector< int64_t > & OpenXcom::SavedGame::getExpenditures ( )

gets the list of expenditures.

return the list of expenditures scores

Returns
list of expenditures scores.

◆ getFunds()

int64_t OpenXcom::SavedGame::getFunds ( ) const

Gets the current funds.

Returns the player's current funds.

Returns
Current funds.

◆ getFundsList()

std::vector< int64_t > & OpenXcom::SavedGame::getFundsList ( )

Gets the list of funds from previous months.

Returns the player's funds for the last 12 months.

Returns
funds.

◆ getGlobeLatitude()

double OpenXcom::SavedGame::getGlobeLatitude ( ) const

Gets the current globe latitude.

Returns the current latitude of the Geoscape globe.

Returns
Latitude.

◆ getGlobeLongitude()

double OpenXcom::SavedGame::getGlobeLongitude ( ) const

Gets the current globe longitude.

Returns the current longitude of the Geoscape globe.

Returns
Longitude.

◆ getGlobeZoom()

int OpenXcom::SavedGame::getGlobeZoom ( ) const

Gets the current globe zoom.

Returns the current zoom level of the Geoscape globe.

Returns
Zoom level.

◆ getId()

int OpenXcom::SavedGame::getId ( const std::string &  name)

Gets the current ID for an object.

Returns the latest ID for the specified object and increases it.

Parameters
nameObject name.
Returns
Latest ID number.

◆ getIncomes()

std::vector< int64_t > & OpenXcom::SavedGame::getIncomes ( )

gets the list of incomes.

return the list of income scores

Returns
list of income scores.

◆ getLastSelectedArmor()

std::string OpenXcom::SavedGame::getLastSelectedArmor ( ) const

Gets the last selected armour.

Returns
last used armor type string

◆ getList()

std::vector< SaveInfo > OpenXcom::SavedGame::getList ( Language lang,
bool  autoquick 
)
static

Gets list of saves in the user directory.

Gets all the info of the saves found in the user folder.

Parameters
langLoaded language.
autoquickInclude autosaves and quicksaves.
Returns
List of saves info.

◆ getMaintenances()

std::vector< int64_t > & OpenXcom::SavedGame::getMaintenances ( )

return a list of maintenance costs

return the list of monthly maintenance costs

Returns
list of maintenances.

◆ getMissionSites()

std::vector< MissionSite * > * OpenXcom::SavedGame::getMissionSites ( )

Gets the list of mission sites.

Returns the list of mission sites.

Returns
Pointer to mission site list.

◆ getMissionStatistics()

std::vector< MissionStatistics * > * OpenXcom::SavedGame::getMissionStatistics ( )

Gets the list of missions statistics.

Returns the list of mission statistics.

Returns
Pointer to statistics list.

◆ getName()

std::string OpenXcom::SavedGame::getName ( ) const

Gets the game name.

Returns the game's name shown in Save screens.

Returns
Save name.

◆ getNewlyAvailableResearchProjects()

void OpenXcom::SavedGame::getNewlyAvailableResearchProjects ( std::vector< RuleResearch *> &  before,
std::vector< RuleResearch *> &  after,
std::vector< RuleResearch *> &  diff 
) const

Get the list of newly available research projects once a research has been completed.

Get the list of newly available research projects once a ResearchProject has been completed.

Parameters
beforethe list of available RuleResearch before completing new research.
afterthe list of available RuleResearch after completing new research.
diffthe list of newly available RuleResearch after completing new research (after - before).

◆ getRegions()

std::vector< Region * > * OpenXcom::SavedGame::getRegions ( )

Gets the list of regions.

Returns the list of world regions.

Returns
Pointer to region list.

◆ getResearchScores()

std::vector< int > & OpenXcom::SavedGame::getResearchScores ( )

gets the list of research scores

return the list of research scores

Returns
list of research scores.

◆ getSavedBattle()

SavedBattleGame * OpenXcom::SavedGame::getSavedBattle ( )

Gets the current battle game.

Get pointer to the battleGame object.

Returns
Pointer to the battleGame object.

◆ getSelectedBase()

Base * OpenXcom::SavedGame::getSelectedBase ( )

Gets the last selected player base.

Returns the last selected player base.

Returns
Pointer to base.

◆ getSoldier()

Soldier * OpenXcom::SavedGame::getSoldier ( int  id) const

Gets the soldier matching this ID.

Returns pointer to the Soldier given it's unique ID.

Parameters
idA soldier's unique id.
Returns
Pointer to Soldier.

◆ getSoldierScore()

int OpenXcom::SavedGame::getSoldierScore ( Soldier soldier)

Evaluate the score of a soldier based on all of his stats, missions and kills.

Parameters
soldierthe soldier to get a score for.
Returns
this soldier's score.

◆ getTime()

GameTime * OpenXcom::SavedGame::getTime ( ) const

Gets the current game time.

Returns the current time of the game.

Returns
Pointer to the game time.

◆ getUfos()

std::vector< Ufo * > * OpenXcom::SavedGame::getUfos ( )

Gets the list of UFOs.

Returns the list of alien UFOs.

Returns
Pointer to UFO list.

◆ getWarned()

bool OpenXcom::SavedGame::getWarned ( ) const

gets whether or not the player has been warned

return if the player has been warned about poor performance.

Returns
true or false.

◆ getWaypoints()

std::vector< Waypoint * > * OpenXcom::SavedGame::getWaypoints ( )

Gets the list of waypoints.

Returns the list of craft waypoints.

Returns
Pointer to waypoint list.

◆ handlePromotions()

bool OpenXcom::SavedGame::handlePromotions ( std::vector< Soldier *> &  participants)

Handles the higher promotions.

Handles the higher promotions (not the rookie-squaddie ones).

Parameters
participantsa list of soldiers that were actually present at the battle.
Returns
Whether or not some promotions happened - to show the promotions screen.

◆ hasUndiscoveredProtectedUnlock()

bool OpenXcom::SavedGame::hasUndiscoveredProtectedUnlock ( const RuleResearch r,
const Mod mod 
) const

Gets if a research still has undiscovered "protected unlocks".

Returns if a research still has undiscovered "protected unlocks".

Parameters
rResearch to check.
modthe Game Mod
Returns
Whether it has any undiscovered "protected unlocks" or not.

◆ inspectSoldiers()

Soldier * OpenXcom::SavedGame::inspectSoldiers ( std::vector< Soldier *> &  soldiers,
std::vector< Soldier *> &  participants,
int  rank 
)

Checks how many soldiers of a rank exist and which one has the highest score.

Parameters
soldiersfull list of live soldiers.
participantslist of participants on this mission.
rankRank to inspect.
Returns
the highest ranked soldier

◆ isIronman()

bool OpenXcom::SavedGame::isIronman ( ) const

Gets if the game is in ironman mode.

Returns if the game is set to ironman mode.

Ironman games cannot be manually saved.

Returns
Tony Stark

◆ isResearched() [1/2]

bool OpenXcom::SavedGame::isResearched ( const std::string &  research,
bool  considerDebugMode = true 
) const

Gets if a certain research has been completed.

Returns if a certain research topic has been completed.

Parameters
researchResearch ID.
considerDebugModeShould debug mode be considered or not.
Returns
Whether it's researched or not.

◆ isResearched() [2/2]

bool OpenXcom::SavedGame::isResearched ( const std::vector< std::string > &  research,
bool  considerDebugMode = true 
) const

Gets if a certain list of research topics has been completed.

Returns if a certain list of research topics has been completed.

Parameters
researchList of research IDs.
considerDebugModeShould debug mode be considered or not.
Returns
Whether it's researched or not.

◆ killSoldier()

std::vector< Soldier * >::iterator OpenXcom::SavedGame::killSoldier ( Soldier soldier,
BattleUnitKills cause = 0 
)

Handles a soldier's death.

Registers a soldier's death in the memorial.

Parameters
soldierPointer to dead soldier.
causePointer to cause of death, NULL if missing in action.

◆ load()

void OpenXcom::SavedGame::load ( const std::string &  filename,
Mod mod 
)

Loads a saved game from YAML.

Loads a saved game's contents from a YAML file.

Note
Assumes the saved game is blank.
Parameters
filenameYAML filename.
modMod for the saved game.

◆ locateRegion() [1/2]

Region * OpenXcom::SavedGame::locateRegion ( double  lon,
double  lat 
) const

Locate a region containing a position.

Find the region containing this location.

Parameters
lonThe longtitude.
latThe latitude.
Returns
Pointer to the region, or 0.

◆ locateRegion() [2/2]

Region * OpenXcom::SavedGame::locateRegion ( const Target target) const

Locate a region containing a Target.

Find the region containing this target.

Parameters
targetThe target to locate.
Returns
Pointer to the region, or 0.

◆ monthlyFunding()

void OpenXcom::SavedGame::monthlyFunding ( )

Handles monthly funding.

Gives the player his monthly funds, taking in account all maintenance and profit costs.

◆ processSoldier()

void OpenXcom::SavedGame::processSoldier ( Soldier soldier,
PromotionInfo soldierData 
)

Processes a soldier's promotion.

Processes a soldier, and adds their rank to the promotions data array.

Parameters
soldierthe soldier to process.
soldierDatathe data array to put their info into.

◆ sanitizeModName()

std::string OpenXcom::SavedGame::sanitizeModName ( const std::string &  name)
static

Sanitizies a mod name in a save.

Removes version number from a mod name, if any.

Parameters
nameMod id from a savegame.
Returns
Sanitized mod name.

◆ save()

void OpenXcom::SavedGame::save ( const std::string &  filename) const

Saves a saved game to YAML.

Saves a saved game's contents to a YAML file.

Parameters
filenameYAML filename.

◆ setAllIds()

void OpenXcom::SavedGame::setAllIds ( const std::map< std::string, int > &  ids)

Resets the list of object IDs.

Resets the list of unique object IDs.

Parameters
idsNew ID list.

◆ setBattleGame()

void OpenXcom::SavedGame::setBattleGame ( SavedBattleGame battleGame)

Sets the current battle game.

Set battleGame object.

Parameters
battleGamePointer to the battleGame object.

◆ setDebugMode()

void OpenXcom::SavedGame::setDebugMode ( )

Sets debug mode.

Toggles debug mode.

◆ setDifficulty()

void OpenXcom::SavedGame::setDifficulty ( GameDifficulty  difficulty)

Sets the game difficulty.

Changes the game's difficulty to a new level.

Parameters
difficultyNew difficulty.

◆ setEnding()

void OpenXcom::SavedGame::setEnding ( GameEnding  end)

Sets the game ending.

Changes the game's current ending.

Parameters
endNew ending.

◆ setFunds()

void OpenXcom::SavedGame::setFunds ( int64_t  funds)

Sets new funds.

Changes the player's funds to a new value.

Parameters
fundsNew funds.

◆ setGlobeLatitude()

void OpenXcom::SavedGame::setGlobeLatitude ( double  lat)

Sets the new globe latitude.

Changes the current latitude of the Geoscape globe.

Parameters
latLatitude.

◆ setGlobeLongitude()

void OpenXcom::SavedGame::setGlobeLongitude ( double  lon)

Sets the new globe longitude.

Changes the current longitude of the Geoscape globe.

Parameters
lonLongitude.

◆ setGlobeZoom()

void OpenXcom::SavedGame::setGlobeZoom ( int  zoom)

Sets the new globe zoom.

Changes the current zoom level of the Geoscape globe.

Parameters
zoomZoom level.

◆ setGraphCountryToggles()

void OpenXcom::SavedGame::setGraphCountryToggles ( const std::string &  value)

Sets the GraphCountryToggles.

Parameters
valueThe new value for GraphCountryToggles.

◆ setGraphFinanceToggles()

void OpenXcom::SavedGame::setGraphFinanceToggles ( const std::string &  value)

Sets the GraphFinanceToggles.

Parameters
valueThe new value for GraphFinanceToggles.

◆ setGraphRegionToggles()

void OpenXcom::SavedGame::setGraphRegionToggles ( const std::string &  value)

Sets the GraphRegionToggles.

Parameters
valueThe new value for GraphRegionToggles.

◆ setIronman()

void OpenXcom::SavedGame::setIronman ( bool  ironman)

Sets if the game is in ironman mode.

Changes if the game is set to ironman mode.

Ironman games cannot be manually saved.

Parameters
ironmanTony Stark

◆ setLastSelectedArmor()

void OpenXcom::SavedGame::setLastSelectedArmor ( const std::string &  value)

Sets the last selected armour.

Parameters
valueThe new value for last selected armor - Armor type string.

◆ setName()

void OpenXcom::SavedGame::setName ( const std::string &  name)

Sets the game name.

Changes the game's name shown in Save screens.

Parameters
nameNew name.

◆ setSelectedBase()

void OpenXcom::SavedGame::setSelectedBase ( size_t  base)

Set the last selected player base.

Sets the last selected player base.

Parameters
basenumber of the base.

◆ setTime()

void OpenXcom::SavedGame::setTime ( const GameTime time)

Sets the current game time.

Changes the current time of the game.

Parameters
timeGame time.

◆ setWarned()

void OpenXcom::SavedGame::setWarned ( bool  warned)

sets whether or not the player has been warned

sets the player's "warned" status.

Parameters
warnedset "warned" to this.

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