Class JsonWorldSerializer
- Namespace
- Frent.Serialization
- Assembly
- Frent.dll
Provides functionality for serializing and deserializing a World instance to and from JSON.
public class JsonWorldSerializer
- Inheritance
-
JsonWorldSerializer
- Inherited Members
Constructors
JsonWorldSerializer(JsonSerializerOptions?, bool, bool)
Initializes a new instance of the JsonWorldSerializer class, which is used to serialize and deserialize World instances to and from JSON.
public JsonWorldSerializer(JsonSerializerOptions? options = null, bool ignoreNonSerializableComponents = true, bool addGeneratedTypeInfoResolvers = true)
Parameters
optionsJsonSerializerOptionsThe JsonSerializerOptions to use for customizing JSON serialization behavior. If null, default options are used.
ignoreNonSerializableComponentsboolIndicates whether to skip components that cannot be serialized or throw an exception.
addGeneratedTypeInfoResolversboolSpecifies whether to add source generated type resolvers to this serializer.
Properties
Default
Gets the default instance of the serializer used for serializing and deserializing world data in JSON format.
public static JsonWorldSerializer Default { get; }
Property Value
Remarks
Default is used along with converters for Frent specific types.
Methods
Deserialize(Stream, bool, IUniformProvider?)
Deserializes a world and its entities from the specified JSON stream.
public World Deserialize(Stream stream, bool invokeIniters = false, IUniformProvider? uniformProvider = null)
Parameters
streamStreaminvokeInitersbooluniformProviderIUniformProvider
Returns
Deserialize(string, bool, IUniformProvider?)
Deserializes a JSON string into a new instance of the World class.
public World Deserialize(string json, bool invokeIniters = false, IUniformProvider? uniformProvider = null)
Parameters
jsonstringinvokeInitersbooluniformProviderIUniformProvider
Returns
Serialize(World, Query?)
public string Serialize(World world, Query? query = null)
Parameters
worldWorldqueryQuery
Returns
Serialize(Stream, World, Query?)
public void Serialize(Stream stream, World world, Query? query = null)
Parameters
Serialize(Utf8JsonWriter, World, Query?)
public void Serialize(Utf8JsonWriter writer, World world, Query? query = null)
Parameters
writerUtf8JsonWriterworldWorldqueryQuery