Enumerations in blocks!

Have you every wanted enums in blocks? To be able to save the state of your player or game, but as a number? Introducing enum-blocks!

blocks it adds:

  • setEnumVar / setEnumVarStatement - sets/adds a key to an enum, with an optional number (details to last+1).
  • getEnumVar - gets the number assigned to a key in an enum.
  • enumVar - same as getEnumVar, but if the key doesn’t exist, it will create it for you.
  • enumStr - gets the name of a key, which normal enums do not have.

test projects (same thing but different code, the first uses set/getEnumVar while the second uses enumVar):

1 Like

Such a cool extension! Now I don’t have to see so many “magic numbers” in my friends enemy/ai state! I’m going to tell him about this extension as soon as I can! :rofl:

2 Likes

This would be heavenly if it weren’t for richards state extension

1 Like

this is smart

1 Like

[Extension] Enums in blocks! this was already made

2 Likes

I thought so but that one technically only contained one enum if that makes sense. This one allows multiple like PlayerAnims, EnemyAnims, GameState, etc.

2 Likes

what is his state extension?

2 Likes

Here: