Minetest  5.4.0
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)
 
bool getMapSettingNoiseParams (const std::string &name, NoiseParams *value_out)
 
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
 
Settingsm_map_settings
 

Constructor & Destructor Documentation

◆ MapSettingsManager()

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

References Settings::createLayer(), Settings::getLayer(), m_map_settings, Mapgen::setDefaultSettings(), SL_DEFAULTS, and SL_MAP.

+ Here is the call graph for this function:

◆ ~MapSettingsManager()

MapSettingsManager::~MapSettingsManager ( )

References m_map_settings, and mapgen_params.

Member Function Documentation

◆ getMapSetting()

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

References Settings::getLayer(), Settings::getNoEx(), m_map_settings, and SL_GLOBAL.

Referenced by ModApiMapgen::l_get_biome_data(), ModApiMapgen::l_get_heat(), ModApiMapgen::l_get_humidity(), 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 
)

References Settings::getNoiseParams(), and m_map_settings.

Referenced by ModApiMapgen::l_get_biome_data(), ModApiMapgen::l_get_heat(), ModApiMapgen::l_get_humidity(), 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, 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_map_settings, MAPGEN_DEFAULT, MAPGEN_INVALID, mapgen_params, and params.

Referenced by Server::init(), 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 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 Settings::getLayer(), m_map_settings, mapgen_params, Settings::set(), and SL_GLOBAL.

Referenced by ModApiMapgen::l_set_mapgen_params(), ModApiMapgen::l_set_mapgen_setting(), 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 Settings::getLayer(), m_map_settings, mapgen_params, Settings::setNoiseParams(), and SL_GLOBAL.

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_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: