1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

small refactoring

This commit is contained in:
Laserlicht
2025-06-22 00:20:03 +02:00
parent de893a3575
commit bd090059da
4 changed files with 19 additions and 29 deletions

View File

@@ -46,25 +46,11 @@
VCMI_LIB_NAMESPACE_BEGIN
static std::string convertMapName(std::string input)
{
boost::algorithm::to_lower(input);
boost::algorithm::trim(input);
boost::algorithm::erase_all(input, ".");
size_t slashPos = input.find_last_of('/');
if(slashPos != std::string::npos)
return input.substr(slashPos + 1);
return input;
}
CMapLoaderH3M::CMapLoaderH3M(const std::string & mapName, const std::string & modName, const std::string & encodingName, CInputStream * stream)
: map(nullptr)
, reader(new MapReaderH3M(stream))
, inputStream(stream)
, mapName(convertMapName(mapName))
, mapName(TextOperations::convertMapName(mapName))
, modName(modName)
, fileEncoding(encodingName)
{