public static Direction Turn(Direction pDirection, int pDegrees) { int degrees = (int)IntPoint.DirectionToIntPoint(pDirection).Degrees(); degrees += pDegrees; return(GridMath.DegreesToDirection((int)degrees)); }
public static Direction RadiansToDirection(float pRadians) { int dir = (int)(System.Math.Round(pRadians * EIGHTH, 0)); // cap to eight directions return(GridMath.DirectionIndexToDirection(dir & 7)); }