// Token: 0x06001D7E RID: 7550 RVA: 0x0005EF78 File Offset: 0x0005D178 public static List <PointF> smethod_22(HashSet <PointF> points, PointF initial_location, PointF end_location) { List <PointF> list = new List <PointF>(); float num = Class477.smethod_9(initial_location, end_location); PointF p = initial_location; if (points != null) { for (;;) { PointF?pointF = null; float num2 = num; float num3 = num; foreach (PointF pointF2 in points) { float num4 = Class477.smethod_9(pointF2, end_location); if (num4 < num) { float num5 = Class477.smethod_9(p, pointF2); if (num5 < num3 && pointF2 != initial_location && pointF2 != end_location) { num3 = num5; num2 = num4; pointF = new PointF?(pointF2); } } } if (pointF == null) { break; } num = num2; PointF value = pointF.Value; list.Add(value); points.Remove(value); p = value; } } list.Add(end_location); return(list); }
// Token: 0x06001D6D RID: 7533 RVA: 0x0005E7C8 File Offset: 0x0005C9C8 public static bool smethod_5(Class142 toontownWindow, ManualResetEventSlim waitHandle, ManualResetEventSlim navigateWaitHandle, Class104 settings, PointF target, bool jump, bool finalTarget) { Class269.Class278 @class = new Class269.Class278(); IntPtr mainWindowHandle = toontownWindow.ToonTownProcess.MainWindowHandle; if (!toontownWindow.ToonTownProcess.ProcessOpen) { return(false); } Class269.Enum58 @enum = Class269.Enum58.flag_0; @class.struct56_0 = Struct56.struct56_0; Struct56 a = Struct56.struct56_0; DateTime t = DateTime.Now.AddMilliseconds(2000.0); float num = finalTarget ? settings.TargetRange : settings.IntermediateTargetRange; @class.bool_0 = false; EventHandler <EventArgs22> eventHandler = null; Class269.Class279 class2 = new Class269.Class279(); class2.class278_0 = @class; class2.manualResetEventSlim_0 = new ManualResetEventSlim(false); try { try { Class129 logMonitor = toontownWindow.LogMonitor; if (eventHandler == null) { eventHandler = new EventHandler <EventArgs22>(class2.method_0); } logMonitor.CoordinatesChanged += eventHandler; WaitHandle[] waitHandles = new WaitHandle[] { waitHandle.WaitHandle, class2.manualResetEventSlim_0.WaitHandle, navigateWaitHandle.WaitHandle }; WaitHandle.WaitAny(waitHandles); WaitHandle[] waitHandles2 = new WaitHandle[] { waitHandle.WaitHandle, navigateWaitHandle.WaitHandle }; DateTime t2 = DateTime.Now.AddMilliseconds(2000.0); try { while (!waitHandle.IsSet && !navigateWaitHandle.IsSet) { Struct56 struct56_ = @class.struct56_0; PointF location = struct56_.Location; if (Class477.smethod_0(target, num, location)) { return(true); } float num2 = struct56_.method_0(target); float num3 = Math.Abs(num2 - struct56_.float_3); float num4 = Class477.smethod_9(target, struct56_.Location); if (t < DateTime.Now) { if (Struct56.smethod_0(a, struct56_)) { Class269.smethod_16(mainWindowHandle, ref @enum); Class269.smethod_15(mainWindowHandle, ref @enum); Class269.smethod_14(mainWindowHandle, ref @enum); Class269.smethod_19(mainWindowHandle); } t = DateTime.Now.AddMilliseconds(2000.0); } bool flag2; if ((num4 > 20f && num3 > 20f) || (num4 <= 20f && Class237.smethod_0(target, num, location, struct56_.float_3) == null)) { Class269.smethod_16(mainWindowHandle, ref @enum); bool flag = num3 > 180f; if (num2 < struct56_.float_3) { if (flag) { flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3); } else { flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3); } } else if (flag) { flag2 = Class269.smethod_10(mainWindowHandle, ref @enum, waitHandles2, num3); } else { flag2 = Class269.smethod_9(mainWindowHandle, ref @enum, waitHandles2, num3); } } else { Class269.smethod_15(mainWindowHandle, ref @enum); Class269.smethod_14(mainWindowHandle, ref @enum); if (jump && t2 < DateTime.Now) { Class269.smethod_18(mainWindowHandle, waitHandles2); t2 = DateTime.Now.AddMilliseconds(2000.0); } flag2 = Class269.smethod_11(mainWindowHandle, ref @enum, waitHandles2, num4 - settings.TargetRange); } if (!flag2) { class2.manualResetEventSlim_0.Reset(); WaitHandle.WaitAny(waitHandles); } if (Class477.smethod_0(target, num, @class.struct56_0.Location)) { return(true); } WaitHandle.WaitAny(waitHandles2, 25); a = struct56_; } } finally { Class269.smethod_16(mainWindowHandle, ref @enum); Class269.smethod_15(mainWindowHandle, ref @enum); Class269.smethod_14(mainWindowHandle, ref @enum); Class269.smethod_19(mainWindowHandle); } } finally { @class.bool_0 = true; } } finally { if (class2.manualResetEventSlim_0 != null) { ((IDisposable)class2.manualResetEventSlim_0).Dispose(); } } return(false); }