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 309 of file C4PlayerControl.h.

Member Function Documentation

void C4PlayerControlFile::Clear ( )

Definition at line 870 of file C4PlayerControl.cpp.

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

Referenced by Load().

871 {
872  ControlDefs.Clear();
873  AssignmentSets.Clear();
874 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerControlFile::CompileFunc ( StdCompiler pComp)

Definition at line 842 of file C4PlayerControl.cpp.

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

843 {
844  pComp->Value(mkNamingAdapt(ControlDefs, "ControlDefs", C4PlayerControlDefs()));
845  pComp->Value(mkNamingAdapt(AssignmentSets, "ControlSets", C4PlayerControlAssignmentSets()));
846 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
void Value(const T &rStruct)
Definition: StdCompiler.h:161

Here is the call graph for this function:

const C4PlayerControlAssignmentSets& C4PlayerControlFile::GetAssignmentSets ( ) const
inline

Definition at line 321 of file C4PlayerControl.h.

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

321 { return AssignmentSets; }

Here is the caller graph for this function:

const C4PlayerControlDefs& C4PlayerControlFile::GetControlDefs ( ) const
inline

Definition at line 320 of file C4PlayerControl.h.

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

320 { return ControlDefs; }

Here is the caller graph for this function:

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

Definition at line 848 of file C4PlayerControl.cpp.

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

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

849 {
850  // clear previous
851  Clear();
852  // load and prepare file contents
853  StdStrBuf Buf;
854  if (!hGroup.LoadEntryString(szFilename, &Buf)) return false;
855  if (pLang) pLang->ReplaceStrings(Buf);
856  // parse it!
857  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(*this, Buf, szFilename)) return false;
858  return true;
859 }
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 861 of file C4PlayerControl.cpp.

References C4Group::Add().

862 {
863  // decompile to buffer and save buffer to group
864  StdStrBuf Buf;
865  if (!DecompileToBuf_Log<StdCompilerINIWrite>(*this, &Buf, szFilename)) return false;
866  hGroup.Add(szFilename, Buf, false, true);
867  return true;
868 }
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: