PIbd-21_Markov_D.P._Contain.../Direction.java

25 lines
491 B
Java
Raw Normal View History

2022-12-01 23:30:57 +04:00
public enum Direction {
Up,
Down,
Left,
Right;
public static Direction FromInteger(int intValue)
{
switch(intValue)
{
case 1:
return Up;
case 2:
return Down;
case 3:
return Left;
case 4:
return Right;
default:
System.out.println("Error: incorrect value for enum");
return Up;
}
}
}