![]() |
|
Base serialization context for loading data back to the game. More...
Public Member Functions | |
| proto bool | Read (out void value) |
| Read a given value. Name of property is automatically derived from the input variable name. | |
| proto bool | ReadValue (string name, out void value) |
| Read an explictly named value. | |
| proto bool | ReadDefault (out void value, void defaultValue) |
| s. Read, if the property was not found but the context type allows to seek members (e.g. json) it will return the default value provided. | |
| proto bool | ReadValueDefault (string name, out void value, void defaultValue) |
| s. ReadValue andReadDefault | |
| proto bool | ReadMapKey (int idx, out string key) |
| Manual map key reading, must be read in order (idx=0..N) | |
| proto external bool | DoesKeyExist (string name) |
| Check if the currently open object has any member with the given key name. | |
| proto external bool | DoesObjectExist (string name) |
| Check if the context has a child object of that name. | |
Public Member Functions inherited from SerializationContext | |
| proto external bool | CanSeekMembers () |
| proto external bool | IsValid () |
| proto external string | GetDataExtension () |
| proto external void | ConfigureTypeDiscriminator (string fieldName="$type") |
| Type discriminator is used to add polymorph object instance support to the serializer. | |
| proto external bool | EnableTypeDiscriminator (bool enabled) |
| Enable or disable, can be used to pause it for a specific variable and resume after it was written. | |
| proto external bool | IsTypeDiscriminatorEnabled () |
| Is the type discrimiation currently enabled. | |
| proto external void | Reset () |
| Reset buffers to re-use for new data. | |
| proto bool | StartMap (string name, out int count) |
| Start new map. Empty name will result in an anonymous map. Count must be known ahead of time. | |
| proto external bool | EndMap () |
| proto bool | StartArray (string name, out int count) |
| Start new array. Empty name will result in an anonymous array. Count must be known ahead of time. | |
| proto external bool | EndArray () |
| proto external bool | StartObject (string name=string.Empty) |
| Start new subobject. Empty name will result in an anonymous object. | |
| proto external bool | EndObject () |
Base serialization context for loading data back to the game.
It works as an adapter between the game logic and serialized data.
| proto external bool LoadContext.DoesKeyExist | ( | string | name | ) |
Check if the currently open object has any member with the given key name.
This includes child objects. NOTE: Support depends on specific context implementation. Binary container will always return true!
| proto external bool LoadContext.DoesObjectExist | ( | string | name | ) |
Check if the context has a child object of that name.
NOTE: Support depends on specific context implementation. Binary container will always return true unless object seeking is enabled!
| proto bool LoadContext.Read | ( | out void | value | ) |
Read a given value. Name of property is automatically derived from the input variable name.
| proto bool LoadContext.ReadDefault | ( | out void | value, |
| void | defaultValue ) |
s. Read, if the property was not found but the context type allows to seek members (e.g. json) it will return the default value provided.
| proto bool LoadContext.ReadMapKey | ( | int | idx, |
| out string | key ) |
Manual map key reading, must be read in order (idx=0..N)
| proto bool LoadContext.ReadValue | ( | string | name, |
| out void | value ) |
Read an explictly named value.
| proto bool LoadContext.ReadValueDefault | ( | string | name, |
| out void | value, | ||
| void | defaultValue ) |
s. ReadValue andReadDefault