Emergency 20 Dokumentation  4.2.0
em5::CampaignProgress Class Reference

EMERGENCY 5 campaign progress class. More...

#include <CampaignProgress.h>

Inheritance diagram for em5::CampaignProgress:

Public Types

typedef boost::container::flat_set< qsf::NamedIdentifierNameSet
 

Public Member Functions

 CampaignProgress ()
 Default constructor. More...
 
 CampaignProgress (uint32 campaignIndex)
 Constructor. More...
 
virtual ~CampaignProgress ()
 Destructor. More...
 
uint32 getCampaignIndex () const
 Returns the campaign index. More...
 
void setCampaignIndex (uint32 campaignIndex)
 Set the campaign index. More...
 
uint32 getCurrentCredits () const
 Returns the current credit amount. More...
 
void setCurrentCredits (uint32 creditsAmount)
 Set the current credit amount. More...
 
uint32 getCurrentMapIndex () const
 Returns the current map index inside the campaign. More...
 
void setCurrentMapIndex (uint32 index)
 Set the current map index inside the campaign. More...
 
uint32 getCurrentPhaseIndex () const
 Returns the current phase index. More...
 
void setCurrentPhaseIndex (uint32 phaseIndex)
 Set the current phase index. More...
 
const qsf::NamedIdentifiergetLastMainEvent () const
 Returns the last completed mainevent. More...
 
void setLastMainEvent (const qsf::NamedIdentifier &mainevent)
 Set the last completed main event. More...
 
int32 getLastStandardEventIndex () const
 Returns the last completed standard event index in the current freeplay phase. More...
 
void setLastStandardEventIndex (int32 eventIndex)
 Set the last completed standard event index in the current freeplay phase. More...
 
void clearBoughtUnits ()
 Clears the list of already bought units (of a freeplay phase) More...
 
void addBoughtUnit (const std::string &unitName)
 Add a bought unit to the list. More...
 
const std::vector< std::string > & getBoughtUnitList ()
 Returns the list of already bought units (of a freeplay phase) More...
 
void clearBoughtUpgrades ()
 Clears the list of already bought upgrades (of a freeplay phase) More...
 
void addBoughtUpgrade (const std::string &upgradeName)
 Add a bought upgrade to the list. More...
 
const std::vector< std::string > & getBoughtUpgradeList ()
 Returns the list of already bought upgrades. More...
 
uint32 getFinishedFreeplayEventsCount () const
 Returns the number of successfully finished freeplay events. More...
 
void setFinishedFreeplayEventsCount (uint32 number)
 Set the number of successfully finished freeplay events. More...
 
const CampaignDefinitiongetCampaignDefinition () const
 Return campaign definition. More...
 
bool isValidForEdition () const
 Check if this campaign progress is valid for the running game edition. More...
 
bool loadProgress (const std::string &filename)
 Load campaign progress from disk. More...
 
bool saveProgress (const std::string &filename)
 Save campaign progress to disk. More...
 
void serialize (qsf::BinarySerializer &serializer)
 Serialization of the campaign progress. More...
 

Static Public Member Functions

static std::string getAbsoluteCampaignFilename (const std::string &filename)
 

Static Public Attributes

static const std::string AUTOSAVE_FILENAME
 

Detailed Description

EMERGENCY 5 campaign progress class.

Remarks
This class is used for both save games and automatically created campaign progress. A campaign progress instance stores the progress data of only a single campaign.

Member Typedef Documentation

typedef boost::container::flat_set<qsf::NamedIdentifier> em5::CampaignProgress::NameSet

Constructor & Destructor Documentation

em5::CampaignProgress::CampaignProgress ( )

Default constructor.

em5::CampaignProgress::CampaignProgress ( uint32  campaignIndex)
explicit

Constructor.

virtual em5::CampaignProgress::~CampaignProgress ( )
virtual

Destructor.

Member Function Documentation

void em5::CampaignProgress::addBoughtUnit ( const std::string &  unitName)
inline

Add a bought unit to the list.

void em5::CampaignProgress::addBoughtUpgrade ( const std::string &  upgradeName)
inline

Add a bought upgrade to the list.

void em5::CampaignProgress::clearBoughtUnits ( )
inline

Clears the list of already bought units (of a freeplay phase)

void em5::CampaignProgress::clearBoughtUpgrades ( )
inline

Clears the list of already bought upgrades (of a freeplay phase)

static std::string em5::CampaignProgress::getAbsoluteCampaignFilename ( const std::string &  filename)
static
const std::vector< std::string > & em5::CampaignProgress::getBoughtUnitList ( )
inline

Returns the list of already bought units (of a freeplay phase)

const std::vector< std::string > & em5::CampaignProgress::getBoughtUpgradeList ( )
inline

Returns the list of already bought upgrades.

const CampaignDefinition & em5::CampaignProgress::getCampaignDefinition ( ) const
inline

Return campaign definition.

uint32 em5::CampaignProgress::getCampaignIndex ( ) const
inline

Returns the campaign index.

uint32 em5::CampaignProgress::getCurrentCredits ( ) const
inline

Returns the current credit amount.

uint32 em5::CampaignProgress::getCurrentMapIndex ( ) const
inline

Returns the current map index inside the campaign.

uint32 em5::CampaignProgress::getCurrentPhaseIndex ( ) const
inline

Returns the current phase index.

uint32 em5::CampaignProgress::getFinishedFreeplayEventsCount ( ) const
inline

Returns the number of successfully finished freeplay events.

const qsf::NamedIdentifier & em5::CampaignProgress::getLastMainEvent ( ) const
inline

Returns the last completed mainevent.

int32 em5::CampaignProgress::getLastStandardEventIndex ( ) const
inline

Returns the last completed standard event index in the current freeplay phase.

bool em5::CampaignProgress::isValidForEdition ( ) const

Check if this campaign progress is valid for the running game edition.

bool em5::CampaignProgress::loadProgress ( const std::string &  filename)

Load campaign progress from disk.

Parameters
[in]filenameThe filename from which the progress should be loaded (must be an absolute path); if empty, the default filename is used
bool em5::CampaignProgress::saveProgress ( const std::string &  filename)

Save campaign progress to disk.

Parameters
[in]filenameThe filename to which the progress should be saved (must be an absolute path); if empty, the default filename is used
void em5::CampaignProgress::serialize ( qsf::BinarySerializer serializer)

Serialization of the campaign progress.

void em5::CampaignProgress::setCampaignIndex ( uint32  campaignIndex)

Set the campaign index.

void em5::CampaignProgress::setCurrentCredits ( uint32  creditsAmount)
inline

Set the current credit amount.

void em5::CampaignProgress::setCurrentMapIndex ( uint32  index)
inline

Set the current map index inside the campaign.

void em5::CampaignProgress::setCurrentPhaseIndex ( uint32  phaseIndex)
inline

Set the current phase index.

void em5::CampaignProgress::setFinishedFreeplayEventsCount ( uint32  number)
inline

Set the number of successfully finished freeplay events.

void em5::CampaignProgress::setLastMainEvent ( const qsf::NamedIdentifier mainevent)
inline

Set the last completed main event.

void em5::CampaignProgress::setLastStandardEventIndex ( int32  eventIndex)
inline

Set the last completed standard event index in the current freeplay phase.

Member Data Documentation

const std::string em5::CampaignProgress::AUTOSAVE_FILENAME
static

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