Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
117 stars 32 forks source link

MajorRecord type enumerator #510

Closed Noggog closed 5 months ago

Noggog commented 5 months ago

Add a way to easily enumerate all major record types in a given game release

Right now the easiest way is to iterate LoquiRegistration.StaticRegister.Registrations and filter on any that implement IMajorRecordGetter. Would be good to add a more mutagen official route, though

Elscrux commented 5 months ago

Where would you like to have this? In the Core project in some folder?

Noggog commented 5 months ago

Maybe within Core/Plugins/Records/Mapping? That's where logic for finding what link interfaces exist given a GameCategory, or looking up the getter type from any mutagen class type, etc. Seems like a decent spot to pop in a MajorRecordTypeEnumerator that has a IEnumerable<Type> GetMajorRecordTypesFor(GameCategory cat)

Noggog commented 5 months ago

For now it can just house the LoquiRegistration loop in a lazy variable? Maybe eventually we'll hyperoptimize and have the code generation fish for all the types ahead of time