OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4SHead Class Reference

#include <C4Scenario.h>

Collaboration diagram for C4SHead:
[legend]

Public Member Functions

void Default ()
 
void CompileFunc (StdCompiler *pComp, bool fSection)
 

Public Attributes

int32_t C4XVer [2]
 
std::string Title
 
std::string Loader
 
std::string Font
 
int32_t Difficulty
 
int32_t Icon
 
bool NoInitialize
 
int32_t MaxPlayer
 
int32_t MinPlayer
 
int32_t MaxPlayerLeague
 
bool SaveGame
 
bool Replay
 
int32_t Film
 
int32_t RandomSeed
 
std::string Engine
 
std::string MissionAccess
 
bool Secret
 
bool NetworkGame
 
bool NetworkRuntimeJoin
 
StdCopyStrBuf Origin
 

Detailed Description

Definition at line 60 of file C4Scenario.h.

Member Function Documentation

void C4SHead::CompileFunc ( StdCompiler pComp,
bool  fSection 
)

Definition at line 180 of file C4Scenario.cpp.

References AltDirectorySeparator, C4S_MaxPlayerDefault, C4XVer, Difficulty, DirectorySeparator, Engine, Film, Font, Icon, StdCompiler::isDeserializer(), Loader, MaxPlayer, MaxPlayerLeague, MinPlayer, MissionAccess, mkArrayAdaptDM, mkNamingAdapt(), mkParAdapt(), mkStrValAdapt(), NetworkGame, NetworkRuntimeJoin, NoInitialize, Origin, RandomSeed, StdCompiler::RCT_All, StdStrBuf::ReplaceChar(), Replay, SaveGame, Secret, Title, C4InVal::VAL_SubPathFilename, and StdCompiler::Value().

181 {
182  if (!fSection)
183  {
184  pComp->Value(mkNamingAdapt(Icon, "Icon", 18));
185  pComp->Value(mkNamingAdapt(Title, "Title", "Default Title"));
186  pComp->Value(mkNamingAdapt(Loader, "Loader", ""));
187  pComp->Value(mkNamingAdapt(Font, "Font", ""));
188  pComp->Value(mkNamingAdapt(mkArrayAdaptDM(C4XVer,0), "Version" ));
189  pComp->Value(mkNamingAdapt(Difficulty, "Difficulty", 0));
190  pComp->Value(mkNamingAdapt(MaxPlayer, "MaxPlayer", C4S_MaxPlayerDefault));
191  pComp->Value(mkNamingAdapt(MaxPlayerLeague, "MaxPlayerLeague", MaxPlayer));
192  pComp->Value(mkNamingAdapt(MinPlayer, "MinPlayer", 0));
193  pComp->Value(mkNamingAdapt(SaveGame, "SaveGame", false));
194  pComp->Value(mkNamingAdapt(Replay, "Replay", false));
195  pComp->Value(mkNamingAdapt(Film, "Film", 0));
196  }
197  pComp->Value(mkNamingAdapt(NoInitialize, "NoInitialize", false));
198  pComp->Value(mkNamingAdapt(RandomSeed, "RandomSeed", 0));
199  if (!fSection)
200  {
201  pComp->Value(mkNamingAdapt(Engine, "Engine", ""));
202  pComp->Value(mkNamingAdapt(MissionAccess, "MissionAccess", ""));
203  pComp->Value(mkNamingAdapt(Secret, "Secret", false));
204  pComp->Value(mkNamingAdapt(NetworkGame, "NetworkGame", false));
205  pComp->Value(mkNamingAdapt(NetworkRuntimeJoin, "NetworkRuntimeJoin", false));
207  // windows needs backslashes in Origin; other systems use forward slashes
208  if (pComp->isDeserializer())
209  {
211  }
212  }
213 }
const int32_t C4S_MaxPlayerDefault
Definition: C4Scenario.cpp:157
StdCopyStrBuf Origin
Definition: C4Scenario.h:80
int32_t Icon
Definition: C4Scenario.h:68
bool NetworkRuntimeJoin
Definition: C4Scenario.h:79
int32_t MinPlayer
Definition: C4Scenario.h:70
std::string Loader
Definition: C4Scenario.h:65
std::string MissionAccess
Definition: C4Scenario.h:76
bool Replay
Definition: C4Scenario.h:72
std::string Title
Definition: C4Scenario.h:64
C4StrValAdapt< T > mkStrValAdapt(T &&rValue, C4InVal::ValidationOption eValType)
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
#define AltDirectorySeparator
bool SaveGame
Definition: C4Scenario.h:71
int32_t MaxPlayer
Definition: C4Scenario.h:70
int32_t C4XVer[2]
Definition: C4Scenario.h:63
bool NetworkGame
Definition: C4Scenario.h:78
void Value(const T &rStruct)
Definition: StdCompiler.h:161
int ReplaceChar(char cOld, char cNew)
Definition: StdBuf.cpp:336
#define mkArrayAdaptDM(A, D)
Definition: StdAdaptors.h:363
virtual bool isDeserializer()
Definition: StdCompiler.h:53
std::string Font
Definition: C4Scenario.h:66
bool Secret
Definition: C4Scenario.h:77
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:458
int32_t Difficulty
Definition: C4Scenario.h:67
std::string Engine
Definition: C4Scenario.h:75
#define DirectorySeparator
bool NoInitialize
Definition: C4Scenario.h:69
int32_t MaxPlayerLeague
Definition: C4Scenario.h:70
int32_t RandomSeed
Definition: C4Scenario.h:74
int32_t Film
Definition: C4Scenario.h:73

Here is the call graph for this function:

void C4SHead::Default ( )

Definition at line 159 of file C4Scenario.cpp.

References C4S_MaxPlayerDefault, C4XVer, StdStrBuf::Clear(), Difficulty, Engine, Film, Font, Icon, Loader, MaxPlayer, MaxPlayerLeague, MinPlayer, MissionAccess, NetworkGame, NetworkRuntimeJoin, NoInitialize, Origin, RandomSeed, Replay, SaveGame, Secret, and Title.

Referenced by C4Scenario::Default().

160 {
161  Origin.Clear();
162  Icon=18;
163  Title.clear();
164  Loader.clear();
165  Font.clear();
166  Engine.clear();
167  MissionAccess.clear();
168  Secret = false;
169  C4XVer[0] = C4XVer[1] = 0;
170  Difficulty = RandomSeed = 0;
171  SaveGame = Replay = NoInitialize = false;
172  Film = 0;
174 
176  MinPlayer=0; // auto-determine by mode
177  Title = "Default Title";
178 }
const int32_t C4S_MaxPlayerDefault
Definition: C4Scenario.cpp:157
StdCopyStrBuf Origin
Definition: C4Scenario.h:80
int32_t Icon
Definition: C4Scenario.h:68
bool NetworkRuntimeJoin
Definition: C4Scenario.h:79
int32_t MinPlayer
Definition: C4Scenario.h:70
std::string Loader
Definition: C4Scenario.h:65
std::string MissionAccess
Definition: C4Scenario.h:76
void Clear()
Definition: StdBuf.h:466
bool Replay
Definition: C4Scenario.h:72
std::string Title
Definition: C4Scenario.h:64
bool SaveGame
Definition: C4Scenario.h:71
int32_t MaxPlayer
Definition: C4Scenario.h:70
int32_t C4XVer[2]
Definition: C4Scenario.h:63
bool NetworkGame
Definition: C4Scenario.h:78
std::string Font
Definition: C4Scenario.h:66
bool Secret
Definition: C4Scenario.h:77
int32_t Difficulty
Definition: C4Scenario.h:67
std::string Engine
Definition: C4Scenario.h:75
bool NoInitialize
Definition: C4Scenario.h:69
int32_t MaxPlayerLeague
Definition: C4Scenario.h:70
int32_t RandomSeed
Definition: C4Scenario.h:74
int32_t Film
Definition: C4Scenario.h:73

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int32_t C4SHead::C4XVer[2]

Definition at line 63 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::OpenScenario().

int32_t C4SHead::Difficulty

Definition at line 67 of file C4Scenario.h.

Referenced by CompileFunc(), and Default().

std::string C4SHead::Engine

Definition at line 75 of file C4Scenario.h.

Referenced by CompileFunc(), and Default().

std::string C4SHead::Font

Definition at line 66 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4GraphicsResource::InitFonts().

std::string C4SHead::Loader

Definition at line 65 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::Init().

int32_t C4SHead::MaxPlayer

Definition at line 70 of file C4Scenario.h.

Referenced by CompileFunc(), C4GameParameters::CompileFunc(), and Default().

int32_t C4SHead::MaxPlayerLeague

Definition at line 70 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4GameParameters::EnforceLeagueRules().

int32_t C4SHead::MinPlayer

Definition at line 70 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Scenario::GetMinPlayer().

std::string C4SHead::MissionAccess

Definition at line 76 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::OpenScenario().

bool C4SHead::NoInitialize

Definition at line 69 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitGame().

int32_t C4SHead::RandomSeed

Definition at line 74 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitControl().

bool C4SHead::Secret

Definition at line 77 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4ScenarioListLoader::Scenario::IsHidden().

std::string C4SHead::Title

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