TypeSerializationHelper
A static class in Root.Township, the global namespace.
Picks the network serializer for a field's type, used by ClassSerializationHelper and the Sync attributes to build read and write delegates. Built-in types are registered up front; enums, hashed values, logic data, save data and other classes get one made on first use.
- Listed in Global namespace: T to X
- Nested types
BitSerialization,BoolSerialization,ColorSerialization,DateTimeSerialization,EnumSerialization<T>,FailedTypeSerialization,FloatBitsSerialization,FloatPrecisionSerialization,FloatSerialization,HashedSerialization<T>,IntSerialization,ITypeSerialization,LogicManagerSetSerialization,LogicValueDataSerialization<T>,NetworkPrefabSerialization,ObjectActivator,QuaternionSerialization,SaveDataSerialization<T>,StringSerialization,SubClassSerialization<T>,TimeSpanSerialization,TypeSerialization<TType>,UintSerialization,Vector2Serialization,Vector3Serialization,Vector4Serialization
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private static Type hashedType | HashedGeneralValue, for spotting hashed value types. |
private static Type logicValueDataType | ILogicValueData, for spotting logic data types. |
private static Dictionary<Type, TypeSerializationHelper.ITypeSerialization> map | Cache of type to serializer. |
private static Type saveDataType | SaveData, for spotting save data types. |
Methods
| Member | What it is |
|---|---|
static TypeSerializationHelper.ObjectActivator GetActivator(Type type) | Compiles a fast delegate that calls the type's first constructor. Also used by SavingSystem. |
static TypeSerializationHelper.ITypeSerialization GetSerialization(Type type) | Returns the cached serializer for a type, making one for enums, hashed values, logic data, save data or classes. Logs an error and returns a do-nothing one otherwise. |
2 private and internal methods
| Member | What it is |
|---|---|
private static void Add(Type type, TypeSerializationHelper.ITypeSerialization serialization) | Registers a serializer for a type and calls its Initialize. |
private static void Add<T>(TypeSerializationHelper.TypeSerialization<T> serialization) | Registers a serializer for a type and calls its Initialize. |