anno-mods / FileDBReader

A command line tool for working with a proprietary bluebyte file compression used in Anno 2205 and 1800.
15 stars 4 forks source link

Add Feature: Inherited Property Order Management #27

Closed Shad0wlife closed 1 year ago

Shad0wlife commented 1 year ago

By default in C#, inherited properties (properties in the Base class) are returned AFTER the child classes' properties. This behaviour may not be intended during deserialization and until now could only be controlled by avoiding using a base class and duplicating all the properties.

This feature instead adds the PropertyLocationAttribute which can be added to both classes and single properties and controls how the annotated (classes') properties are located in reference to their base class' properties.

The default behaviour is set to add the child classes' properties before their base class' properties as to mirror default C# behaviour.

Corresponding Unit Tests have been added and are named: