Skip to content

Fo4 PackageBranch ProcedureType and BranchType swapped to enum#642

Open
Noggog wants to merge 1 commit intoMutagen-Modding:devfrom
Noggog:ProcedureType-Enum
Open

Fo4 PackageBranch ProcedureType and BranchType swapped to enum#642
Noggog wants to merge 1 commit intoMutagen-Modding:devfrom
Noggog:ProcedureType-Enum

Conversation

@Noggog
Copy link
Member

@Noggog Noggog commented Sep 19, 2025

Potentially an upgrade. Can just ToString the enum. Or TryParse to go the other way

@Noggog Noggog requested a review from Elscrux September 19, 2025 00:14
@Elscrux
Copy link
Member

Elscrux commented Sep 20, 2025

The plan is to change the types for ProcedureType and BranchType for all games to expose a struct member like this where we can add a direct conversion to an enum field to make it visible to users in the api directly. The plan is not to change it to an enum directly to also allow invalid configurations of this string to be loaded by Mutagen. Parsing the enum would just fail for these.

// An alias struct, which is just a wrapped string, but has a distinct type now
public record struct ProcedureType(string str)
{
    // conversions, etc.
}

Loqui doesn't support this kind of wrapper type atm so this will have to wait until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants