C# Enums

Started by
1 comment, last by Dasil 14 years, 1 month ago
Hi everyone, I'm making a game using XNA, and for my main menu, I have an enum (MenuSelection) that holds values such as "New Game", "Multiplayer", "Options", and "Exit". I create a MenuSelection object, called mMenuSelection. The user selects a menu option by using the up and down arrow keys. To change the selection, I use mMenuSelection++ or mMenuSelection--, and this works, but my problem is that I don't know how to figure out what the int value of the current selection is. I have a totalOptions int variable that stores the total number of menu options. I want to check to see if the selected option is the last option. Sorry if this doesn't make sense, but I'm in a hurry and don't have time to proofread. Thanks
Advertisement
I think you just want to cast the enum to int.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
I completely forgot about casting.

Thanks, it worked perfectly.

This topic is closed to new replies.

Advertisement