goto-bus-stop / recanalyst

Analyzes Age of Empires 2 recorded game files.
https://goto-bus-stop.github.io/recanalyst/doc/v4.2.0
GNU General Public License v3.0
76 stars 11 forks source link

split library into readers and data model #54

Open goto-bus-stop opened 7 years ago

goto-bus-stop commented 7 years ago

Right now Analyzers return class instances, or sometimes they don't. They also read data from the recorded game file on demand, which can be nice, but which makes it more difficult to store data that's been read. For example, if you want to upload a rec, and then show the localized civilization names later, that's not really possible because the civName() method is tied to the Analyzer class.

It'd be neat if RecAnalyst was essentially two steps: reading data, and a modeling layer on top of that data. The readers would just return JSON. It could still read on demand, but you could also read everything, store the JSON somewhere, and create a new RecAnalyst instance based on that JSON blob to get the nice API without having to re-analyze the rec.

Probably going to try to align the JSON format with recage.