Updates on Brave Squire Tools

Recently, I have released a new build (1.4.27.122) of BraveSquire.Tools on itch.io. You can read about the toolbox’s origins here.

Better support of derived types

Serializing types that had a base type which itself was serialized used to be complicated, because a derived type’s serializer had (in some way) to handle the base type’s serialization. Now You can use base type initialization methods of serialiser sources and targets.

The methods WriteBaseInitializationData and InitializeBase are used to initialize the base type.

Support for attribute annotated types

For simple scenarios where you would implement a simple straightforward type serializer you can now alternatively simply annotate a type and so make it serializable. Versioning and base type serialization also work with this alternative.

For each serialized type, you declare the type’s type id and weather or not it is serialized as a value.
For each field, You declare a unique ushort id and weather or not to serialize it dynamically. If you want versioning to work properly, You don’t reuse ids of removed fields.

To be able to serialize such a type, you have to register it with the TypeSerializerRepository either by one of three methods…

…or You pass it to the constructor…

..which especially is handy in a dependency injection environment.

One thought on “Updates on Brave Squire Tools”

Leave a Reply

Your email address will not be published. Required fields are marked *