Skip to content

Order of UnitInfos in static constructors does not match enum values in-order. #1226

Closed
@tmilnthorp

Description

@tmilnthorp

Describe the bug
The order of UnitInfo registration in static constructors does not (always) match enum values in-order. This makes trying to retrieve a UnitInfo by index (of the enum value) impossible.

To Reproduce
Steps to reproduce the behavior (just an example):

  1. Look at static Length()
  2. Megameter (value 41) is the 20th index in the array.

Expected behavior
How can we retrieve a UnitInfo based on a unit enum value? We may need to move to a Dictionary.

Additional context
This is especially applicable as I work through #1210, trying to get the abbreviations based on an enum value.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions