Procurement-PoE / Procurement

Path Of Exile Character & Stash Management Tool
Artistic License 2.0
331 stars 133 forks source link

Dynamically update a loot filter #1036

Closed thailyn closed 5 years ago

thailyn commented 5 years ago

This PR adds limited support for updating loot filters after recreating the list of recipes. There are two types of loot filters that can be added: items that are missing for partially-completed same-base-type recipes (that is, having a Normal, Magic, and Rare item of the same base type), with a variant for near-20% quality bases; and items that are chancing bases for builds in the current league.

The configuration for updating the item filters is managed by a Protocol Buffer .proto file. Support has been added for Visual Studio to automatically compile the .proto file into C# classes that are virtually immediately recognized by Visual Studio's error-checking- and intelligence-generating systems. Procurement reads and writes the actual configuration from and to a json file.

Closes #821.

Stickymaddness commented 5 years ago

Thanks for spending time on this, I'm curious what's the reason behind adding protobuf, I assume the main driver is the autogeneration and error checking?

thailyn commented 5 years ago

Protobufs provide a strongly-typed and easy to understand data structure for storing user data, which can also be written to/read from JSON, with, indeed, automatic parsing and error checking. The generated classes provide typical functions for handling the data. (Personally, I would strongly prefer to use Proto2 syntax instead of Proto3, but that is not supported by the official protobuf C# library, though it is, in my opinion, superior in several aspects.)