public List<LowLevelCommand> Translate(Report current, StoppingAt action) { var report = current as StrategyTesterReport; if (report == null) throw new ArgumentException(); var targetAngle = AngleCaculator.CalculateAngle(report.Coords, action.Coords); var result = Translate(current, new MovementTo(action.Coords)); result.Add(MakeRotate(targetAngle, action.AngleInRadians)); return result; }
public Strategy StopAt(int x, int y, double angle) { var newItem = new StoppingAt(new PointD(x, y), (angle/180)*Math.PI); Connect(newItem); return this; }