Code: Select all
...
public enum Directions:byte{
Left = 0,
Up = 1,
Right = 2,
Down = 3,
}
...
switch (Direction) {
case Directions.Left:
NewXPos--;
break;
case Directions.Up:
System.Console.WriteLine("up");
NewYPos--;
break;
case Directions.Right:
NewXPos++;
break;
case Directions.Down:
NewYPos++;
break;
}
...
Code: Select all
stratego.cs(46) error CS0029: Cannot convert implicitly from `Directions' to `byte'
Anyway to solve this without using (byte) ?

