I have a variable of type "MoveDirection" that is currently used like this: MoveDirection direction = MoveDirection.Right;
However, instead of always going right (MoveDirection.Right) I wanted to make it RANDOM, so that "direction" could be any of the four possible results in the enum MoveDirection
Given the following Enum:
I need a way to generate a Random value of the enum MoveDirection, I thought of using Rand but am unable to generate anything other then just random numbers and not random enums of type MoveDirection.
Any ideas, hints, and help would be greatly appreciated, thanks
However, instead of always going right (MoveDirection.Right) I wanted to make it RANDOM, so that "direction" could be any of the four possible results in the enum MoveDirection
Given the following Enum:
Code:
public enum MoveDirection
{
Right,
Up,
Down,
Left
}
I need a way to generate a Random value of the enum MoveDirection, I thought of using Rand but am unable to generate anything other then just random numbers and not random enums of type MoveDirection.
Any ideas, hints, and help would be greatly appreciated, thanks