OpenClonk
C4SGame Class Reference

#include <C4Scenario.h>

Collaboration diagram for C4SGame:
[legend]

Public Member Functions

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

Public Attributes

StdCopyStrBuf Mode
 
C4IDList Goals
 
C4IDList Rules
 
bool FoWEnabled
 
C4SRealism Realism
 
bool EvaluateOnAbort
 

Detailed Description

Definition at line 118 of file C4Scenario.h.

Member Function Documentation

◆ CompileFunc()

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

Definition at line 223 of file C4Scenario.cpp.

References mkNamingAdapt(), mkParAdapt(), mkRuntimeValueAdapt(), StdCompiler::RCT_IdtfAllowEmpty, and StdCompiler::Value().

224 {
225  if (!fSection)
226  {
227  pComp->Value(mkNamingAdapt(Realism.ValueOverloads, "ValueOverloads", C4IDList()));
228  }
229  pComp->Value(mkNamingAdapt(mkRuntimeValueAdapt(Realism.LandscapePushPull), "LandscapePushPull", false));
230  pComp->Value(mkNamingAdapt(mkRuntimeValueAdapt(Realism.LandscapeInsertThrust), "LandscapeInsertThrust",true));
231 
233  pComp->Value(mkNamingAdapt(Goals, "Goals", C4IDList()));
234  pComp->Value(mkNamingAdapt(Rules, "Rules", C4IDList()));
235  pComp->Value(mkNamingAdapt(FoWEnabled, "FoWEnabled", true));
236  pComp->Value(mkNamingAdapt(EvaluateOnAbort, "EvaluateOnAbort", false));
237 }
StdCopyStrBuf Mode
Definition: C4Scenario.h:121
C4IDList ValueOverloads
Definition: C4Scenario.h:109
StdRuntimeValueAdapt< T > mkRuntimeValueAdapt(T &&rValue)
Definition: StdAdaptors.h:172
bool LandscapePushPull
Definition: C4Scenario.h:110
C4IDList Goals
Definition: C4Scenario.h:122
C4IDList Rules
Definition: C4Scenario.h:123
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
C4SRealism Realism
Definition: C4Scenario.h:127
void Value(const T &rStruct)
Definition: StdCompiler.h:161
bool LandscapeInsertThrust
Definition: C4Scenario.h:111
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:476
bool EvaluateOnAbort
Definition: C4Scenario.h:129
bool FoWEnabled
Definition: C4Scenario.h:125
Here is the call graph for this function:

◆ Default()

void C4SGame::Default ( )

Definition at line 215 of file C4Scenario.cpp.

216 {
217  Goals.Clear();
218  Rules.Clear();
219  FoWEnabled = true;
220  EvaluateOnAbort = false;
221 }
void Clear()
Definition: stub-handle.cpp:64
C4IDList Goals
Definition: C4Scenario.h:122
C4IDList Rules
Definition: C4Scenario.h:123
bool EvaluateOnAbort
Definition: C4Scenario.h:129
bool FoWEnabled
Definition: C4Scenario.h:125

◆ IsMelee()

bool C4SGame::IsMelee ( )

Definition at line 512 of file C4Scenario.cpp.

References C4ID::Melee.

Referenced by C4RoundResults::CompileFunc(), C4Player::Evaluate(), C4RoundResults::Init(), and C4TeamList::Load().

513 {
514  // Check for game modes known to be melees
515  // Also allow it in parkours by default because that works fine
516  if (Mode == "Melee" || Mode == "Parkour") return true;
517  // Game mode not present or unknown? Check for old MELE goal which was still used by some scenarios.
518  if (Goals.GetIDCount(C4ID::Melee, 1)) return true;
519  // Nothing looks like melee here
520  return false;
521 }
StdCopyStrBuf Mode
Definition: C4Scenario.h:121
C4IDList Goals
Definition: C4Scenario.h:122
static const C4ID Melee
Definition: C4Id.h:43
int32_t GetIDCount(C4ID c_id, int32_t iZeroDefVal=0) const
Definition: stub-handle.cpp:67
Here is the caller graph for this function:

Member Data Documentation

◆ EvaluateOnAbort

bool C4SGame::EvaluateOnAbort

Definition at line 129 of file C4Scenario.h.

◆ FoWEnabled

bool C4SGame::FoWEnabled

Definition at line 125 of file C4Scenario.h.

◆ Goals

C4IDList C4SGame::Goals

Definition at line 122 of file C4Scenario.h.

Referenced by C4GameParameters::CompileFunc().

◆ Mode

StdCopyStrBuf C4SGame::Mode

Definition at line 121 of file C4Scenario.h.

Referenced by C4Network2Reference::InitLocal().

◆ Realism

◆ Rules

C4IDList C4SGame::Rules

Definition at line 123 of file C4Scenario.h.

Referenced by C4GameParameters::CompileFunc().


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