1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Removed most of non-const static fields in lib. Reduced header includes.

This commit is contained in:
Ivan Savenko
2024-01-09 16:43:36 +02:00
parent a15366f5a5
commit e67e4430ba
49 changed files with 139 additions and 116 deletions

View File

@@ -328,7 +328,7 @@ std::vector<JsonNode> CArtHandler::loadLegacyData()
const std::vector<std::string> artSlots = { ART_POS_LIST };
#undef ART_POS
static std::map<char, std::string> classes =
static const std::map<char, std::string> classes =
{{'S',"SPECIAL"}, {'T',"TREASURE"},{'N',"MINOR"},{'J',"MAJOR"},{'R',"RELIC"},};
CLegacyConfigParser parser(TextPath::builtin("DATA/ARTRAITS.TXT"));
@@ -353,7 +353,7 @@ std::vector<JsonNode> CArtHandler::loadLegacyData()
artData["slot"].Vector().back().String() = artSlot;
}
}
artData["class"].String() = classes[parser.readString()[0]];
artData["class"].String() = classes.at(parser.readString()[0]);
artData["text"]["description"].String() = parser.readString();
parser.endLine();