public void DegreesToDirection() { Assert.AreEqual(Direction.UP, GridMath.DegreesToDirection(0)); Assert.AreEqual(Direction.RIGHT, GridMath.DegreesToDirection(90)); Assert.AreEqual(Direction.DOWN, GridMath.DegreesToDirection(180)); Assert.AreEqual(Direction.LEFT, GridMath.DegreesToDirection(270)); }
public void TurnDegrees(int pDegrees) { int degrees = (int)IntPoint.DirectionToIntPoint(direction).Degrees(); degrees -= pDegrees; direction = GridMath.DegreesToDirection((int)degrees); }