MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SerializePatch

Method SerializePatch

Source/Editor/Tools/Terrain/TerrainTools.cpp:272–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272StringAnsi TerrainTools::SerializePatch(Terrain* terrain, const Int2& patchCoord)
273{
274 CHECK_RETURN(terrain, StringAnsi::Empty);
275 auto patch = terrain->GetPatch(patchCoord);
276 CHECK_RETURN(patch, StringAnsi::Empty);
277
278 rapidjson_flax::StringBuffer buffer;
279 CompactJsonWriter writerObj(buffer);
280 JsonWriter& writer = writerObj;
281 writer.StartObject();
282 patch->Serialize(writer, nullptr);
283 writer.EndObject();
284
285 return StringAnsi(buffer.GetString());
286}
287
288void TerrainTools::DeserializePatch(Terrain* terrain, const Int2& patchCoord, const StringAnsiView& value)
289{

Callers 1

DeletePatchActionMethod · 0.80

Calls 6

GetPatchMethod · 0.80
StringAnsiFunction · 0.50
StartObjectMethod · 0.45
SerializeMethod · 0.45
EndObjectMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected