OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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
 

Detailed Description

Definition at line 118 of file C4Scenario.h.

Member Function Documentation

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

Definition at line 222 of file C4Scenario.cpp.

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

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 }
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:458
bool FoWEnabled
Definition: C4Scenario.h:125

Here is the call graph for this function:

void C4SGame::Default ( )

Definition at line 215 of file C4Scenario.cpp.

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

Referenced by C4Scenario::Default().

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4SGame::IsMelee ( )

Definition at line 510 of file C4Scenario.cpp.

References C4IDList::GetIDCount(), Goals, C4ID::Melee, and Mode.

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

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
int32_t GetIDCount(C4ID c_id, int32_t iZeroDefVal=0) const
Definition: stub-handle.cpp:67
C4IDList Goals
Definition: C4Scenario.h:122
static const C4ID Melee
Definition: C4Id.h:43

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool C4SGame::FoWEnabled

Definition at line 125 of file C4Scenario.h.

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

C4IDList C4SGame::Goals

Definition at line 122 of file C4Scenario.h.

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

StdCopyStrBuf C4SGame::Mode

Definition at line 121 of file C4Scenario.h.

Referenced by CompileFunc(), C4Network2Reference::InitLocal(), and IsMelee().

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: