OpenClonk
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 C4PlayerControlAssignmentSetsGetAssignmentSets () const
 

Detailed Description

Definition at line 308 of file C4PlayerControl.h.

Member Function Documentation

◆ Clear()

void C4PlayerControlFile::Clear ( )

Definition at line 868 of file C4PlayerControl.cpp.

869 {
870  ControlDefs.Clear();
871  AssignmentSets.Clear();
872 }

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

Referenced by Load().

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

◆ CompileFunc()

void C4PlayerControlFile::CompileFunc ( StdCompiler pComp)

Definition at line 840 of file C4PlayerControl.cpp.

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

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

Here is the call graph for this function:

◆ GetAssignmentSets()

const C4PlayerControlAssignmentSets& C4PlayerControlFile::GetAssignmentSets ( ) const
inline

Definition at line 320 of file C4PlayerControl.h.

320 { return AssignmentSets; }

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

Here is the caller graph for this function:

◆ GetControlDefs()

const C4PlayerControlDefs& C4PlayerControlFile::GetControlDefs ( ) const
inline

Definition at line 319 of file C4PlayerControl.h.

319 { return ControlDefs; }

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

Here is the caller graph for this function:

◆ Load()

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

Definition at line 846 of file C4PlayerControl.cpp.

847 {
848  // clear previous
849  Clear();
850  // load and prepare file contents
851  StdStrBuf Buf;
852  if (!hGroup.LoadEntryString(szFilename, &Buf)) return false;
853  if (pLang) pLang->ReplaceStrings(Buf);
854  // parse it!
855  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(*this, Buf, szFilename)) return false;
856  return true;
857 }
bool LoadEntryString(const char *entry_name, StdStrBuf *buffer)
Definition: C4Group.cpp:2430
void ReplaceStrings(StdStrBuf &rBuf)

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

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

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

◆ Save()

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

Definition at line 859 of file C4PlayerControl.cpp.

860 {
861  // decompile to buffer and save buffer to group
862  StdStrBuf Buf;
863  if (!DecompileToBuf_Log<StdCompilerINIWrite>(*this, &Buf, szFilename)) return false;
864  hGroup.Add(szFilename, Buf, false, true);
865  return true;
866 }
bool Add(const char *filename, const char *entry_name)
Definition: C4Group.cpp:1621

References C4Group::Add().

Here is the call graph for this function:

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