Can you specify an Enum's size/type?

About Monkey 2 Forums Monkey 2 Programming Help Can you specify an Enum's size/type?

This topic contains 2 replies, has 3 voices, and was last updated by  AdamStrange 1 year, 12 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8825

    ImmutableOctet
    Participant

    Not sure if this is already a thing, but having the ability to specify what integral type is used behind an Enum would be really useful. For example, an array of Enums would be 32 bits per element by default, but if I can specify an 8-bit type, then I can decrease memory consumption significantly.

    I haven’t been able to figure out how to do this, if it’s even possible for that matter.

    #8834

    abakobo
    Participant

    I think for now enums are just 32 bits Uints in monkey2. I’ve had the opposite problem, I wanted more than 32 bits..

    #8845

    AdamStrange
    Participant

    Use const instead:

    etc… This also means they can be used properly in maths, etc

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.