namespace Tickypip { public class DirectionUtil { public static Direction[] sDirections = { Direction.South, Direction.West, Direction.North, Direction.East }; public static Direction Opposite(Direction dir) { return sDirections[(int)dir]; } public static Direction RotateLeft(Direction dir) { return dir == Direction.North ? Direction.West : dir - 1; } public static Direction RotateRight(Direction dir) { return dir + 1 == Direction.Count ? Direction.North : dir + 1; } } }