A serializer that is able to deserialize JSON produced by QuantumUnityJsonSerializer. Handles SerializeReference, Unity-style byte[] serialization and fixed-size buffers. Uses UnityJsonUtilityConvert under the hood.
More...
Inherits IAssetSerializer.
|
virtual TextReader | CreateReader (Stream stream) |
| Creates a text reader for the given stream. More...
|
|
virtual TextWriter | CreateWriter (Stream stream) |
| Creates a text writer for the given stream. More...
|
|
A serializer that is able to deserialize JSON produced by QuantumUnityJsonSerializer. Handles SerializeReference, Unity-style byte[] serialization and fixed-size buffers. Uses UnityJsonUtilityConvert under the hood.
◆ FromJson< T >() [1/2]
Converts a JSON string to an object.
- Template Parameters
-
T | The type of the object to convert to. |
- Parameters
-
json | The JSON string to convert. |
- Returns
- The converted object.
◆ FromJson()
object QuantumJsonSerializer.FromJson |
( |
string |
json, |
|
|
Type |
type |
|
) |
| |
|
inline |
Converts a JSON string to an object.
- Parameters
-
json | The JSON string to convert. |
type | The type of the object to convert to. |
- Returns
- The converted object.
◆ FromJson< T >() [2/2]
Converts a JSON object to an object.
- Template Parameters
-
T | The type of the object to convert to. |
- Parameters
-
json | The JSON object to convert. |
- Returns
- The converted object.
◆ ToJson< T >()
string QuantumJsonSerializer.ToJson< T > |
( |
T |
obj | ) |
|
|
inline |
Converts an object to a JSON string.
- Template Parameters
-
T | The type of the object to convert. |
- Parameters
-
obj | The object to convert. |
- Returns
- The JSON string representation of the object.
◆ SerializeConfig()
void QuantumJsonSerializer.SerializeConfig |
( |
Stream |
stream, |
|
|
IRuntimeConfig |
config |
|
) |
| |
|
inline |
Serializes the runtime configuration to a stream.
- Parameters
-
stream | The stream to serialize to. |
config | The runtime configuration to serialize. |
◆ SerializePlayer()
void QuantumJsonSerializer.SerializePlayer |
( |
Stream |
stream, |
|
|
IRuntimePlayer |
player |
|
) |
| |
|
inline |
Serializes the runtime player to a stream.
- Parameters
-
stream | The stream to serialize to. |
player | The runtime player to serialize. |
◆ SerializeAssets()
void QuantumJsonSerializer.SerializeAssets |
( |
Stream |
stream, |
|
|
AssetObject[] |
assets |
|
) |
| |
|
inline |
Serializes the assets to a stream.
- Parameters
-
stream | The stream to serialize to. |
assets | The assets to serialize. |
◆ DeserializeConfig()
IRuntimeConfig QuantumJsonSerializer.DeserializeConfig |
( |
Stream |
stream | ) |
|
|
inline |
Deserializes the runtime configuration from a stream.
- Parameters
-
stream | The stream to deserialize from. |
- Returns
- The deserialized runtime configuration.
◆ DeserializePlayer()
IRuntimePlayer QuantumJsonSerializer.DeserializePlayer |
( |
Stream |
stream | ) |
|
|
inline |
Deserializes the runtime player from a stream.
- Parameters
-
stream | The stream to deserialize from. |
- Returns
- The deserialized runtime player.
◆ SerializeResult()
void QuantumJsonSerializer.SerializeResult |
( |
Stream |
stream, |
|
|
IGameResult |
result |
|
) |
| |
|
inline |
Serializes the game result to a stream.
- Parameters
-
stream | The stream to serialize to. |
result | The game result to serialize. |
◆ DeserializeResult()
IGameResult QuantumJsonSerializer.DeserializeResult |
( |
Stream |
stream | ) |
|
|
inline |
Deserializes the game result from a stream.
- Parameters
-
stream | The stream to deserialize from. |
- Returns
- The deserialized game result.
◆ DeserializeAssets()
AssetObject [] QuantumJsonSerializer.DeserializeAssets |
( |
Stream |
stream | ) |
|
|
inline |
Deserializes the assets from a stream.
- Parameters
-
stream | The stream to deserialize from. |
- Returns
- The deserialized assets.
◆ PrintObject()
string QuantumJsonSerializer.PrintObject |
( |
object |
obj | ) |
|
|
inline |
Prints the object as a JSON string.
- Parameters
-
- Returns
- The JSON string representation of the object.
◆ CreateReader()
virtual TextReader QuantumJsonSerializer.CreateReader |
( |
Stream |
stream | ) |
|
|
protectedvirtual |
Creates a text reader for the given stream.
- Parameters
-
stream | The stream to create the reader for. |
- Returns
- The created text reader.
◆ CreateWriter()
virtual TextWriter QuantumJsonSerializer.CreateWriter |
( |
Stream |
stream | ) |
|
|
protectedvirtual |
Creates a text writer for the given stream.
- Parameters
-
stream | The stream to create the writer for. |
- Returns
- The created text writer.