Emergency 20 Dokumentation  4.2.0
em5::CampaignDefinition Class Reference

EMERGENCY 5 campaign definition class. More...

#include <CampaignDefinition.h>

Inheritance diagram for em5::CampaignDefinition:

Classes

struct  CampaignMap
 
struct  CampaignPhase
 

Public Types

enum  PhaseType { PHASE_TUTORIAL, PHASE_MAINEVENT, PHASE_SINGLEEVENT, PHASE_FREEPLAY }
 
typedef std::vector< CampaignPhaseCampaignPhaseArray
 

Public Member Functions

 CampaignDefinition ()
 Default constructor. More...
 
 ~CampaignDefinition ()
 Destructor. More...
 
void loadCampaignDefinition (const std::string &filename)
 Load the campaign definition from a JSON file. More...
 
const std::string & getName () const
 Return the campaign name. More...
 
const std::string & getShortName () const
 Return the campaign short-name. More...
 
const qsf::Color4getColor () const
 Return the campaign color. More...
 
const boost::property_tree::ptreegetSettings () const
 Return the settings property tree. More...
 
const CampaignMapgetCampaignMapByIndex (uint32 campaignMapIndex) const
 Return the campaign map structure for a given map index. More...
 
const CampaignMapgetCampaignMapByIdentifier (const MapIdentifier &mapIdentifier) const
 
MapIdentifier getMapIdentifierByCampaignMapIndex (uint32 campaignMapIndex) const
 Return the map identifier for a given campaign map index. More...
 
bool getCampaignPhaseIndexForMainEvent (uint32 &outCampaignPhase, uint32 &outCampaignMapIndex, const MainEventIdentifier &mainEventIdentifier) const
 Return the campaign phases for the given map. More...
 
void getAllCampaignPhasesOfType (PhaseType phaseType, std::vector< const CampaignPhase * > &outCampaignPhases) const
 Return list of all campaign phases of the given type. More...
 

Detailed Description

EMERGENCY 5 campaign definition class.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
PHASE_TUTORIAL 

Tutorial event phase: A single event must be won to continue, but can be skipped (special handling for EM5 original tutorial here!)

PHASE_MAINEVENT 

Main event phase: A single event must be won to continue, counts as main event.

PHASE_SINGLEEVENT 

Single event phase: A single event must be won to continue, does not count as main event.

PHASE_FREEPLAY 

Campaign freeplay phase: Player earns money until all buy options are bought.

Constructor & Destructor Documentation

em5::CampaignDefinition::CampaignDefinition ( )

Default constructor.

em5::CampaignDefinition::~CampaignDefinition ( )

Destructor.

Member Function Documentation

void em5::CampaignDefinition::getAllCampaignPhasesOfType ( PhaseType  phaseType,
std::vector< const CampaignPhase * > &  outCampaignPhases 
) const

Return list of all campaign phases of the given type.

const CampaignMap* em5::CampaignDefinition::getCampaignMapByIdentifier ( const MapIdentifier mapIdentifier) const
const CampaignMap* em5::CampaignDefinition::getCampaignMapByIndex ( uint32  campaignMapIndex) const

Return the campaign map structure for a given map index.

Parameters
[in]campaignMapIndexMap index inside the campaign (not the usual map index!) beginning with 0
Returns
The campaign map data, or a null pointer of map index was invalid
bool em5::CampaignDefinition::getCampaignPhaseIndexForMainEvent ( uint32 outCampaignPhase,
uint32 outCampaignMapIndex,
const MainEventIdentifier mainEventIdentifier 
) const

Return the campaign phases for the given map.

const qsf::Color4& em5::CampaignDefinition::getColor ( ) const

Return the campaign color.

MapIdentifier em5::CampaignDefinition::getMapIdentifierByCampaignMapIndex ( uint32  campaignMapIndex) const

Return the map identifier for a given campaign map index.

Parameters
[in]campaignMapIndexMap index inside the campaign (not the usual map index!) beginning with 0
Returns
The map identifier, default constructed of map index was invalid
const std::string& em5::CampaignDefinition::getName ( ) const

Return the campaign name.

const boost::property_tree::ptree& em5::CampaignDefinition::getSettings ( ) const

Return the settings property tree.

const std::string& em5::CampaignDefinition::getShortName ( ) const

Return the campaign short-name.

void em5::CampaignDefinition::loadCampaignDefinition ( const std::string &  filename)

Load the campaign definition from a JSON file.


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