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.

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 }
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:490
StdRuntimeValueAdapt< T > mkRuntimeValueAdapt(T &&rValue)
Definition: StdAdaptors.h:172
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
C4SRealism Realism
Definition: C4Scenario.h:127
bool FoWEnabled
Definition: C4Scenario.h:125
C4IDList Goals
Definition: C4Scenario.h:122
StdCopyStrBuf Mode
Definition: C4Scenario.h:121
bool EvaluateOnAbort
Definition: C4Scenario.h:129
C4IDList Rules
Definition: C4Scenario.h:123
bool LandscapeInsertThrust
Definition: C4Scenario.h:111
C4IDList ValueOverloads
Definition: C4Scenario.h:109
bool LandscapePushPull
Definition: C4Scenario.h:110
void Value(const T &rStruct)
Definition: StdCompiler.h:161
@ RCT_IdtfAllowEmpty
Definition: StdCompiler.h:140

References EvaluateOnAbort, FoWEnabled, Goals, C4SRealism::LandscapeInsertThrust, C4SRealism::LandscapePushPull, mkNamingAdapt(), mkParAdapt(), mkRuntimeValueAdapt(), Mode, StdCompiler::RCT_IdtfAllowEmpty, Realism, Rules, StdCompiler::Value(), and C4SRealism::ValueOverloads.

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

References C4IDList::Clear(), EvaluateOnAbort, FoWEnabled, Goals, and Rules.

Referenced by C4Scenario::Default().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsMelee()

bool C4SGame::IsMelee ( )

Definition at line 512 of file C4Scenario.cpp.

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?
518  return false;
519 }

References Mode.

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

Here is the caller graph for this function:

Member Data Documentation

◆ EvaluateOnAbort

bool C4SGame::EvaluateOnAbort

Definition at line 129 of file C4Scenario.h.

Referenced by CompileFunc(), and Default().

◆ FoWEnabled

bool C4SGame::FoWEnabled

Definition at line 125 of file C4Scenario.h.

Referenced by CompileFunc(), and Default().

◆ Goals

C4IDList C4SGame::Goals

Definition at line 122 of file C4Scenario.h.

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

◆ Mode

StdCopyStrBuf C4SGame::Mode

Definition at line 121 of file C4Scenario.h.

Referenced by CompileFunc(), and IsMelee().

◆ Realism

◆ Rules

C4IDList C4SGame::Rules

Definition at line 123 of file C4Scenario.h.

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


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