SiegeEngineers / genie-rs

Rust libraries for reading/writing various Age of Empires I/II files.
https://docs.rs/genie
GNU General Public License v3.0
18 stars 9 forks source link

genie-rec: move to state based header reader, and define traits for elements #45

Closed the-eater closed 1 year ago

the-eater commented 3 years ago

This also includes some new traits/structs that are in preparation for the DE parsing, (e.g. there's a recording version that either uses 8 vs 7 byte tiles, which requires peeking over the tile list to see which it is)

also using input: &mut R allows us to just pass the same reference through, instead of having a weird chain where we keep creating a new mutable reference to a our reader (which is actually mutable reference etc.) this was also why the type recursion was going on in UnitAction

the-eater commented 3 years ago

Fixed the Trial vs Trail thing, and moved the traits to their own element file, and made a specific trait for elements that can be written

simonsan commented 1 year ago

Thanks! :)