public static global::haxe.MainEvent @add(global::haxe.lang.Function f, object priority) { #line 87 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int priority1 = (((priority == default(object))) ? (0) : (((int)(global::haxe.lang.Runtime.toInt(priority))))); if ((f == null)) { #line 89 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" throw global::haxe.lang.HaxeException.wrap("Event function is null"); } #line 90 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainEvent e = new global::haxe.MainEvent(f, priority1); global::haxe.MainEvent head = global::haxe.MainLoop.pending; #line 92 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((head != null)) { #line 93 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" head.prev = e; } #line 94 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e.next = head; global::haxe.MainLoop.pending = e; #line 96 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(e); }
public virtual void stop() { #line 44 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((this.f == null)) { #line 45 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return; } #line 46 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.f = null; this.nextRun = global::haxe.root.Math.NEGATIVE_INFINITY; #line 48 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((this.prev == null)) { #line 49 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainLoop.pending = this.next; } else { #line 51 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.prev.next = this.next; } #line 52 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((this.next != null)) { #line 53 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.next.prev = this.prev; } }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" switch (hash) { case 5695307: { #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" this.run = ((global::haxe.lang.Function)(@value)); #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" return(@value); } case 1975830554: { #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" this.@event = ((global::haxe.MainEvent)(@value)); #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" return(@value); } default: { #line 39 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" return(base.__hx_setField(field, hash, @value, handleProperties)); } } } #line default }
public virtual void stop() { #line 107 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" if ((this.@event != null)) { #line 108 "C:\\HaxeToolkit\\haxe\\std\\haxe\\Timer.hx" [email protected](); this.@event = null; } }
protected static void __hx_ctor_haxe_MainEvent(global::haxe.MainEvent __hx_this, global::haxe.lang.Function f, int p) { #line 13 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" __hx_this.isBlocking = true; #line 18 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" { #line 19 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" __hx_this.f = f; __hx_this.priority = p; #line 21 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" __hx_this.nextRun = global::haxe.root.Math.NEGATIVE_INFINITY; } }
public static bool hasEvents() { #line 67 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainEvent p = global::haxe.MainLoop.pending; while ((p != null)) { #line 69 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if (p.isBlocking) { #line 70 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(true); } #line 71 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" p = p.next; } #line 73 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(false); }
public static double tick() { #line 165 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainLoop.sortEvents(); global::haxe.MainEvent e = global::haxe.MainLoop.pending; #line 167 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" double now = global::haxe.root.Sys.time(); double wait = 1e9; #line 169 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" while ((e != null)) { #line 170 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainEvent next = e.next; double wt = (e.nextRun - now); #line 172 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((wt <= 0)) { #line 173 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" wait = ((double)(0)); if ((e.f != null)) { #line 174 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e.f.__hx_invoke0_o(); } } else if ((wait > wt)) { #line 176 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" wait = wt; } #line 177 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e = next; } #line 179 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(wait); }
public static void sortEvents() { unchecked { #line 103 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" global::haxe.MainEvent list = global::haxe.MainLoop.pending; #line 105 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((list == null)) { #line 106 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return; } #line 108 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int insize = 1; #line 108 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int nmerges = default(int); #line 108 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int psize = 0; #line 108 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int qsize = 0; global::haxe.MainEvent p = null; global::haxe.MainEvent q = null; global::haxe.MainEvent e = null; global::haxe.MainEvent tail = null; #line 111 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" while (true) { #line 112 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" p = list; list = null; #line 114 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" tail = null; nmerges = 0; #line 116 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" while ((p != null)) { #line 117 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" ++nmerges; q = p; #line 119 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" psize = 0; { #line 120 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int _g = 0; #line 120 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int _g1 = insize; #line 120 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" while ((_g < _g1)) { #line 120 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" int i = _g++; ++psize; #line 122 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" q = q.next; if ((q == null)) { #line 124 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" break; } } } #line 126 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" qsize = insize; while (((psize > 0) || ((qsize > 0) && (q != null)))) { #line 128 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((psize == 0)) { #line 129 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e = q; q = q.next; #line 131 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" --qsize; } else if ((((qsize == 0) || (q == null)) || (((p.priority > q.priority) || ((p.priority == q.priority) && (p.nextRun <= q.nextRun)))))) { #line 135 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e = p; p = p.next; #line 137 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" --psize; } else { #line 139 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e = q; q = q.next; #line 141 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" --qsize; } #line 143 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" if ((tail != null)) { #line 144 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" tail.next = e; } else { #line 146 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" list = e; } #line 147 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" e.prev = tail; tail = e; } #line 150 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" p = q; } #line 152 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" tail.next = null; if ((nmerges <= 1)) { #line 154 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" break; } #line 155 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" insize *= 2; } #line 157 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" list.prev = null; global::haxe.MainLoop.pending = list; } #line default }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" switch (hash) { case 993950564: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.priority = ((int)(global::haxe.lang.Runtime.toInt(@value))); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } case 625308696: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.nextRun = ((double)(global::haxe.lang.Runtime.toDouble(@value))); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } case 341784511: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.isBlocking = global::haxe.lang.Runtime.toBool(@value); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } case 1224901875: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.next = ((global::haxe.MainEvent)(@value)); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } case 1247723251: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.prev = ((global::haxe.MainEvent)(@value)); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } case 102: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" this.f = ((global::haxe.lang.Function)(@value)); #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(@value); } default: { #line 5 "C:\\HaxeToolkit\\haxe\\std\\haxe\\MainLoop.hx" return(base.__hx_setField(field, hash, @value, handleProperties)); } } } #line default }