mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
small refactoring
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user