public Cordinate <T> ComputeNewCordinate(Cordinate <T> cordinate, U step, IMoveArea <T> moveArea, IDirection <T, U> direction) { //determine the move direction return(direction.Move(cordinate, step, moveArea.Width, moveArea.Height)); }
public static void IsCordinateValid <T>(RoboPlacementCommandSegment commandSegments, IMoveArea <T> moveArea) { var coordX = (T)Convert.ChangeType(commandSegments.X, typeof(T)); var coordY = (T)Convert.ChangeType(commandSegments.Y, typeof(T)); if ((dynamic)coordX < 0) { throw new ArgumentException($"Invalid X Position"); } if ((dynamic)coordY < 0) { throw new ArgumentException($"Invalid Y Position"); } if ((dynamic)coordX > (dynamic)moveArea.Width) { throw new ArgumentException($"Invalid X Position"); } if ((dynamic)coordY > (dynamic)moveArea.Height) { throw new ArgumentException($"Invalid Y Position"); } }
public Cordinate <T> ComputeNewCordinate(Cordinate <T> cordinate, U step, IMoveArea <T> moveArea, IDirection <T, U> direction) { return(cordinate); }
public Robo(IMoveArea <T> moveArea) { MoveArea = moveArea; }