OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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_NameAllowEmpty
sEngineName
 
int32_t iVer [2]
 

Detailed Description

Definition at line 23 of file C4GameVersion.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file C4GameVersion.h.

References Set().

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

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 37 of file C4GameVersion.h.

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

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

Here is the call graph for this function:

StdStrBuf C4GameVersion::GetString ( ) const
inline

Definition at line 32 of file C4GameVersion.h.

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

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

33  { return FormatString("%s %d.%d", sEngineName.getData(), (int)iVer[0], (int)iVer[1]); }
const char * getData() const
Definition: StdBuf.h:450
ValidatedStdCopyStrBuf< C4InVal::VAL_NameAllowEmpty > sEngineName
Definition: C4GameVersion.h:25
int32_t iVer[2]
Definition: C4GameVersion.h:26
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 34 of file C4GameVersion.h.

References iVer.

35  { return iVer[0]==rCmp.iVer[0] && iVer[1]==rCmp.iVer[1]; }
int32_t iVer[2]
Definition: C4GameVersion.h:26
void C4GameVersion::Set ( const char *  szEngine = C4ENGINENAME,
int32_t  iVer1 = C4XVER1,
int32_t  iVer2 = C4XVER2 
)
inline

Definition at line 30 of file C4GameVersion.h.

References ValidatedStdCopyStrBufBase::CopyValidated().

Referenced by C4GameVersion().

31  { sEngineName.CopyValidated(szEngine); iVer[0]=iVer1; iVer[1]=iVer2; }
ValidatedStdCopyStrBuf< C4InVal::VAL_NameAllowEmpty > sEngineName
Definition: C4GameVersion.h:25
int32_t iVer[2]
Definition: C4GameVersion.h:26
void CopyValidated(const char *szFromVal)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int32_t C4GameVersion::iVer[2]

Definition at line 26 of file C4GameVersion.h.

Referenced by operator==().

Definition at line 25 of file C4GameVersion.h.


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