OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4PlayerControlFile Class Reference

#include <C4PlayerControl.h>

Public Member Functions

void Clear ()
 
void CompileFunc (StdCompiler *pComp)
 
bool Load (C4Group &hGroup, const char *szFilename, C4LangStringTable *pLang)
 
bool Save (C4Group &hGroup, const char *szFilename)
 
const C4PlayerControlDefsGetControlDefs () const
 
const
C4PlayerControlAssignmentSets
GetAssignmentSets () const
 

Detailed Description

Definition at line 314 of file C4PlayerControl.h.

Member Function Documentation

void C4PlayerControlFile::Clear ( )

Definition at line 886 of file C4PlayerControl.cpp.

References C4PlayerControlDefs::Clear(), and C4PlayerControlAssignmentSets::Clear().

Referenced by Load().

887 {
888  ControlDefs.Clear();
889  AssignmentSets.Clear();
890 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerControlFile::CompileFunc ( StdCompiler pComp)

Definition at line 858 of file C4PlayerControl.cpp.

References mkNamingAdapt(), and StdCompiler::Value().

859 {
860  pComp->Value(mkNamingAdapt(ControlDefs, "ControlDefs", C4PlayerControlDefs()));
861  pComp->Value(mkNamingAdapt(AssignmentSets, "ControlSets", C4PlayerControlAssignmentSets()));
862 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
void Value(const T &rStruct)
Definition: StdCompiler.h:170

Here is the call graph for this function:

const C4PlayerControlAssignmentSets& C4PlayerControlFile::GetAssignmentSets ( ) const
inline

Definition at line 326 of file C4PlayerControl.h.

Referenced by C4Game::InitPlayerControlSettings(), and C4Game::LoadAdditionalSystemGroup().

326 { return AssignmentSets; }

Here is the caller graph for this function:

const C4PlayerControlDefs& C4PlayerControlFile::GetControlDefs ( ) const
inline

Definition at line 325 of file C4PlayerControl.h.

Referenced by C4Game::InitPlayerControlSettings(), and C4Game::LoadAdditionalSystemGroup().

325 { return ControlDefs; }

Here is the caller graph for this function:

bool C4PlayerControlFile::Load ( C4Group hGroup,
const char *  szFilename,
C4LangStringTable pLang 
)

Definition at line 864 of file C4PlayerControl.cpp.

References Clear(), C4Group::LoadEntryString(), and C4LangStringTable::ReplaceStrings().

Referenced by C4Game::InitPlayerControlSettings(), and C4Game::LoadAdditionalSystemGroup().

865 {
866  // clear previous
867  Clear();
868  // load and prepare file contents
869  StdStrBuf Buf;
870  if (!hGroup.LoadEntryString(szFilename, &Buf)) return false;
871  if (pLang) pLang->ReplaceStrings(Buf);
872  // parse it!
873  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(*this, Buf, szFilename)) return false;
874  return true;
875 }
void ReplaceStrings(StdStrBuf &rBuf)
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerControlFile::Save ( C4Group hGroup,
const char *  szFilename 
)

Definition at line 877 of file C4PlayerControl.cpp.

References C4Group::Add().

878 {
879  // decompile to buffer and save buffer to group
880  StdStrBuf Buf;
881  if (!DecompileToBuf_Log<StdCompilerINIWrite>(*this, &Buf, szFilename)) return false;
882  hGroup.Add(szFilename, Buf, false, true);
883  return true;
884 }
bool Add(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1316

Here is the call graph for this function:


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