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

Update for FileDB v3 Node Count Field #31

Closed Shad0wlife closed 1 year ago

Shad0wlife commented 1 year ago

Adds the CountNodes() expansion method to IFileDBDocument. It iterates over the Node structure starting with the Roots to count all nodes and adds 1 (for the "Content" node). For simplification of the calculation, Tags now have a method to recursively count their children.

Restructured IFileDBWriter and its implementations a bit to split up the writing of the tag section and the offsets, so that v3 can write the node count in between.

Updated FileDB v3 Unit Test.