OpenClonk
C4GameVersion Struct Reference

#include <C4GameVersion.h>

Collaboration diagram for C4GameVersion:
[legend]

Public Member Functions

 C4GameVersion (const char *szEngine=C4ENGINENAME, int32_t iVer1=C4XVER1, int32_t iVer2=C4XVER2)
 
void Set (const char *szEngine=C4ENGINENAME, int32_t iVer1=C4XVER1, int32_t iVer2=C4XVER2)
 
StdStrBuf GetString () const
 
bool operator== (const C4GameVersion &rCmp) const
 
void CompileFunc (StdCompiler *pComp, bool fEngineName)
 

Public Attributes

ValidatedStdCopyStrBuf< C4InVal::VAL_NameAllowEmptysEngineName
 
int32_t iVer [2]
 

Detailed Description

Definition at line 24 of file C4GameVersion.h.

Constructor & Destructor Documentation

◆ C4GameVersion()

C4GameVersion::C4GameVersion ( const char *  szEngine = C4ENGINENAME,
int32_t  iVer1 = C4XVER1,
int32_t  iVer2 = C4XVER2 
)
inline

Definition at line 29 of file C4GameVersion.h.

30  { Set(szEngine, iVer1, iVer2); }
void Set(const char *szEngine=C4ENGINENAME, int32_t iVer1=C4XVER1, int32_t iVer2=C4XVER2)
Definition: C4GameVersion.h:31

References Set().

Here is the call graph for this function:

Member Function Documentation

◆ CompileFunc()

void C4GameVersion::CompileFunc ( StdCompiler pComp,
bool  fEngineName 
)
inline

Definition at line 38 of file C4GameVersion.h.

39  {
40  if (fEngineName)
41  {
42  pComp->Value(mkDefaultAdapt(sEngineName, ""));
43  pComp->Separator();
44  }
45  else if (pComp->isDeserializer())
46  sEngineName = "";
47  pComp->Value(mkArrayAdapt(iVer,2,0));
48  }
StdDefaultAdapt< T, D > mkDefaultAdapt(T &&rValue, const D &rDefault)
Definition: StdAdaptors.h:64
StdArrayAdapt< T > mkArrayAdapt(T *pArray, int iSize)
Definition: StdAdaptors.h:336
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
void Value(const T &rStruct)
Definition: StdCompiler.h:161
virtual bool isDeserializer()
Definition: StdCompiler.h:53
int32_t iVer[2]
Definition: C4GameVersion.h:27
ValidatedStdCopyStrBuf< C4InVal::VAL_NameAllowEmpty > sEngineName
Definition: C4GameVersion.h:26

References StdCompiler::isDeserializer(), iVer, mkArrayAdapt(), mkDefaultAdapt(), sEngineName, StdCompiler::Separator(), and StdCompiler::Value().

Here is the call graph for this function:

◆ GetString()

StdStrBuf C4GameVersion::GetString ( ) const
inline

Definition at line 33 of file C4GameVersion.h.

34  { return FormatString("%s %d.%d", sEngineName.getData(), (int)iVer[0], (int)iVer[1]); }
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
const char * getData() const
Definition: StdBuf.h:442

References FormatString(), StdStrBuf::getData(), iVer, and sEngineName.

Referenced by C4StartupNetDlg::DoOK(), and C4StartupNetListEntry::SetReference().

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

◆ operator==()

bool C4GameVersion::operator== ( const C4GameVersion rCmp) const
inline

Definition at line 35 of file C4GameVersion.h.

36  { return iVer[0]==rCmp.iVer[0] && iVer[1]==rCmp.iVer[1]; }

References iVer.

◆ Set()

void C4GameVersion::Set ( const char *  szEngine = C4ENGINENAME,
int32_t  iVer1 = C4XVER1,
int32_t  iVer2 = C4XVER2 
)
inline

Definition at line 31 of file C4GameVersion.h.

32  { sEngineName.CopyValidated(szEngine); iVer[0]=iVer1; iVer[1]=iVer2; }
void CopyValidated(const char *szFromVal)

References ValidatedStdCopyStrBufBase::CopyValidated(), iVer, and sEngineName.

Referenced by C4GameVersion(), and C4Network2Reference::InitLocal().

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

Member Data Documentation

◆ iVer

int32_t C4GameVersion::iVer[2]

◆ sEngineName

Definition at line 26 of file C4GameVersion.h.

Referenced by C4Network2Reference::CompileFunc(), CompileFunc(), GetString(), and Set().


The documentation for this struct was generated from the following file: