mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Json Serializer should now use identifers storage properly
This commit is contained in:
@ -63,9 +63,25 @@ void JsonSerializer::serializeInternal(const std::string & fieldName, std::vecto
|
||||
|
||||
for(const si32 rawId : value)
|
||||
{
|
||||
JsonNode jsonElement(JsonNode::JsonType::DATA_STRING);
|
||||
jsonElement.String() = encoder(rawId);
|
||||
data.push_back(std::move(jsonElement));
|
||||
JsonNode jsonElement(JsonNode::JsonType::DATA_STRING);
|
||||
jsonElement.String() = encoder(rawId);
|
||||
data.push_back(std::move(jsonElement));
|
||||
}
|
||||
}
|
||||
|
||||
void JsonSerializer::serializeInternal(const std::string & fieldName, std::vector<std::string> & value)
|
||||
{
|
||||
if(value.empty())
|
||||
return;
|
||||
|
||||
JsonVector & data = currentObject->operator[](fieldName).Vector();
|
||||
data.reserve(value.size());
|
||||
|
||||
for(const auto & rawId : value)
|
||||
{
|
||||
JsonNode jsonElement(JsonNode::JsonType::DATA_STRING);
|
||||
jsonElement.String() = rawId;
|
||||
data.push_back(std::move(jsonElement));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user