Skip to content

Consistent Typing -  #2

@dantarion

Description

@dantarion

There are a few fields in BCM/BAC that end up with inconsistant typing when converted to JSON. This causes problems when using a staticly typed language like Go to read the outputted JSON.

InputDirection in BCM is sometimes a string, and sometimes an int.
Value 4096 is the culprint, it's a special value for Neutral,

Basically this speaks more about magic numbers than anything else.

Idea #1: Let tools handle fancy labels, leave everything as raw values.
This is easiest to implement, but makes things awkward for those editing JSON by hand.
Idea #2: Let MoveTool convert things to fancy strings or constants when it can, but always of the same type(convert unknown values to strings instead of leaving them as ints), and consistent joining of flags, i.e. FLAG1, FLAG2 vs FLAG1|FLAG2

I plan on forking MoveTool to fix this and some bugs but I thought I'd open this discussion here and see what you think :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions