OpenClonk
C4SPlrStart Class Reference

#include <C4Scenario.h>

Collaboration diagram for C4SPlrStart:
[legend]

Public Member Functions

void Default ()
 
bool EquipmentEqual (C4SPlrStart &rhs)
 
bool operator== (const C4SPlrStart &rhs)
 
void CompileFunc (StdCompiler *pComp)
 

Public Attributes

C4SVal Wealth
 
int32_t Position [2]
 
int32_t EnforcePosition
 
C4IDList ReadyCrew
 
C4IDList ReadyBase
 
C4IDList ReadyVehic
 
C4IDList ReadyMaterial
 
C4IDList BuildKnowledge
 
C4IDList BaseMaterial
 
C4IDList BaseProduction
 

Detailed Description

Definition at line 141 of file C4Scenario.h.

Member Function Documentation

◆ CompileFunc()

void C4SPlrStart::CompileFunc ( StdCompiler pComp)

Definition at line 270 of file C4Scenario.cpp.

References C4SVal::C4SVal(), C4ID::Clonk, mkArrayAdaptDM, mkNamingAdapt(), C4IDList::SetIDCount(), and StdCompiler::Value().

271 {
272  C4IDList crewDefault;
273  crewDefault.SetIDCount(C4ID::Clonk,1,true);
274  pComp->Value(mkNamingAdapt(Wealth, "Wealth", C4SVal(0, 0, 0,250), true));
275  pComp->Value(mkNamingAdapt(mkArrayAdaptDM(Position,-1), "Position" ));
276  pComp->Value(mkNamingAdapt(EnforcePosition, "EnforcePosition", 0));
277  pComp->Value(mkNamingAdapt(ReadyCrew, "Crew", crewDefault));
278  pComp->Value(mkNamingAdapt(ReadyBase, "Buildings", C4IDList()));
279  pComp->Value(mkNamingAdapt(ReadyVehic, "Vehicles", C4IDList()));
280  pComp->Value(mkNamingAdapt(ReadyMaterial, "Material", C4IDList()));
281  pComp->Value(mkNamingAdapt(BuildKnowledge, "Knowledge", C4IDList()));
282  pComp->Value(mkNamingAdapt(BaseMaterial, "BaseMaterial", C4IDList()));
283  pComp->Value(mkNamingAdapt(BaseProduction, "BaseProduction", C4IDList()));
284 }
C4IDList BuildKnowledge
Definition: C4Scenario.h:151
int32_t EnforcePosition
Definition: C4Scenario.h:146
C4IDList BaseProduction
Definition: C4Scenario.h:153
C4IDList ReadyCrew
Definition: C4Scenario.h:147
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
C4SVal Wealth
Definition: C4Scenario.h:144
void Value(const T &rStruct)
Definition: StdCompiler.h:161
#define mkArrayAdaptDM(A, D)
Definition: StdAdaptors.h:381
C4IDList ReadyBase
Definition: C4Scenario.h:148
C4IDList ReadyVehic
Definition: C4Scenario.h:149
static const C4ID Clonk
Definition: C4Id.h:42
bool SetIDCount(C4ID c_id, int32_t iCount, bool fAddNewID=false)
Definition: stub-handle.cpp:68
int32_t Position[2]
Definition: C4Scenario.h:145
C4IDList ReadyMaterial
Definition: C4Scenario.h:150
C4IDList BaseMaterial
Definition: C4Scenario.h:152
Here is the call graph for this function:

◆ Default()

void C4SPlrStart::Default ( )

Definition at line 239 of file C4Scenario.cpp.

240 {
241  Wealth.Set(0,0,0,250);
242  Position[0]=Position[1]=-1;
243  EnforcePosition=0;
244  ReadyCrew.Default();
245  ReadyBase.Default();
251 }
C4IDList BuildKnowledge
Definition: C4Scenario.h:151
int32_t EnforcePosition
Definition: C4Scenario.h:146
C4IDList BaseProduction
Definition: C4Scenario.h:153
C4IDList ReadyCrew
Definition: C4Scenario.h:147
void Set(int32_t std=0, int32_t rnd=0, int32_t min=0, int32_t max=100)
Definition: C4Scenario.cpp:36
void Default()
Definition: stub-handle.cpp:63
C4SVal Wealth
Definition: C4Scenario.h:144
C4IDList ReadyBase
Definition: C4Scenario.h:148
C4IDList ReadyVehic
Definition: C4Scenario.h:149
int32_t Position[2]
Definition: C4Scenario.h:145
C4IDList ReadyMaterial
Definition: C4Scenario.h:150
C4IDList BaseMaterial
Definition: C4Scenario.h:152

◆ EquipmentEqual()

bool C4SPlrStart::EquipmentEqual ( C4SPlrStart rhs)

Definition at line 253 of file C4Scenario.cpp.

254 {
255  return *this == rhs;
256 }

◆ operator==()

bool C4SPlrStart::operator== ( const C4SPlrStart rhs)

Definition at line 258 of file C4Scenario.cpp.

References BaseMaterial, BaseProduction, BuildKnowledge, ReadyBase, ReadyCrew, ReadyMaterial, ReadyVehic, and Wealth.

259 {
260  return (Wealth == rhs.Wealth)
261  && (ReadyCrew == rhs.ReadyCrew)
262  && (ReadyBase == rhs.ReadyBase)
263  && (ReadyVehic == rhs.ReadyVehic)
264  && (ReadyMaterial == rhs.ReadyMaterial)
265  && (BuildKnowledge == rhs.BuildKnowledge)
266  && (BaseMaterial == rhs.BaseMaterial)
267  && (BaseProduction == rhs.BaseProduction);
268 }
C4IDList BuildKnowledge
Definition: C4Scenario.h:151
C4IDList BaseProduction
Definition: C4Scenario.h:153
C4IDList ReadyCrew
Definition: C4Scenario.h:147
C4SVal Wealth
Definition: C4Scenario.h:144
C4IDList ReadyBase
Definition: C4Scenario.h:148
C4IDList ReadyVehic
Definition: C4Scenario.h:149
C4IDList ReadyMaterial
Definition: C4Scenario.h:150
C4IDList BaseMaterial
Definition: C4Scenario.h:152

Member Data Documentation

◆ BaseMaterial

C4IDList C4SPlrStart::BaseMaterial

Definition at line 152 of file C4Scenario.h.

Referenced by operator==(), and C4Player::ScenarioInit().

◆ BaseProduction

C4IDList C4SPlrStart::BaseProduction

Definition at line 153 of file C4Scenario.h.

Referenced by operator==(), and C4Player::ScenarioInit().

◆ BuildKnowledge

C4IDList C4SPlrStart::BuildKnowledge

Definition at line 151 of file C4Scenario.h.

Referenced by operator==(), and C4Player::ScenarioInit().

◆ EnforcePosition

◆ Position

int32_t C4SPlrStart::Position[2]

Definition at line 145 of file C4Scenario.h.

Referenced by C4Player::Execute(), and C4Player::ScenarioInit().

◆ ReadyBase

C4IDList C4SPlrStart::ReadyBase

Definition at line 148 of file C4Scenario.h.

Referenced by operator==(), and C4Player::PlaceReadyBase().

◆ ReadyCrew

C4IDList C4SPlrStart::ReadyCrew

Definition at line 147 of file C4Scenario.h.

Referenced by operator==(), and C4Player::PlaceReadyCrew().

◆ ReadyMaterial

C4IDList C4SPlrStart::ReadyMaterial

Definition at line 150 of file C4Scenario.h.

Referenced by operator==(), and C4Player::PlaceReadyMaterial().

◆ ReadyVehic

C4IDList C4SPlrStart::ReadyVehic

Definition at line 149 of file C4Scenario.h.

Referenced by operator==(), and C4Player::PlaceReadyVehic().

◆ Wealth

C4SVal C4SPlrStart::Wealth

Definition at line 144 of file C4Scenario.h.

Referenced by operator==(), and C4Player::ScenarioInit().


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