1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

replace RESOURCE_QUANTITY where possible

This commit is contained in:
Laserlicht
2025-09-14 21:12:51 +02:00
parent a54a1f8b8d
commit f034584dfa
14 changed files with 51 additions and 37 deletions

View File

@@ -106,8 +106,9 @@ void StatisticDataSetEntry::serializeJson(JsonSerializeFormat & handler)
handler.serializeBool("hasGrail", hasGrail);
{
auto zonesData = handler.enterStruct("numMines");
for(TResource idx = 0; idx < (GameConstants::RESOURCE_QUANTITY - 1); idx++)
handler.serializeInt(LIBRARY->resourceTypeHandler->getById(idx)->getJsonKey(), numMines[idx], 0);
for(auto & idx : LIBRARY->resourceTypeHandler->getAllObjects())
if(idx != GameResID::MITHRIL)
handler.serializeInt(LIBRARY->resourceTypeHandler->getById(idx)->getJsonKey(), numMines[idx], 0);
}
handler.serializeInt("score", score);
handler.serializeInt("maxHeroLevel", maxHeroLevel);