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 polymorph support to deserialization #9

Closed jakobharder closed 2 years ago

jakobharder commented 2 years ago

There are two examples in the test cases:

[Polymorph(typeof(ValueItem), "value/id")]
[Polymorph(typeof(ComplexItem), "None/ObjectId")]
public BaseItem[]? List { get; set; }
[Polymorph(typeof(ElementType0), "ElementType", HexValue = "00000000", Node = PolymorphRootNode.Parent)]
[Polymorph(typeof(ElementType1), "ElementType", HexValue = "00000001", Node = PolymorphRootNode.Parent)]
public Element? Element { get; set; }
taubenangriff commented 2 years ago

lgtm