• Advertisement
Sign in to follow this  

C# Enums

This topic is 2897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
I completely forgot about casting.

Thanks, it worked perfectly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement