Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
MapSettingsManager Class Reference

#include <map_settings_manager.h>

+ Collaboration diagram for MapSettingsManager:

Public Member Functions

 MapSettingsManager (const std::string &map_meta_path)
 
 ~MapSettingsManager ()
 
bool getMapSetting (const std::string &name, std::string *value_out) const
 
bool getMapSettingNoiseParams (const std::string &name, NoiseParams *value_out) const
 
bool setMapSetting (const std::string &name, const std::string &value, bool override_meta=false)
 
bool setMapSettingNoiseParams (const std::string &name, const NoiseParams *value, bool override_meta=false)
 
bool loadMapMeta ()
 
bool saveMapMeta ()
 
MapgenParamsmakeMapgenParams ()
 

Public Attributes

MapgenParamsmapgen_params = nullptr
 

Private Attributes

std::string m_map_meta_path
 
SettingsHierarchy m_hierarchy
 
Settingsm_defaults
 
Settingsm_map_settings
 

Constructor & Destructor Documentation

◆ MapSettingsManager()

MapSettingsManager::MapSettingsManager ( const std::string & map_meta_path)

◆ ~MapSettingsManager()

MapSettingsManager::~MapSettingsManager ( )

Member Function Documentation

◆ getMapSetting()

bool MapSettingsManager::getMapSetting ( const std::string & name,
std::string * value_out ) const

References Settings::getNoEx(), and m_map_settings.

Referenced by ModApiMapgen::l_get_mapgen_edges(), ModApiMapgen::l_get_mapgen_params(), ModApiMapgen::l_get_mapgen_setting(), makeMapgenParams(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ getMapSettingNoiseParams()

bool MapSettingsManager::getMapSettingNoiseParams ( const std::string & name,
NoiseParams * value_out ) const

References Settings::getNoiseParams(), and m_map_settings.

Referenced by ModApiMapgen::l_get_mapgen_setting_noiseparams(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ loadMapMeta()

bool MapSettingsManager::loadMapMeta ( )

References errorstream, m_map_meta_path, m_map_settings, open_ifstream(), and Settings::parseConfigLines().

Referenced by ServerMap::ServerMap(), TestMapSettingsManager::testMapMetaFailures(), TestMapSettingsManager::testMapMetaSaveLoad(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ makeMapgenParams()

MapgenParams * MapSettingsManager::makeMapgenParams ( )

References Mapgen::createMapgenParams(), errorstream, Mapgen::getMapgenName(), Mapgen::getMapgenType(), getMapSetting(), m_defaults, m_map_settings, MAPGEN_DEFAULT, MAPGEN_INVALID, mapgen_params, MapgenParams::mgtype, and MapgenParams::readParams().

Referenced by loadGameConfAndInitWorld(), TestMapSettingsManager::testMapMetaSaveLoad(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ saveMapMeta()

bool MapSettingsManager::saveMapMeta ( )

References fs::CreateAllDirs(), errorstream, infostream, m_map_meta_path, m_map_settings, mapgen_params, fs::RemoveLastPathComponent(), Settings::updateConfigFile(), and MapgenParams::writeParams().

Referenced by loadGameConfAndInitWorld(), ServerMap::save(), TestMapSettingsManager::testMapMetaSaveLoad(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ setMapSetting()

bool MapSettingsManager::setMapSetting ( const std::string & name,
const std::string & value,
bool override_meta = false )

References m_defaults, m_map_settings, mapgen_params, and Settings::set().

Referenced by ModApiMapgen::l_set_mapgen_params(), ModApiMapgen::l_set_mapgen_setting(), loadGameConfAndInitWorld(), and TestMapSettingsManager::testMapSettingsManager().

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

◆ setMapSettingNoiseParams()

bool MapSettingsManager::setMapSettingNoiseParams ( const std::string & name,
const NoiseParams * value,
bool override_meta = false )

References m_defaults, m_map_settings, mapgen_params, and Settings::setNoiseParams().

Referenced by ModApiMapgen::l_set_mapgen_setting_noiseparams(), and TestMapSettingsManager::testMapSettingsManager().

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

Member Data Documentation

◆ m_defaults

◆ m_hierarchy

SettingsHierarchy MapSettingsManager::m_hierarchy
private

Referenced by MapSettingsManager().

◆ m_map_meta_path

std::string MapSettingsManager::m_map_meta_path
private

Referenced by loadMapMeta(), and saveMapMeta().

◆ m_map_settings

◆ mapgen_params


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