Starshatter_Open
Open source Starshatter engine
|
#include <Campaign.h>
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 () |
CombatEvent * | GetLastEvent () |
CombatAction * | FindAction (int id) |
int | CountNewEvents () const |
int | GetPlayerIFF () |
CombatGroup * | GetPlayerGroup () |
void | SetPlayerGroup (CombatGroup *pg) |
CombatUnit * | GetPlayerUnit () |
void | SetPlayerUnit (CombatUnit *pu) |
Combatant * | GetCombatant (const char *name) |
CombatGroup * | FindGroup (int iff, int type, int id) |
CombatGroup * | FindGroup (int iff, int type, CombatGroup *near_group=0) |
CombatGroup * | FindStrikeTarget (int iff, CombatGroup *strike_group) |
StarSystem * | GetSystem (const char *sys) |
CombatZone * | GetZone (const char *rgn) |
MissionInfo * | CreateNewMission () |
void | DeleteMission (int id) |
Mission * | GetMission () |
Mission * | GetMission (int id) |
Mission * | GetMissionByFile (const char *filename) |
MissionInfo * | GetMissionInfo (int id) |
MissionInfo * | FindMissionTemplate (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 |
Bitmap * | GetImage (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 Campaign * | GetCampaign () |
static List< Campaign > & | GetAllCampaigns () |
static int | GetLastCampaignId () |
static Campaign * | SelectCampaign (const char *name) |
static Campaign * | CreateCustomCampaign (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) |
CombatGroup * | CloneOver (CombatGroup *force, CombatGroup *clone, CombatGroup *group) |
void | SelectDefaultPlayerGroup (CombatGroup *g, int type) |
TemplateList * | GetTemplateList (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< Combatant > | combatants |
List< StarSystem > | systems |
List< CombatZone > | zones |
List< CampaignPlan > | planners |
List< MissionInfo > | missions |
List< TemplateList > | templates |
List< CombatAction > | actions |
List< CombatEvent > | events |
CombatGroup * | player_group |
CombatUnit * | player_unit |
int | mission_id |
Mission * | mission |
Mission * | net_mission |
double | time |
double | loadTime |
double | startTime |
double | updateTime |
int | lockout |
Definition at line 95 of file Campaign.h.
enum Campaign::CONSTANTS |
TRAINING_CAMPAIGN | |
DYNAMIC_CAMPAIGN | |
MOD_CAMPAIGN | |
SINGLE_MISSIONS | |
MULTIPLAYER_MISSIONS | |
CUSTOM_MISSIONS | |
NUM_IMAGES |
Definition at line 100 of file Campaign.h.
enum Campaign::STATUS |
Definition at line 111 of file Campaign.h.
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.
|
virtual |
Definition at line 133 of file Campaign.cpp.
|
virtual |
Definition at line 2009 of file Campaign.cpp.
|
virtual |
Definition at line 310 of file Campaign.cpp.
|
protected |
Definition at line 938 of file Campaign.cpp.
|
static |
Definition at line 193 of file Campaign.cpp.
|
virtual |
Definition at line 2240 of file Campaign.cpp.
int Campaign::CountNewEvents | ( | ) | const |
Definition at line 296 of file Campaign.cpp.
|
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.
|
inline |
Definition at line 140 of file Campaign.h.
|
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.
|
inline |
Definition at line 154 of file Campaign.h.
Definition at line 259 of file Campaign.cpp.
int Campaign::GetAllCombatUnits | ( | int | iff, |
List< CombatUnit > & | units | ||
) |
Definition at line 2332 of file Campaign.cpp.
|
static |
Definition at line 201 of file Campaign.cpp.
|
inline |
Definition at line 188 of file Campaign.h.
Combatant * Campaign::GetCombatant | ( | const char * | name | ) |
Definition at line 1495 of file Campaign.cpp.
Definition at line 151 of file Campaign.h.
|
inline |
Definition at line 155 of file Campaign.h.
|
inline |
Definition at line 191 of file Campaign.h.
|
static |
Definition at line 265 of file Campaign.cpp.
CombatEvent * Campaign::GetLastEvent | ( | ) |
Definition at line 283 of file Campaign.cpp.
|
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.
|
inline |
Definition at line 190 of file Campaign.h.
MissionInfo * Campaign::GetMissionInfo | ( | int | id | ) |
Definition at line 1695 of file Campaign.cpp.
|
inline |
Definition at line 150 of file Campaign.h.
|
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.
|
inline |
Definition at line 165 of file Campaign.h.
|
inline |
Definition at line 193 of file Campaign.h.
|
inline |
Definition at line 212 of file Campaign.h.
StarSystem * Campaign::GetSystem | ( | const char * | sys | ) |
Definition at line 1489 of file Campaign.cpp.
|
inline |
Definition at line 153 of file Campaign.h.
|
protected |
Definition at line 1824 of file Campaign.cpp.
|
inline |
Definition at line 192 of file Campaign.h.
|
inline |
Definition at line 197 of file Campaign.h.
CombatZone * Campaign::GetZone | ( | const char * | rgn | ) |
Definition at line 1477 of file Campaign.cpp.
|
inline |
Definition at line 152 of file Campaign.h.
bool Campaign::InCutscene | ( | ) | const |
Definition at line 2098 of file Campaign.cpp.
|
static |
Definition at line 152 of file Campaign.cpp.
|
inline |
Definition at line 208 of file Campaign.h.
|
inline |
Definition at line 209 of file Campaign.h.
bool Campaign::IsDynamic | ( | ) | const |
Definition at line 2105 of file Campaign.cpp.
|
inline |
Definition at line 210 of file Campaign.h.
|
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.
|
virtual |
Definition at line 327 of file Campaign.cpp.
|
protected |
Definition at line 428 of file Campaign.cpp.
|
protected |
Definition at line 1088 of file Campaign.cpp.
|
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.
|
protected |
Definition at line 1221 of file Campaign.cpp.
|
virtual |
Definition at line 2003 of file Campaign.cpp.
|
inline |
Definition at line 139 of file Campaign.h.
|
inline |
Definition at line 123 of file Campaign.h.
|
inline |
Definition at line 122 of file Campaign.h.
|
inline |
Definition at line 144 of file Campaign.h.
|
protected |
Definition at line 608 of file Campaign.cpp.
|
protected |
Definition at line 566 of file Campaign.cpp.
|
inline |
Definition at line 141 of file Campaign.h.
|
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.
|
static |
Definition at line 207 of file Campaign.cpp.
|
protected |
Definition at line 1859 of file Campaign.cpp.
void Campaign::SetCampaignId | ( | int | id | ) |
|
inline |
Definition at line 196 of file Campaign.h.
void Campaign::SetMissionId | ( | int | id | ) |
Definition at line 1838 of file Campaign.cpp.
|
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.
|
inline |
Definition at line 206 of file Campaign.h.
|
inline |
Definition at line 146 of file Campaign.h.
|
inline |
Definition at line 194 of file Campaign.h.
void Campaign::SetStatus | ( | int | s | ) |
Definition at line 2290 of file Campaign.cpp.
|
inline |
Definition at line 198 of file Campaign.h.
|
inline |
Definition at line 143 of file Campaign.h.
|
static |
Definition at line 1851 of file Campaign.cpp.
|
virtual |
Definition at line 1904 of file Campaign.cpp.
void Campaign::StartMission | ( | ) |
Definition at line 2041 of file Campaign.cpp.
|
inlinestatic |
Definition at line 98 of file Campaign.h.
|
virtual |
Definition at line 408 of file Campaign.cpp.
|
protected |
Definition at line 265 of file Campaign.h.
|
protected |
Definition at line 245 of file Campaign.h.
Definition at line 259 of file Campaign.h.
|
protected |
Definition at line 250 of file Campaign.h.
|
protected |
Definition at line 266 of file Campaign.h.
|
protected |
Definition at line 247 of file Campaign.h.
|
protected |
Definition at line 253 of file Campaign.h.
|
protected |
Definition at line 257 of file Campaign.h.
|
protected |
Definition at line 275 of file Campaign.h.
|
protected |
Definition at line 278 of file Campaign.h.
|
protected |
Definition at line 271 of file Campaign.h.
|
protected |
Definition at line 270 of file Campaign.h.
|
protected |
Definition at line 263 of file Campaign.h.
|
protected |
Definition at line 249 of file Campaign.h.
|
protected |
Definition at line 272 of file Campaign.h.
|
protected |
Definition at line 252 of file Campaign.h.
|
protected |
Definition at line 248 of file Campaign.h.
|
protected |
Definition at line 262 of file Campaign.h.
|
protected |
Definition at line 267 of file Campaign.h.
|
protected |
Definition at line 268 of file Campaign.h.
|
protected |
Definition at line 255 of file Campaign.h.
|
protected |
Definition at line 256 of file Campaign.h.
|
protected |
Definition at line 251 of file Campaign.h.
|
protected |
Definition at line 276 of file Campaign.h.
|
protected |
Definition at line 246 of file Campaign.h.
|
protected |
Definition at line 260 of file Campaign.h.
|
protected |
Definition at line 264 of file Campaign.h.
|
protected |
Definition at line 274 of file Campaign.h.
|
protected |
Definition at line 277 of file Campaign.h.
|
protected |
Definition at line 261 of file Campaign.h.