Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Campaign Class Reference

#include <Campaign.h>

List of all members.

Public Types

enum  CONSTANTS {
  TRAINING_CAMPAIGN = 1, DYNAMIC_CAMPAIGN, MOD_CAMPAIGN = 100, SINGLE_MISSIONS = 1000,
  MULTIPLAYER_MISSIONS, CUSTOM_MISSIONS, NUM_IMAGES = 6
}
enum  STATUS { CAMPAIGN_INIT, CAMPAIGN_ACTIVE, CAMPAIGN_SUCCESS, CAMPAIGN_FAILED }

Public Member Functions

 Campaign (int id, const char *name=0)
 Campaign (int id, const char *name, const char *path)
virtual ~Campaign ()
int operator== (const Campaign &s) const
int operator< (const Campaign &s) const
virtual void Load ()
virtual void Prep ()
virtual void Start ()
virtual void ExecFrame ()
virtual void Unload ()
virtual void Clear ()
virtual void CommitExpiredActions ()
virtual void LockoutEvents (int seconds)
virtual void CheckPlayerGroup ()
void CreatePlanners ()
const char * Name () const
const char * Description () const
const char * Path () const
const char * Situation () const
const char * Orders () const
void SetSituation (const char *s)
void SetOrders (const char *o)
int GetPlayerTeamScore ()
List< MissionInfo > & GetMissionList ()
List< Combatant > & GetCombatants ()
List< CombatZone > & GetZones ()
List< StarSystem > & GetSystemList ()
List< CombatAction > & GetActions ()
List< CombatEvent > & GetEvents ()
CombatEventGetLastEvent ()
CombatActionFindAction (int id)
int CountNewEvents () const
int GetPlayerIFF ()
CombatGroupGetPlayerGroup ()
void SetPlayerGroup (CombatGroup *pg)
CombatUnitGetPlayerUnit ()
void SetPlayerUnit (CombatUnit *pu)
CombatantGetCombatant (const char *name)
CombatGroupFindGroup (int iff, int type, int id)
CombatGroupFindGroup (int iff, int type, CombatGroup *near_group=0)
CombatGroupFindStrikeTarget (int iff, CombatGroup *strike_group)
StarSystemGetSystem (const char *sys)
CombatZoneGetZone (const char *rgn)
MissionInfoCreateNewMission ()
void DeleteMission (int id)
MissionGetMission ()
MissionGetMission (int id)
MissionGetMissionByFile (const char *filename)
MissionInfoGetMissionInfo (int id)
MissionInfoFindMissionTemplate (int msn_type, CombatGroup *player_group)
void ReloadMission (int id)
void LoadNetMission (int id, const char *net_mission)
void StartMission ()
void RollbackMission ()
void SetCampaignId (int id)
int GetCampaignId () const
void SetMissionId (int id)
int GetMissionId () const
BitmapGetImage (int n)
double GetTime () const
double GetStartTime () const
void SetStartTime (double t)
double GetLoadTime () const
void SetLoadTime (double t)
double GetUpdateTime () const
void SetUpdateTime (double t)
bool InCutscene () const
bool IsDynamic () const
bool IsTraining () const
bool IsScripted () const
bool IsSequential () const
bool IsSaveGame () const
void SetSaveGame (bool s)
bool IsActive () const
bool IsComplete () const
bool IsFailed () const
void SetStatus (int s)
int GetStatus () const
int GetAllCombatUnits (int iff, List< CombatUnit > &units)

Static Public Member Functions

static const char * TYPENAME ()
static void Initialize ()
static void Close ()
static CampaignGetCampaign ()
static List< Campaign > & GetAllCampaigns ()
static int GetLastCampaignId ()
static CampaignSelectCampaign (const char *name)
static CampaignCreateCustomCampaign (const char *name, const char *path)
static double Stardate ()

Protected Member Functions

void LoadCampaign (DataLoader *loader, bool full=false)
void LoadTemplateList (DataLoader *loader)
void LoadMissionList (DataLoader *loader)
void LoadCustomMissions (DataLoader *loader)
void ParseGroup (TermStruct *val, CombatGroup *force, CombatGroup *clone, const char *filename)
void ParseAction (TermStruct *val, const char *filename)
CombatGroupCloneOver (CombatGroup *force, CombatGroup *clone, CombatGroup *group)
void SelectDefaultPlayerGroup (CombatGroup *g, int type)
TemplateListGetTemplateList (int msn_type, int grp_type)

Protected Attributes

int campaign_id
int status
char filename [64]
char path [64]
Text name
Text description
Text situation
Text orders
Bitmap image [NUM_IMAGES]
bool scripted
bool sequential
bool loaded_from_savegame
List< Combatantcombatants
List< StarSystemsystems
List< CombatZonezones
List< CampaignPlanplanners
List< MissionInfomissions
List< TemplateListtemplates
List< CombatActionactions
List< CombatEventevents
CombatGroupplayer_group
CombatUnitplayer_unit
int mission_id
Missionmission
Missionnet_mission
double time
double loadTime
double startTime
double updateTime
int lockout

Detailed Description

Definition at line 95 of file Campaign.h.


Member Enumeration Documentation

Enumerator:
TRAINING_CAMPAIGN 
DYNAMIC_CAMPAIGN 
MOD_CAMPAIGN 
SINGLE_MISSIONS 
MULTIPLAYER_MISSIONS 
CUSTOM_MISSIONS 
NUM_IMAGES 

Definition at line 100 of file Campaign.h.

Enumerator:
CAMPAIGN_INIT 
CAMPAIGN_ACTIVE 
CAMPAIGN_SUCCESS 
CAMPAIGN_FAILED 

Definition at line 111 of file Campaign.h.


Constructor & Destructor Documentation

Campaign::Campaign ( int  id,
const char *  name = 0 
)

Definition at line 110 of file Campaign.cpp.

Campaign::Campaign ( int  id,
const char *  name,
const char *  path 
)

Definition at line 120 of file Campaign.cpp.

Campaign::~Campaign ( )
virtual

Definition at line 133 of file Campaign.cpp.


Member Function Documentation

void Campaign::CheckPlayerGroup ( )
virtual

Definition at line 2009 of file Campaign.cpp.

void Campaign::Clear ( )
virtual

Definition at line 310 of file Campaign.cpp.

CombatGroup * Campaign::CloneOver ( CombatGroup force,
CombatGroup clone,
CombatGroup group 
)
protected

Definition at line 938 of file Campaign.cpp.

void Campaign::Close ( )
static

Definition at line 193 of file Campaign.cpp.

void Campaign::CommitExpiredActions ( )
virtual

Definition at line 2240 of file Campaign.cpp.

int Campaign::CountNewEvents ( ) const

Definition at line 296 of file Campaign.cpp.

Campaign * Campaign::CreateCustomCampaign ( const char *  name,
const char *  path 
)
static

Definition at line 229 of file Campaign.cpp.

MissionInfo * Campaign::CreateNewMission ( )

Definition at line 1624 of file Campaign.cpp.

void Campaign::CreatePlanners ( )

Definition at line 1382 of file Campaign.cpp.

void Campaign::DeleteMission ( int  id)

Definition at line 1660 of file Campaign.cpp.

const char* Campaign::Description ( ) const
inline

Definition at line 140 of file Campaign.h.

void Campaign::ExecFrame ( )
virtual

Definition at line 1916 of file Campaign.cpp.

CombatAction * Campaign::FindAction ( int  id)

Definition at line 1761 of file Campaign.cpp.

CombatGroup * Campaign::FindGroup ( int  iff,
int  type,
int  id 
)

Definition at line 2146 of file Campaign.cpp.

CombatGroup * Campaign::FindGroup ( int  iff,
int  type,
CombatGroup near_group = 0 
)

Definition at line 2176 of file Campaign.cpp.

MissionInfo * Campaign::FindMissionTemplate ( int  msn_type,
CombatGroup player_group 
)

Definition at line 1777 of file Campaign.cpp.

CombatGroup * Campaign::FindStrikeTarget ( int  iff,
CombatGroup strike_group 
)

Definition at line 2216 of file Campaign.cpp.

List<CombatAction>& Campaign::GetActions ( )
inline

Definition at line 154 of file Campaign.h.

List< Campaign > & Campaign::GetAllCampaigns ( )
static

Definition at line 259 of file Campaign.cpp.

int Campaign::GetAllCombatUnits ( int  iff,
List< CombatUnit > &  units 
)

Definition at line 2332 of file Campaign.cpp.

Campaign * Campaign::GetCampaign ( )
static

Definition at line 201 of file Campaign.cpp.

int Campaign::GetCampaignId ( ) const
inline

Definition at line 188 of file Campaign.h.

Combatant * Campaign::GetCombatant ( const char *  name)

Definition at line 1495 of file Campaign.cpp.

List<Combatant>& Campaign::GetCombatants ( )
inline

Definition at line 151 of file Campaign.h.

List<CombatEvent>& Campaign::GetEvents ( )
inline

Definition at line 155 of file Campaign.h.

Bitmap* Campaign::GetImage ( int  n)
inline

Definition at line 191 of file Campaign.h.

int Campaign::GetLastCampaignId ( )
static

Definition at line 265 of file Campaign.cpp.

CombatEvent * Campaign::GetLastEvent ( )

Definition at line 283 of file Campaign.cpp.

double Campaign::GetLoadTime ( ) const
inline

Definition at line 195 of file Campaign.h.

Mission * Campaign::GetMission ( )

Definition at line 1510 of file Campaign.cpp.

Mission * Campaign::GetMission ( int  id)

Definition at line 1516 of file Campaign.cpp.

Mission * Campaign::GetMissionByFile ( const char *  filename)

Definition at line 1560 of file Campaign.cpp.

int Campaign::GetMissionId ( ) const
inline

Definition at line 190 of file Campaign.h.

MissionInfo * Campaign::GetMissionInfo ( int  id)

Definition at line 1695 of file Campaign.cpp.

List<MissionInfo>& Campaign::GetMissionList ( )
inline

Definition at line 150 of file Campaign.h.

CombatGroup* Campaign::GetPlayerGroup ( )
inline

Definition at line 163 of file Campaign.h.

int Campaign::GetPlayerIFF ( )

Definition at line 1420 of file Campaign.cpp.

int Campaign::GetPlayerTeamScore ( )

Definition at line 2256 of file Campaign.cpp.

CombatUnit* Campaign::GetPlayerUnit ( )
inline

Definition at line 165 of file Campaign.h.

double Campaign::GetStartTime ( ) const
inline

Definition at line 193 of file Campaign.h.

int Campaign::GetStatus ( ) const
inline

Definition at line 212 of file Campaign.h.

StarSystem * Campaign::GetSystem ( const char *  sys)

Definition at line 1489 of file Campaign.cpp.

List<StarSystem>& Campaign::GetSystemList ( )
inline

Definition at line 153 of file Campaign.h.

TemplateList * Campaign::GetTemplateList ( int  msn_type,
int  grp_type 
)
protected

Definition at line 1824 of file Campaign.cpp.

double Campaign::GetTime ( ) const
inline

Definition at line 192 of file Campaign.h.

double Campaign::GetUpdateTime ( ) const
inline

Definition at line 197 of file Campaign.h.

CombatZone * Campaign::GetZone ( const char *  rgn)

Definition at line 1477 of file Campaign.cpp.

List<CombatZone>& Campaign::GetZones ( )
inline

Definition at line 152 of file Campaign.h.

bool Campaign::InCutscene ( ) const

Definition at line 2098 of file Campaign.cpp.

void Campaign::Initialize ( )
static

Definition at line 152 of file Campaign.cpp.

bool Campaign::IsActive ( ) const
inline

Definition at line 208 of file Campaign.h.

bool Campaign::IsComplete ( ) const
inline

Definition at line 209 of file Campaign.h.

bool Campaign::IsDynamic ( ) const

Definition at line 2105 of file Campaign.cpp.

bool Campaign::IsFailed ( ) const
inline

Definition at line 210 of file Campaign.h.

bool Campaign::IsSaveGame ( ) const
inline

Definition at line 205 of file Campaign.h.

bool Campaign::IsScripted ( ) const

Definition at line 2118 of file Campaign.cpp.

bool Campaign::IsSequential ( ) const

Definition at line 2124 of file Campaign.cpp.

bool Campaign::IsTraining ( ) const

Definition at line 2112 of file Campaign.cpp.

void Campaign::Load ( )
virtual

Definition at line 327 of file Campaign.cpp.

void Campaign::LoadCampaign ( DataLoader loader,
bool  full = false 
)
protected

Definition at line 428 of file Campaign.cpp.

void Campaign::LoadCustomMissions ( DataLoader loader)
protected

Definition at line 1088 of file Campaign.cpp.

void Campaign::LoadMissionList ( DataLoader loader)
protected

Definition at line 965 of file Campaign.cpp.

void Campaign::LoadNetMission ( int  id,
const char *  net_mission 
)

Definition at line 1742 of file Campaign.cpp.

void Campaign::LoadTemplateList ( DataLoader loader)
protected

Definition at line 1221 of file Campaign.cpp.

void Campaign::LockoutEvents ( int  seconds)
virtual

Definition at line 2003 of file Campaign.cpp.

const char* Campaign::Name ( ) const
inline

Definition at line 139 of file Campaign.h.

int Campaign::operator< ( const Campaign s) const
inline

Definition at line 123 of file Campaign.h.

int Campaign::operator== ( const Campaign s) const
inline

Definition at line 122 of file Campaign.h.

const char* Campaign::Orders ( ) const
inline

Definition at line 144 of file Campaign.h.

void Campaign::ParseAction ( TermStruct val,
const char *  filename 
)
protected

Definition at line 608 of file Campaign.cpp.

void Campaign::ParseGroup ( TermStruct val,
CombatGroup force,
CombatGroup clone,
const char *  filename 
)
protected

Definition at line 566 of file Campaign.cpp.

const char* Campaign::Path ( ) const
inline

Definition at line 141 of file Campaign.h.

void Campaign::Prep ( )
virtual

Definition at line 1876 of file Campaign.cpp.

void Campaign::ReloadMission ( int  id)

Definition at line 1725 of file Campaign.cpp.

void Campaign::RollbackMission ( )

Definition at line 2070 of file Campaign.cpp.

Campaign * Campaign::SelectCampaign ( const char *  name)
static

Definition at line 207 of file Campaign.cpp.

void Campaign::SelectDefaultPlayerGroup ( CombatGroup g,
int  type 
)
protected

Definition at line 1859 of file Campaign.cpp.

void Campaign::SetCampaignId ( int  id)
void Campaign::SetLoadTime ( double  t)
inline

Definition at line 196 of file Campaign.h.

void Campaign::SetMissionId ( int  id)

Definition at line 1838 of file Campaign.cpp.

void Campaign::SetOrders ( const char *  o)
inline

Definition at line 147 of file Campaign.h.

void Campaign::SetPlayerGroup ( CombatGroup pg)

Definition at line 1431 of file Campaign.cpp.

void Campaign::SetPlayerUnit ( CombatUnit pu)

Definition at line 1452 of file Campaign.cpp.

void Campaign::SetSaveGame ( bool  s)
inline

Definition at line 206 of file Campaign.h.

void Campaign::SetSituation ( const char *  s)
inline

Definition at line 146 of file Campaign.h.

void Campaign::SetStartTime ( double  t)
inline

Definition at line 194 of file Campaign.h.

void Campaign::SetStatus ( int  s)

Definition at line 2290 of file Campaign.cpp.

void Campaign::SetUpdateTime ( double  t)
inline

Definition at line 198 of file Campaign.h.

const char* Campaign::Situation ( ) const
inline

Definition at line 143 of file Campaign.h.

double Campaign::Stardate ( )
static

Definition at line 1851 of file Campaign.cpp.

void Campaign::Start ( )
virtual

Definition at line 1904 of file Campaign.cpp.

void Campaign::StartMission ( )

Definition at line 2041 of file Campaign.cpp.

static const char* Campaign::TYPENAME ( )
inlinestatic

Definition at line 98 of file Campaign.h.

void Campaign::Unload ( )
virtual

Definition at line 408 of file Campaign.cpp.


Member Data Documentation

List<CombatAction> Campaign::actions
protected

Definition at line 265 of file Campaign.h.

int Campaign::campaign_id
protected

Definition at line 245 of file Campaign.h.

List<Combatant> Campaign::combatants
protected

Definition at line 259 of file Campaign.h.

Text Campaign::description
protected

Definition at line 250 of file Campaign.h.

List<CombatEvent> Campaign::events
protected

Definition at line 266 of file Campaign.h.

char Campaign::filename[64]
protected

Definition at line 247 of file Campaign.h.

Bitmap Campaign::image[NUM_IMAGES]
protected

Definition at line 253 of file Campaign.h.

bool Campaign::loaded_from_savegame
protected

Definition at line 257 of file Campaign.h.

double Campaign::loadTime
protected

Definition at line 275 of file Campaign.h.

int Campaign::lockout
protected

Definition at line 278 of file Campaign.h.

Mission* Campaign::mission
protected

Definition at line 271 of file Campaign.h.

int Campaign::mission_id
protected

Definition at line 270 of file Campaign.h.

List<MissionInfo> Campaign::missions
protected

Definition at line 263 of file Campaign.h.

Text Campaign::name
protected

Definition at line 249 of file Campaign.h.

Mission* Campaign::net_mission
protected

Definition at line 272 of file Campaign.h.

Text Campaign::orders
protected

Definition at line 252 of file Campaign.h.

char Campaign::path[64]
protected

Definition at line 248 of file Campaign.h.

List<CampaignPlan> Campaign::planners
protected

Definition at line 262 of file Campaign.h.

CombatGroup* Campaign::player_group
protected

Definition at line 267 of file Campaign.h.

CombatUnit* Campaign::player_unit
protected

Definition at line 268 of file Campaign.h.

bool Campaign::scripted
protected

Definition at line 255 of file Campaign.h.

bool Campaign::sequential
protected

Definition at line 256 of file Campaign.h.

Text Campaign::situation
protected

Definition at line 251 of file Campaign.h.

double Campaign::startTime
protected

Definition at line 276 of file Campaign.h.

int Campaign::status
protected

Definition at line 246 of file Campaign.h.

List<StarSystem> Campaign::systems
protected

Definition at line 260 of file Campaign.h.

List<TemplateList> Campaign::templates
protected

Definition at line 264 of file Campaign.h.

double Campaign::time
protected

Definition at line 274 of file Campaign.h.

double Campaign::updateTime
protected

Definition at line 277 of file Campaign.h.

List<CombatZone> Campaign::zones
protected

Definition at line 261 of file Campaign.h.


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