DDraceNetwork Docs
CMapSettingsBackend Class Reference

#include <editor_server_settings.h>

Inheritance diagram for CMapSettingsBackend:
[legend]
Collaboration diagram for CMapSettingsBackend:
[legend]

Classes

class  CArgumentConstraintsBuilder
 
class  CCommandArgumentConstraintBuilder
 
class  CContext
 
struct  SLoadedMapSettings
 

Public Types

enum class  EArgConstraint { DEFAULT = 0 , UNIQUE , MULTIPLE }
 

Public Member Functions

 CMapSettingsBackend ()=default
 
void OnInit (CEditor *pEditor) override
 
bool OnInput (const IInput::CEvent &Event) override
 
void OnUpdate () override
 
void OnMapLoad () override
 
EArgConstraint ArgConstraint (const char *pSettingName, int Arg) const
 
const std::vector< SParsedMapSettingArg > & ParsedArgs (const std::shared_ptr< IMapSetting > &pSetting) const
 
CContext NewContext (CLineInput *pLineInput)
 
- Public Member Functions inherited from CEditorComponent
virtual bool OnInput (const IInput::CEvent &Event) override
 
void InitSubComponents ()
 
void RegisterSubComponent (CEditorComponent &Component)
 
- Public Member Functions inherited from CEditorObject
virtual ~CEditorObject ()=default
 
virtual void OnInit (CEditor *pEditor)
 
virtual void OnUpdate ()
 
virtual bool OnInput (const IInput::CEvent &Event)
 
virtual void OnRender (CUIRect View)
 
virtual void OnHot ()
 
virtual void OnActive ()
 
virtual void OnReset ()
 
virtual void OnMapLoad ()
 
bool IsHot ()
 
void SetHot ()
 
void UnsetHot ()
 
bool IsActive ()
 
void SetActive ()
 
void SetInactive ()
 
CEditorEditor ()
 
const CEditorEditor () const
 
IInputInput ()
 
IClientClient ()
 
CConfigConfig ()
 
IConsoleConsole ()
 
IEngineEngine ()
 
IGraphicsGraphics ()
 
ISoundSound ()
 
ITextRenderTextRender ()
 
IStorageStorage ()
 
CUiUi ()
 
CRenderToolsRenderTools ()
 

Private Types

typedef void(* FLoaderFunction) (const CSettingValuesBuilder &)
 
using TArgumentConstraints = std::map< int, EArgConstraint >
 
using TCommandArgumentConstraints = std::map< std::string, TArgumentConstraints >
 

Private Member Functions

void LoadAllMapSettings ()
 
void LoadCommand (const char *pName, const char *pArgs, const char *pHelp)
 
void LoadSettingInt (const std::shared_ptr< SMapSettingInt > &pSetting)
 
void LoadSettingCommand (const std::shared_ptr< SMapSettingCommand > &pSetting)
 
void InitValueLoaders ()
 
void LoadPossibleValues (const CSettingValuesBuilder &Builder, const std::shared_ptr< IMapSetting > &pSetting)
 
void RegisterLoader (const char *pSettingName, const FLoaderFunction &pfnLoader)
 
void LoadConstraints ()
 

Static Private Member Functions

static void PossibleConfigVariableCallback (const struct SConfigVariable *pVariable, void *pUserData)
 

Private Attributes

TCommandArgumentConstraints m_ArgConstraintsPerCommand
 
std::vector< std::shared_ptr< IMapSetting > > m_vpMapSettings
 
std::map< std::shared_ptr< IMapSetting >, std::vector< SParsedMapSettingArg > > m_ParsedCommandArgs
 
TSettingsArgumentValues m_PossibleValuesPerCommand
 
std::map< std::string, FLoaderFunctionm_LoaderFunctions
 
struct CMapSettingsBackend::SLoadedMapSettings m_LoadedMapSettings
 

Static Private Attributes

static CContextms_pActiveContext = nullptr
 

Friends

class CEditor
 

Member Typedef Documentation

◆ FLoaderFunction

typedef void(* CMapSettingsBackend::FLoaderFunction) (const CSettingValuesBuilder &)
private

◆ TArgumentConstraints

◆ TCommandArgumentConstraints

Member Enumeration Documentation

◆ EArgConstraint

Enumerator
DEFAULT 
UNIQUE 
MULTIPLE 

Constructor & Destructor Documentation

◆ CMapSettingsBackend()

CMapSettingsBackend::CMapSettingsBackend ( )
default

Member Function Documentation

◆ ArgConstraint()

EArgConstraint CMapSettingsBackend::ArgConstraint ( const char *  pSettingName,
int  Arg 
) const
inline

◆ InitValueLoaders()

void CMapSettingsBackend::InitValueLoaders ( )
private

◆ LoadAllMapSettings()

void CMapSettingsBackend::LoadAllMapSettings ( )
private

◆ LoadCommand()

void CMapSettingsBackend::LoadCommand ( const char *  pName,
const char *  pArgs,
const char *  pHelp 
)
private

◆ LoadConstraints()

void CMapSettingsBackend::LoadConstraints ( )
private

◆ LoadPossibleValues()

void CMapSettingsBackend::LoadPossibleValues ( const CSettingValuesBuilder Builder,
const std::shared_ptr< IMapSetting > &  pSetting 
)
private

◆ LoadSettingCommand()

void CMapSettingsBackend::LoadSettingCommand ( const std::shared_ptr< SMapSettingCommand > &  pSetting)
private

◆ LoadSettingInt()

void CMapSettingsBackend::LoadSettingInt ( const std::shared_ptr< SMapSettingInt > &  pSetting)
private

◆ NewContext()

CContext CMapSettingsBackend::NewContext ( CLineInput pLineInput)
inline

◆ OnInit()

void CMapSettingsBackend::OnInit ( CEditor pEditor)
overridevirtual

Initialise the component and interface pointers. Needs to be the first function that is called. The default implentation also resets the component.

Reimplemented from CEditorObject.

◆ OnInput()

bool CMapSettingsBackend::OnInput ( const IInput::CEvent Event)
overridevirtual

Gets called before OnRender. Should return true if the event was consumed. By default the events are forwarded to the subcomponents.

Reimplemented from CEditorComponent.

◆ OnMapLoad()

void CMapSettingsBackend::OnMapLoad ( )
overridevirtual

Reimplemented from CEditorObject.

◆ OnUpdate()

void CMapSettingsBackend::OnUpdate ( )
overridevirtual

Maybe calls OnHot or OnActive.

Reimplemented from CEditorObject.

◆ ParsedArgs()

const std::vector< SParsedMapSettingArg > & CMapSettingsBackend::ParsedArgs ( const std::shared_ptr< IMapSetting > &  pSetting) const
inline

◆ PossibleConfigVariableCallback()

void CMapSettingsBackend::PossibleConfigVariableCallback ( const struct SConfigVariable pVariable,
void *  pUserData 
)
staticprivate

◆ RegisterLoader()

void CMapSettingsBackend::RegisterLoader ( const char *  pSettingName,
const FLoaderFunction pfnLoader 
)
private

Friends And Related Function Documentation

◆ CEditor

friend class CEditor
friend

Member Data Documentation

◆ m_ArgConstraintsPerCommand

TCommandArgumentConstraints CMapSettingsBackend::m_ArgConstraintsPerCommand
private

◆ m_LoadedMapSettings

struct CMapSettingsBackend::SLoadedMapSettings CMapSettingsBackend::m_LoadedMapSettings
private

◆ m_LoaderFunctions

std::map<std::string, FLoaderFunction> CMapSettingsBackend::m_LoaderFunctions
private

◆ m_ParsedCommandArgs

std::map<std::shared_ptr<IMapSetting>, std::vector<SParsedMapSettingArg> > CMapSettingsBackend::m_ParsedCommandArgs
private

◆ m_PossibleValuesPerCommand

TSettingsArgumentValues CMapSettingsBackend::m_PossibleValuesPerCommand
private

◆ m_vpMapSettings

std::vector<std::shared_ptr<IMapSetting> > CMapSettingsBackend::m_vpMapSettings
private

◆ ms_pActiveContext

CMapSettingsBackend::CContext * CMapSettingsBackend::ms_pActiveContext = nullptr
staticprivate

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