OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Scenario.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Core component of a scenario file */
19 
20 #include "C4Include.h"
21 #include "landscape/C4Scenario.h"
22 
23 #include "lib/C4InputValidation.h"
24 #include "lib/C4Random.h"
25 #include "c4group/C4Group.h"
26 #include "c4group/C4Components.h"
27 #include "lib/StdColors.h"
28 
29 //==================================== C4SVal ==============================================
30 
31 C4SVal::C4SVal(int32_t std, int32_t rnd, int32_t min, int32_t max)
32  : Std(std), Rnd(rnd), Min(min), Max(max)
33 {
34 }
35 
36 void C4SVal::Set(int32_t std, int32_t rnd, int32_t min, int32_t max)
37 {
38  Std=std; Rnd=rnd; Min=min; Max=max;
39 }
40 
41 void C4SVal::SetConstant(int32_t val)
42 {
43  // Set to constant value and ensure limits allow it
44  Std = val;
45  Rnd = 0;
46  Min = std::min<int32_t>(Min, val);
47  Max = std::max<int32_t>(Max, val);
48 }
49 
51 {
52  return Clamp<int32_t>(Std+Random(2*Rnd+1)-Rnd,Min,Max);
53 }
54 
56 {
57  Set();
58 }
59 
61 {
62  pComp->Value(mkDefaultAdapt(Std, 0));
63  if (!pComp->Separator()) return;
64  pComp->Value(mkDefaultAdapt(Rnd, 0));
65  if (!pComp->Separator()) return;
66  pComp->Value(mkDefaultAdapt(Min, 0));
67  if (!pComp->Separator()) return;
68  pComp->Value(mkDefaultAdapt(Max, 100));
69 }
70 
71 //================================ C4Scenario ==========================================
72 
74 {
75  Default();
76 }
77 
79 {
80  int32_t cnt;
81  Head.Default();
83  Game.Default();
84  for (cnt=0; cnt<C4S_MaxPlayer; cnt++) PlrStart[cnt].Default();
86  Animals.Default();
87  Weather.Default();
90 }
91 
92 bool C4Scenario::Load(C4Group &hGroup, bool fLoadSection, bool suppress_errors)
93 {
94  StdStrBuf Buf;
95  if (!hGroup.LoadEntryString(C4CFN_ScenarioCore,&Buf)) return false;
96  if (!fLoadSection) Default();
97  if (suppress_errors)
98  {
99  if (!CompileFromBuf_Log<StdCompilerINIRead>(mkParAdapt(*this, fLoadSection), Buf, C4CFN_ScenarioCore))
100  {
101  return false;
102  }
103  }
104  else
105  {
106  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(mkParAdapt(*this, fLoadSection), Buf, C4CFN_ScenarioCore))
107  {
108  return false;
109  }
110  }
111  return true;
112 }
113 
114 bool C4Scenario::Save(C4Group &hGroup, bool fSaveSection)
115 {
116  StdStrBuf Buf;
117  try
118  {
119  Buf.Take(DecompileToBuf<StdCompilerINIWrite>(mkParAdapt(*this, fSaveSection)));
120  }
121  catch (StdCompiler::Exception *)
122  { return false; }
123  if (!hGroup.Add(C4CFN_ScenarioCore,Buf,false,true))
124  { return false; }
125  return true;
126 }
127 
128 void C4Scenario::CompileFunc(StdCompiler *pComp, bool fSection)
129 {
130  pComp->Value(mkNamingAdapt(mkParAdapt(Head, fSection), "Head"));
131  if (!fSection) pComp->Value(mkNamingAdapt(Definitions, "Definitions"));
132  pComp->Value(mkNamingAdapt(mkParAdapt(Game, fSection), "Game"));
133  for (int32_t i = 0; i < C4S_MaxPlayer; i++)
134  pComp->Value(mkNamingAdapt(PlrStart[i], FormatString("Player%d", i+1).getData()));
135  pComp->Value(mkNamingAdapt(Landscape, "Landscape"));
136  pComp->Value(mkNamingAdapt(Animals, "Animals"));
137  pComp->Value(mkNamingAdapt(Weather, "Weather"));
138  pComp->Value(mkNamingAdapt(Environment, "Environment"));
139 }
140 
142 {
143  // MinPlayer is specified.
144  if (Head.MinPlayer != 0)
145  return Head.MinPlayer;
146  // Otherwise/unknown: need at least one.
147  return 1;
148 }
149 
151 {
153  ZeroMem(Definition,sizeof (Definition));
154  SkipDefs.Default();
155 }
156 
157 const int32_t C4S_MaxPlayerDefault = 12;
158 
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 }
179 
180 void C4SHead::CompileFunc(StdCompiler *pComp, bool fSection)
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 }
214 
216 {
217  Goals.Clear();
218  Rules.Clear();
219  FoWEnabled = true;
220 }
221 
222 void C4SGame::CompileFunc(StdCompiler *pComp, bool fSection)
223 {
224  if (!fSection)
225  {
226  pComp->Value(mkNamingAdapt(Realism.ValueOverloads, "ValueOverloads", C4IDList()));
227  }
228  pComp->Value(mkNamingAdapt(mkRuntimeValueAdapt(Realism.LandscapePushPull), "LandscapePushPull", false));
229  pComp->Value(mkNamingAdapt(mkRuntimeValueAdapt(Realism.LandscapeInsertThrust), "LandscapeInsertThrust",true));
230 
232  pComp->Value(mkNamingAdapt(Goals, "Goals", C4IDList()));
233  pComp->Value(mkNamingAdapt(Rules, "Rules", C4IDList()));
234  pComp->Value(mkNamingAdapt(FoWEnabled, "FoWEnabled", true));
235 }
236 
238 {
239  Wealth.Set(0,0,0,250);
240  Position[0]=Position[1]=-1;
241  EnforcePosition=0;
242  ReadyCrew.Default();
243  ReadyBase.Default();
249 }
250 
252 {
253  return *this == rhs;
254 }
255 
257 {
258  return (Wealth == rhs.Wealth)
259  && (ReadyCrew == rhs.ReadyCrew)
260  && (ReadyBase == rhs.ReadyBase)
261  && (ReadyVehic == rhs.ReadyVehic)
262  && (ReadyMaterial == rhs.ReadyMaterial)
263  && (BuildKnowledge == rhs.BuildKnowledge)
264  && (BaseMaterial == rhs.BaseMaterial)
265  && (BaseProduction == rhs.BaseProduction);
266 }
267 
269 {
270  C4IDList crewDefault;
271  crewDefault.SetIDCount(C4ID::Clonk,1,true);
272  pComp->Value(mkNamingAdapt(Wealth, "Wealth", C4SVal(0, 0, 0,250), true));
273  pComp->Value(mkNamingAdapt(mkArrayAdaptDM(Position,-1), "Position" ));
274  pComp->Value(mkNamingAdapt(EnforcePosition, "EnforcePosition", 0));
275  pComp->Value(mkNamingAdapt(ReadyCrew, "Crew", crewDefault));
276  pComp->Value(mkNamingAdapt(ReadyBase, "Buildings", C4IDList()));
277  pComp->Value(mkNamingAdapt(ReadyVehic, "Vehicles", C4IDList()));
278  pComp->Value(mkNamingAdapt(ReadyMaterial, "Material", C4IDList()));
279  pComp->Value(mkNamingAdapt(BuildKnowledge, "Knowledge", C4IDList()));
280  pComp->Value(mkNamingAdapt(BaseMaterial, "BaseMaterial", C4IDList()));
281  pComp->Value(mkNamingAdapt(BaseProduction, "BaseProduction", C4IDList()));
282 }
283 
285 {
286  BottomOpen=0; TopOpen=1;
287  LeftOpen=0; RightOpen=0;
289  SkyDef[0]=0;
290  for (int32_t cnt=0; cnt<6; cnt++) SkyDefFade[cnt]=0;
291  VegLevel.Set(50,30,0,100);
293  InEarthLevel.Set(50,0,0,100);
294  InEarth.Default();
295  MapWdt.Set(100,0,64,250);
296  MapHgt.Set(50,0,40,250);
297  MapZoom.Set(8,0,1,15);
298  Amplitude.Set(0,0);
299  Phase.Set(50);
300  Period.Set(15);
301  Random.Set(0);
303  MapPlayerExtend=0;
304  Layers.Clear();
305  Material = "Earth";
306  Liquid = "Water";
307  ExactLandscape=0;
308  Gravity.Set(100,0,10,200);
309  NoScan=0;
310  KeepMapCreator=0;
311  SkyScrollMode=0;
312  MaterialZoom=4;
313  FlatChunkShapes=false;
314  Secret=false;
315 }
316 
317 void C4SLandscape::GetMapSize(int32_t &rWdt, int32_t &rHgt, int32_t iPlayerNum)
318 {
319  rWdt = MapWdt.Evaluate();
320  rHgt = MapHgt.Evaluate();
321  iPlayerNum = std::max<int32_t>( iPlayerNum, 1 );
322  if (MapPlayerExtend)
323  rWdt = std::min(rWdt * std::min(iPlayerNum, C4S_MaxMapPlayerExtend), MapWdt.Max);
324 }
325 
327 {
328  pComp->Value(mkNamingAdapt(ExactLandscape, "ExactLandscape", false));
329  pComp->Value(mkNamingAdapt(Vegetation, "Vegetation", C4IDList()));
330  pComp->Value(mkNamingAdapt(VegLevel, "VegetationLevel", C4SVal(50,30,0,100), true));
331  pComp->Value(mkNamingAdapt(InEarth, "InEarth", C4IDList()));
332  pComp->Value(mkNamingAdapt(InEarthLevel, "InEarthLevel", C4SVal(50,0,0,100), true));
333  pComp->Value(mkNamingAdapt(SkyDef, "Sky", ""));
334  pComp->Value(mkNamingAdapt(mkArrayAdaptDM(SkyDefFade,0),"SkyFade" ));
335  pComp->Value(mkNamingAdapt(BottomOpen, "BottomOpen", 0));
336  pComp->Value(mkNamingAdapt(TopOpen, "TopOpen", 1));
337  pComp->Value(mkNamingAdapt(LeftOpen, "LeftOpen", 0));
338  pComp->Value(mkNamingAdapt(RightOpen, "RightOpen", 0));
339  pComp->Value(mkNamingAdapt(AutoScanSideOpen, "AutoScanSideOpen", true));
340  pComp->Value(mkNamingAdapt(MapWdt, "MapWidth", C4SVal(100,0,64,250), true));
341  pComp->Value(mkNamingAdapt(MapHgt, "MapHeight", C4SVal(50,0,40,250), true));
342  pComp->Value(mkNamingAdapt(MapZoom, "MapZoom", C4SVal(8,0,1,15), true));
343  pComp->Value(mkNamingAdapt(Amplitude, "Amplitude", C4SVal(0)));
344  pComp->Value(mkNamingAdapt(Phase, "Phase", C4SVal(50)));
345  pComp->Value(mkNamingAdapt(Period, "Period", C4SVal(15)));
346  pComp->Value(mkNamingAdapt(Random, "Random", C4SVal(0)));
347  pComp->Value(mkNamingAdapt(Material, "Material", "Earth"));
348  pComp->Value(mkNamingAdapt(Liquid, "Liquid", "Water"));
349  pComp->Value(mkNamingAdapt(LiquidLevel, "LiquidLevel", C4SVal()));
350  pComp->Value(mkNamingAdapt(MapPlayerExtend, "MapPlayerExtend", 0));
351  pComp->Value(mkNamingAdapt(Layers, "Layers", C4NameList()));
352  pComp->Value(mkNamingAdapt(Gravity, "Gravity", C4SVal(100,0,10,200), true));
353  pComp->Value(mkNamingAdapt(NoScan, "NoScan", false));
354  pComp->Value(mkNamingAdapt(KeepMapCreator, "KeepMapCreator", false));
355  pComp->Value(mkNamingAdapt(SkyScrollMode, "SkyScrollMode", 0));
356  pComp->Value(mkNamingAdapt(MaterialZoom, "MaterialZoom", 4));
357  pComp->Value(mkNamingAdapt(FlatChunkShapes, "FlatChunkShapes", false));
358  pComp->Value(mkNamingAdapt(Secret, "Secret", false));
359 }
360 
362 {
363  Climate.Set(50,10);
364  StartSeason.Set(50,50);
365  YearSpeed.Set(50);
366  Wind.Set(0,70,-100,+100);
367  NoGamma=1;
368 }
369 
371 {
372  pComp->Value(mkNamingAdapt(Climate, "Climate", C4SVal(50,10), true));
373  pComp->Value(mkNamingAdapt(StartSeason, "StartSeason", C4SVal(50,50), true));
374  pComp->Value(mkNamingAdapt(YearSpeed, "YearSpeed", C4SVal(50)));
375  pComp->Value(mkNamingAdapt(Wind, "Wind", C4SVal(0,70,-100,+100), true));
376  pComp->Value(mkNamingAdapt(NoGamma, "NoGamma", true));
377 }
378 
380 {
381  FreeLife.Clear();
382  EarthNest.Clear();
383 }
384 
386 {
387  pComp->Value(mkNamingAdapt(FreeLife, "Animal", C4IDList()));
388  pComp->Value(mkNamingAdapt(EarthNest, "Nest", C4IDList()));
389 }
390 
392 {
393  Objects.Clear();
394 }
395 
397 {
398  pComp->Value(mkNamingAdapt(Objects, "Objects", C4IDList()));
399 }
400 
402 {
406 }
407 
409 {
410 
411 }
412 
414 {
415  if (Landscape.ExactLandscape) return;
416  // Set landscape
418 }
419 
420 bool C4SDefinitions::GetModules(StdStrBuf *psOutModules) const
421 {
422  // Local only
423  if (LocalOnly) { psOutModules->Copy(""); return true; }
424  // Scan for any valid entries
425  bool fSpecified = false;
426  int32_t cnt=0;
427  for (; cnt<C4S_MaxDefinitions; cnt++)
428  if (Definition[cnt][0])
429  fSpecified = true;
430  // No valid entries
431  if (!fSpecified) return false;
432  // Compose entry list
433  psOutModules->Copy("");
434  for (cnt=0; cnt<C4S_MaxDefinitions; cnt++)
435  if (Definition[cnt][0])
436  {
437  if (psOutModules->getLength()) psOutModules->AppendChar(';');
438  psOutModules->Append(Definition[cnt]);
439  }
440  // Done
441  return true;
442 }
443 
444 std::list<const char *> C4SDefinitions::GetModulesAsList() const
445 {
446  // get definitions as string pointers into this structure
447  std::list<const char *> result;
448  if (!LocalOnly)
449  {
450  for (const char *def : Definition)
451  {
452  if (*def)
453  {
454  result.push_back(def);
455  }
456  }
457  }
458  return result;
459 }
460 
461 
462 void C4SDefinitions::SetModules(const char *szList, const char *szRelativeToPath, const char *szRelativeToPath2)
463 {
464  int32_t cnt;
465 
466  // Empty list: local only
467  if (!SModuleCount(szList))
468  {
469  LocalOnly=true;
470  for (cnt=0; cnt<C4S_MaxDefinitions; cnt++) Definition[cnt][0]=0;
471  return;
472  }
473 
474  // Set list
475  LocalOnly=false;
476  for (cnt=0; cnt<C4S_MaxDefinitions; cnt++)
477  {
478  SGetModule(szList,cnt,Definition[cnt],_MAX_PATH);
479  // Make relative path
480  if (szRelativeToPath && *szRelativeToPath)
481  {
482  if (GetRelativePathS(Definition[cnt],szRelativeToPath) != Definition[cnt])
483  {
484  SCopy(GetRelativePathS(Definition[cnt],szRelativeToPath),Definition[cnt]);
485  continue;
486  }
487  }
488  if (szRelativeToPath2 && *szRelativeToPath2)
489  {
490  if (GetRelativePathS(Definition[cnt],szRelativeToPath2) != Definition[cnt])
491  {
492  SCopy(GetRelativePathS(Definition[cnt],szRelativeToPath2),Definition[cnt]);
493  continue;
494  }
495  }
496  }
497 
498 }
499 
501 {
502  pComp->Value(mkNamingAdapt(LocalOnly, "LocalOnly", false));
503  pComp->Value(mkNamingAdapt(AllowUserChange, "AllowUserChange", false));
504  pComp->Value(mkNamingAdapt(mkStringAdaptMA(Definition[0]), "Definition1", "Objects.ocd"));
505  for (int32_t i = 1; i < C4S_MaxDefinitions; i++)
506  pComp->Value(mkNamingAdapt(mkStringAdaptMA(Definition[i]), FormatString("Definition%i", i+1).getData(), ""));
507  pComp->Value(mkNamingAdapt(SkipDefs, "SkipDefs", C4IDList()));
508 }
509 
511 {
512  // Check for game modes known to be melees
513  // Also allow it in parkours by default because that works fine
514  if (Mode == "Melee" || Mode == "Parkour") return true;
515  // Game mode not present or unknown? Check for old MELE goal which was still used by some scenarios.
516  if (Goals.GetIDCount(C4ID::Melee, 1)) return true;
517  // Nothing looks like melee here
518  return false;
519 }
StdCopyStrBuf Mode
Definition: C4Scenario.h:121
C4IDList ValueOverloads
Definition: C4Scenario.h:109
StdRuntimeValueAdapt< T > mkRuntimeValueAdapt(T &&rValue)
Definition: StdAdaptors.h:173
C4IDList BuildKnowledge
Definition: C4Scenario.h:149
int32_t GetIDCount(C4ID c_id, int32_t iZeroDefVal=0) const
Definition: stub-handle.cpp:67
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
const int32_t C4S_MaxPlayerDefault
Definition: C4Scenario.cpp:157
StdCopyStrBuf Origin
Definition: C4Scenario.h:80
int32_t Max
Definition: C4Scenario.h:31
bool SGetModule(const char *szList, int iIndex, char *sTarget, int iSize)
Definition: Standard.cpp:503
int32_t Icon
Definition: C4Scenario.h:68
C4SVal Climate
Definition: C4Scenario.h:197
bool NetworkRuntimeJoin
Definition: C4Scenario.h:79
void Clear()
Definition: stub-handle.cpp:64
std::string Liquid
Definition: C4Scenario.h:182
void Default()
Definition: C4Scenario.cpp:55
std::string Material
Definition: C4Scenario.h:181
C4IDList Objects
Definition: C4Scenario.h:219
void Default()
Definition: C4Scenario.cpp:361
C4SVal StartSeason
Definition: C4Scenario.h:198
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:122
C4SDefinitions Definitions
Definition: C4Scenario.h:231
bool operator==(const C4SPlrStart &rhs)
Definition: C4Scenario.cpp:256
int32_t EnforcePosition
Definition: C4Scenario.h:144
uint32_t Random()
Definition: C4Random.cpp:43
void Default()
Definition: C4Scenario.cpp:379
int32_t MapPlayerExtend
Definition: C4Scenario.h:179
bool Save(C4Group &hGroup, bool fSaveSection=false)
Definition: C4Scenario.cpp:114
void SetExactLandscape()
Definition: C4Scenario.cpp:413
int32_t MaterialZoom
Definition: C4Scenario.h:185
bool IsMelee()
Definition: C4Scenario.cpp:510
bool LandscapePushPull
Definition: C4Scenario.h:110
C4SEnvironment Environment
Definition: C4Scenario.h:237
C4IDList Goals
Definition: C4Scenario.h:122
int32_t MinPlayer
Definition: C4Scenario.h:70
std::string Loader
Definition: C4Scenario.h:65
C4IDList BaseProduction
Definition: C4Scenario.h:151
std::string MissionAccess
Definition: C4Scenario.h:76
void Clear()
Definition: StdBuf.h:474
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:500
void Clear()
Definition: C4Scenario.cpp:408
C4SVal YearSpeed
Definition: C4Scenario.h:198
C4IDList ReadyCrew
Definition: C4Scenario.h:145
bool Replay
Definition: C4Scenario.h:72
void GetMapSize(int32_t &rWdt, int32_t &rHgt, int32_t iPlayerNum)
Definition: C4Scenario.cpp:317
C4SLandscape Landscape
Definition: C4Scenario.h:234
C4IDList Rules
Definition: C4Scenario.h:123
void Set(int32_t std=0, int32_t rnd=0, int32_t min=0, int32_t max=100)
Definition: C4Scenario.cpp:36
C4SVal Gravity
Definition: C4Scenario.h:174
std::string Title
Definition: C4Scenario.h:64
C4IDList Vegetation
Definition: C4Scenario.h:165
const int C4S_MaxPlayer
Definition: C4Constants.h:53
C4SVal MapWdt
Definition: C4Scenario.h:176
C4StrValAdapt< T > mkStrValAdapt(T &&rValue, C4InVal::ValidationOption eValType)
bool GetModules(StdStrBuf *psOutModules) const
Definition: C4Scenario.cpp:420
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:60
C4SVal Wind
Definition: C4Scenario.h:199
#define _MAX_PATH
void Default()
Definition: C4Scenario.cpp:78
int32_t GetMinPlayer()
Definition: C4Scenario.cpp:141
int32_t TopOpen
Definition: C4Scenario.h:168
int32_t SkyScrollMode
Definition: C4Scenario.h:184
bool NoGamma
Definition: C4Scenario.h:200
bool ExactLandscape
Definition: C4Scenario.h:163
void CompileFunc(StdCompiler *pComp, bool fSection)
Definition: C4Scenario.cpp:128
C4SVal InEarthLevel
Definition: C4Scenario.h:166
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
void AppendChar(char cChar)
Definition: StdBuf.h:596
#define AltDirectorySeparator
C4IDList SkipDefs
Definition: C4Scenario.h:94
bool SaveGame
Definition: C4Scenario.h:71
void Default()
Definition: stub-handle.cpp:63
C4SVal MapZoom
Definition: C4Scenario.h:176
C4SVal Period
Definition: C4Scenario.h:177
C4SVal Wealth
Definition: C4Scenario.h:142
void Default()
Definition: C4Scenario.cpp:237
int32_t BottomOpen
Definition: C4Scenario.h:168
bool Load(C4Group &hGroup, bool fLoadSection=false, bool suppress_errors=false)
Definition: C4Scenario.cpp:92
int32_t MaxPlayer
Definition: C4Scenario.h:70
int32_t C4XVer[2]
Definition: C4Scenario.h:63
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:268
void Take(char *pnData)
Definition: StdBuf.h:465
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
int32_t LeftOpen
Definition: C4Scenario.h:169
void Default()
Definition: C4Scenario.cpp:284
bool NetworkGame
Definition: C4Scenario.h:78
int32_t SkyDefFade[6]
Definition: C4Scenario.h:172
void Default()
Definition: C4Scenario.cpp:159
C4SRealism Realism
Definition: C4Scenario.h:127
bool AllowUserChange
Definition: C4Scenario.h:93
C4SVal(int32_t std=0, int32_t rnd=0, int32_t min=0, int32_t max=100)
Definition: C4Scenario.cpp:31
int SModuleCount(const char *szList)
Definition: Standard.cpp:581
void Value(const T &rStruct)
Definition: StdCompiler.h:171
static const C4ID Melee
Definition: C4Id.h:46
std::list< const char * > GetModulesAsList() const
Definition: C4Scenario.cpp:444
int ReplaceChar(char cOld, char cNew)
Definition: StdBuf.cpp:343
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:370
C4SVal Phase
Definition: C4Scenario.h:177
C4SPlrStart PlrStart[C4S_MaxPlayer]
Definition: C4Scenario.h:233
#define mkArrayAdaptDM(A, D)
Definition: StdAdaptors.h:361
C4SAnimals Animals
Definition: C4Scenario.h:235
C4IDList EarthNest
Definition: C4Scenario.h:210
C4IDList ReadyBase
Definition: C4Scenario.h:146
virtual bool isDeserializer()
Definition: StdCompiler.h:63
bool FlatChunkShapes
Definition: C4Scenario.h:186
C4SVal Random
Definition: C4Scenario.h:177
bool LandscapeInsertThrust
Definition: C4Scenario.h:111
C4IDList ReadyVehic
Definition: C4Scenario.h:147
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932
void Default()
Definition: C4Scenario.cpp:215
static const C4ID Clonk
Definition: C4Id.h:45
#define C4CFN_ScenarioCore
Definition: C4Components.h:42
C4IDList InEarth
Definition: C4Scenario.h:167
C4SVal MapHgt
Definition: C4Scenario.h:176
C4IDList FreeLife
Definition: C4Scenario.h:209
void SetModules(const char *szList, const char *szRelativeToPath=nullptr, const char *szRelativeToPath2=nullptr)
Definition: C4Scenario.cpp:462
int32_t RightOpen
Definition: C4Scenario.h:169
std::string Font
Definition: C4Scenario.h:66
void Default()
Definition: C4Scenario.cpp:401
bool Secret
Definition: C4Scenario.h:77
bool SetIDCount(C4ID c_id, int32_t iCount, bool fAddNewID=false)
Definition: stub-handle.cpp:68
C4SGame Game
Definition: C4Scenario.h:232
bool Add(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1316
int32_t Position[2]
Definition: C4Scenario.h:143
#define mkStringAdaptMA(szString)
Definition: StdAdaptors.h:191
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456
size_t getLength() const
Definition: StdBuf.h:453
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:326
C4IDList ReadyMaterial
Definition: C4Scenario.h:148
int32_t Difficulty
Definition: C4Scenario.h:67
void CompileFunc(StdCompiler *pComp, bool fSection)
Definition: C4Scenario.cpp:222
void SetConstant(int32_t val)
Definition: C4Scenario.cpp:41
C4SVal Amplitude
Definition: C4Scenario.h:177
std::enable_if< std::is_pod< T >::value >::type ZeroMem(T *lpMem, size_t dwSize)
Definition: Standard.h:63
C4SHead Head
Definition: C4Scenario.h:230
C4SVal VegLevel
Definition: C4Scenario.h:164
StdDefaultAdapt< T, D > mkDefaultAdapt(T &&rValue, const D &rDefault)
Definition: StdAdaptors.h:65
std::string Engine
Definition: C4Scenario.h:75
C4NameList Layers
Definition: C4Scenario.h:180
int32_t Std
Definition: C4Scenario.h:31
bool KeepMapCreator
Definition: C4Scenario.h:183
#define DirectorySeparator
int32_t Rnd
Definition: C4Scenario.h:31
C4SWeather Weather
Definition: C4Scenario.h:236
bool NoInitialize
Definition: C4Scenario.h:69
std::string SkyDef
Definition: C4Scenario.h:171
void Copy()
Definition: StdBuf.h:475
const int32_t C4S_MaxDefinitions
Definition: C4Scenario.h:87
bool EquipmentEqual(C4SPlrStart &rhs)
Definition: C4Scenario.cpp:251
void CompileFunc(StdCompiler *pComp, bool fSection)
Definition: C4Scenario.cpp:180
int32_t Evaluate()
Definition: C4Scenario.cpp:50
int32_t MaxPlayerLeague
Definition: C4Scenario.h:70
C4SVal LiquidLevel
Definition: C4Scenario.h:178
bool AutoScanSideOpen
Definition: C4Scenario.h:170
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:396
int32_t RandomSeed
Definition: C4Scenario.h:74
bool FoWEnabled
Definition: C4Scenario.h:125
const char * GetRelativePathS(const char *strPath, const char *strRelativeTo)
Definition: StdFile.cpp:221
int32_t Film
Definition: C4Scenario.h:73
void CompileFunc(StdCompiler *pComp)
Definition: C4Scenario.cpp:385
const int32_t C4S_MaxMapPlayerExtend
Definition: C4Scenario.h:137
C4IDList BaseMaterial
Definition: C4Scenario.h:150
int32_t Min
Definition: C4Scenario.h:31
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277
void Clear()
Definition: C4NameList.cpp:23