Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Enums?

A topic by Zefalcon created Mar 16, 2018 Views: 268 Replies: 4
Viewing posts 1 to 6
Submitted

Would enums be allowed (asking about C# Unity specifically), or would that fall under the same idea as structs?

Submitted

I have been wondering the same thing. Decided to play it safe though and just stick with using an int.

HostSubmitted

I was very close to creating a poll on twitter regarding this. I decided to scaffold stuff with enums and then replace it all with regular ints later on.
What do you guys think should be the guideline? Enums or no Enums?

Submitted

Enums aren't classes or structs - it's just a bit of syntactic sugar over the ints. I think Enums should be allowed, as long as they're in the same file as the rest of the game.

In Java enums are syntactic sugar for static classes, not for ints