BG3-Community-Library-Team / BG3-Compatibility-Framework

An API-based Driven Compatibility Framework for Baldur's Gate 3 Mods
MIT License
42 stars 13 forks source link

Create Internal dictionary for Levels, Classes, and Spell Lists #43

Closed NellsRelo closed 10 months ago

NellsRelo commented 11 months ago

For mods passing through a large amount of objects, a common situation they run into is needing to loop through all their objects to determine class and level. It may be useful to add an internal dictionary mapping Progressions and Spell Lists to specific levels and classes in a human-readable way(read: not having to specify a UUID).

The dictionary would probably look something like this:

Globals.FrameworkDict = {
    Bard = {
        Level1 = {
            Progression = ProgressionUUID,
            Lists = { } -- List UUIDs of each list associated with the given level
        }
    },
    Unaffiliated = {

    }

}

The passed object would support a new field: TargetClass and TargetLevel:

SentObject = {
    TargetClass = "bard",
    TargetLevel = "1",
    -- Other required parts of the object
}

Depending on the API this is passed through, this would grab the piece of Static Data that relates to the Class at the given level, instead of pulling from TargetProgression .

Another ticket will cover the handling of endpoints when passing in objects that want to make use of the new dictionary.