From bf1881e12bc04f5c12b72818c37d23a8573dba59 Mon Sep 17 00:00:00 2001 From: Frotty <1486037+Frotty@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:00:27 +0000 Subject: [PATCH] docs(stdlib): regenerate API reference --- _data/stdlib_index.json | 1905 +++++++++++------- _doc/stdlib/ref/_handles/Integer.md | 15 +- _doc/stdlib/ref/_handles/Real.md | 2 +- _doc/stdlib/ref/_handles/Rect.md | 27 + _doc/stdlib/ref/_handles/String.md | 16 +- _doc/stdlib/ref/_handles/Unit.md | 10 + _doc/stdlib/ref/closures/ClosureForGroups.md | 27 +- _doc/stdlib/ref/closures/ClosureTimers.md | 11 +- _doc/stdlib/ref/data/ArrayList.md | 20 + _doc/stdlib/ref/data/HashList.md | 7 +- _doc/stdlib/ref/data/HashMap.md | 4 +- _doc/stdlib/ref/data/LinkedList.md | 25 +- _doc/stdlib/ref/data/LinkedListModule.md | 2 + _doc/stdlib/ref/data/PriorityQueue.md | 32 + _doc/stdlib/ref/data/SparseSet.md | 67 + _doc/stdlib/ref/data/SparseSetBenchmark.md | 21 + _doc/stdlib/ref/event/DamageEvent.md | 11 +- _doc/stdlib/ref/file/ByteBuffer.md | 9 +- _doc/stdlib/ref/file/FileIO.md | 4 + _doc/stdlib/ref/file/SyncSimple.md | 24 + _doc/stdlib/ref/index.md | 12 +- _doc/stdlib/ref/math/Angle.md | 4 +- _doc/stdlib/ref/math/Bitwise.md | 15 +- _doc/stdlib/ref/math/Interpolation.md | 4 +- _doc/stdlib/ref/math/LineGeometry.md | 66 + _doc/stdlib/ref/math/Maths.md | 2 +- _doc/stdlib/ref/math/Vectors.md | 21 +- _doc/stdlib/ref/util/Colors.md | 3 + _doc/stdlib/ref/util/GameTimer.md | 8 + _doc/stdlib/ref/util/GroupUtils.md | 26 + _doc/stdlib/ref/util/Knockback3.md | 15 +- _doc/stdlib/ref/util/Printing.md | 4 +- _doc/stdlib/ref/util/StringUtils.md | 10 +- _doc/stdlib/ref/util/Time.md | 8 +- _doc/stdlib/ref/util/TimerUtils.md | 6 +- 35 files changed, 1690 insertions(+), 753 deletions(-) create mode 100644 _doc/stdlib/ref/data/PriorityQueue.md create mode 100644 _doc/stdlib/ref/data/SparseSet.md create mode 100644 _doc/stdlib/ref/data/SparseSetBenchmark.md create mode 100644 _doc/stdlib/ref/math/LineGeometry.md diff --git a/_data/stdlib_index.json b/_data/stdlib_index.json index e3dc00f..542f5a0 100644 --- a/_data/stdlib_index.json +++ b/_data/stdlib_index.json @@ -110793,7 +110793,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 104 + "line": 106 }, { "kind": "function", @@ -110809,7 +110809,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 665 + "line": 716 }, { "kind": "interface", @@ -110825,7 +110825,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 675 + "line": 726 }, { "kind": "interface", @@ -110841,7 +110841,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 678 + "line": 729 }, { "kind": "interface", @@ -110857,7 +110857,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 681 + "line": 732 }, { "kind": "interface", @@ -110873,7 +110873,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 684 + "line": 735 }, { "kind": "interface", @@ -110889,7 +110889,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 687 + "line": 738 }, { "kind": "interface", @@ -110905,7 +110905,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 690 + "line": 741 + }, + { + "kind": "constant", + "name": "intComparator", + "typeParams": "", + "receiver": null, + "signature": "public constant Comparator intComparator = (i1, i2) -> i1 < i2 ? -1 : (i1 > i2 ? 1 : 0)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 748 }, { "kind": "extension-function", @@ -110921,7 +110937,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 698 + "line": 749 + }, + { + "kind": "constant", + "name": "realComparator", + "typeParams": "", + "receiver": null, + "signature": "public constant Comparator realComparator = (r1, r2) -> r1 < r2 ? -1 : (r1 > r2 ? 1 : 0)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 752 }, { "kind": "extension-function", @@ -110937,7 +110969,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 702 + "line": 753 + }, + { + "kind": "constant", + "name": "stringComparator", + "typeParams": "", + "receiver": null, + "signature": "public constant Comparator stringComparator = (s1, s2) -> stringCompare(s1, s2)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 756 }, { "kind": "extension-function", @@ -110953,7 +111001,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 706 + "line": 757 }, { "kind": "extension-function", @@ -110969,7 +111017,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 714 + "line": 765 }, { "kind": "extension-function", @@ -110985,7 +111033,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 723 + "line": 774 } ] }, @@ -111432,7 +111480,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 81 + "line": 84 }, { "kind": "function", @@ -111448,7 +111496,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 94 }, { "kind": "function", @@ -111464,7 +111512,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 95 + "line": 98 }, { "kind": "function", @@ -111472,7 +111520,7 @@ "typeParams": "", "receiver": null, "signature": "function get(int index) returns T", - "doc": "Get the element at the given index from this list", + "doc": "Get the element at the given index from this list.\n\t\tIndices outside [0, size) are not validated and yield the null/zero value.", "deprecated": { "flag": false, "message": null @@ -111480,7 +111528,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 99 + "line": 103 }, { "kind": "function", @@ -111496,7 +111544,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 103 + "line": 107 }, { "kind": "function", @@ -111512,7 +111560,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 107 + "line": 111 }, { "kind": "function", @@ -111528,7 +111576,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 111 + "line": 115 }, { "kind": "function", @@ -111544,7 +111592,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 115 + "line": 119 }, { "kind": "function", @@ -111560,7 +111608,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 122 + "line": 126 }, { "kind": "function", @@ -111576,7 +111624,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 129 + "line": 133 }, { "kind": "function", @@ -111584,7 +111632,7 @@ "typeParams": "", "receiver": null, "signature": "function removeIf(RemovePredicate predicate)", - "doc": "Removes the element if the predicates returns true", + "doc": "Removes the element if the predicates returns true.\n\t\tSingle pass compaction - removing through the iterator instead would\n\t\tshift the tail once per removal, making this O(n^2).", "deprecated": { "flag": false, "message": null @@ -111592,7 +111640,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 136 + "line": 142 }, { "kind": "function", @@ -111608,7 +111656,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 145 + "line": 159 } ], "enumMembers": [], @@ -111641,11 +111689,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 152 + "line": 166 } ], "enumMembers": [], - "line": 151 + "line": 165 }, { "kind": "interface", @@ -111674,11 +111722,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 155 + "line": 169 } ], "enumMembers": [], - "line": 154 + "line": 168 }, { "kind": "class", @@ -111707,7 +111755,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 161 + "line": 175 }, { "kind": "function", @@ -111723,7 +111771,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 164 + "line": 178 }, { "kind": "function", @@ -111739,7 +111787,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 167 + "line": 181 }, { "kind": "function", @@ -111755,7 +111803,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 171 + "line": 185 }, { "kind": "function", @@ -111771,7 +111819,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 175 + "line": 189 }, { "kind": "function", @@ -111787,11 +111835,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 178 + "line": 192 } ], "enumMembers": [], - "line": 157 + "line": 171 } ] }, @@ -112041,7 +112089,7 @@ "typeParams": "", "receiver": null, "signature": "override function getAndRemove(K key) returns V", - "doc": "Retrieves the value saved under the given key and removes it", + "doc": "Retrieves the value saved under the given key and removes it.\n\t\tsuper.getAndRemove dispatches back into this class's remove(), which\n\t\talready drops the key, so no second keys.remove() is needed here.", "deprecated": { "flag": false, "message": null @@ -112049,7 +112097,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 77 + "line": 79 }, { "kind": "function", @@ -112113,7 +112161,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 113 + "line": 116 }, { "kind": "function", @@ -112129,7 +112177,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 118 + "line": 121 }, { "kind": "function", @@ -112145,7 +112193,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 125 + "line": 128 }, { "kind": "function", @@ -112161,7 +112209,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 129 + "line": 132 } ], "enumMembers": [], @@ -112194,11 +112242,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 144 + "line": 147 } ], "enumMembers": [], - "line": 143 + "line": 146 } ] }, @@ -112416,7 +112464,7 @@ "typeParams": "", "receiver": null, "signature": "function get(int index) returns T", - "doc": "Returns the element at the specified index", + "doc": "Returns the element at the specified index.\n\t\tErrors if the index is outside [0, size).", "deprecated": { "flag": false, "message": null @@ -112424,7 +112472,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 64 + "line": 65 }, { "kind": "function", @@ -112440,7 +112488,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 69 }, { "kind": "function", @@ -112448,7 +112496,7 @@ "typeParams": "", "receiver": null, "signature": "function set(int index, T elem)", - "doc": "Sets the element at the specified index", + "doc": "Sets the element at the specified index.\n\t\tErrors if the index is outside [0, size).", "deprecated": { "flag": false, "message": null @@ -112456,7 +112504,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 79 + "line": 81 }, { "kind": "function", @@ -112472,7 +112520,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 83 + "line": 85 }, { "kind": "function", @@ -112480,7 +112528,7 @@ "typeParams": "", "receiver": null, "signature": "function getFirst() returns T", - "doc": "Returns the first element in the list", + "doc": "Returns the first element in the list, or null if it is empty", "deprecated": { "flag": false, "message": null @@ -112488,7 +112536,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 87 + "line": 89 }, { "kind": "function", @@ -112496,7 +112544,7 @@ "typeParams": "", "receiver": null, "signature": "function getLast() returns T", - "doc": "Returns the last element in the list", + "doc": "Returns the last element in the list, or null if it is empty", "deprecated": { "flag": false, "message": null @@ -112504,7 +112552,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 93 }, { "kind": "function", @@ -112520,7 +112568,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 95 + "line": 97 }, { "kind": "function", @@ -112536,7 +112584,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 104 + "line": 106 }, { "kind": "function", @@ -112552,7 +112600,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 113 + "line": 115 }, { "kind": "function", @@ -112568,7 +112616,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 117 + "line": 119 }, { "kind": "function", @@ -112584,7 +112632,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 126 + "line": 128 }, { "kind": "function", @@ -112600,7 +112648,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 137 + "line": 139 }, { "kind": "function", @@ -112616,7 +112664,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 149 + "line": 151 }, { "kind": "function", @@ -112632,7 +112680,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 153 + "line": 155 }, { "kind": "function", @@ -112648,7 +112696,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 157 + "line": 159 }, { "kind": "function", @@ -112664,7 +112712,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 164 + "line": 166 }, { "kind": "function", @@ -112680,7 +112728,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 171 + "line": 173 }, { "kind": "function", @@ -112696,7 +112744,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 178 + "line": 180 }, { "kind": "function", @@ -112712,7 +112760,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 182 + "line": 184 }, { "kind": "function", @@ -112728,7 +112776,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 186 + "line": 188 }, { "kind": "function", @@ -112744,7 +112792,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 190 + "line": 192 }, { "kind": "function", @@ -112760,7 +112808,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 200 + "line": 202 }, { "kind": "function", @@ -112776,7 +112824,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 210 + "line": 212 }, { "kind": "function", @@ -112792,7 +112840,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 220 + "line": 222 }, { "kind": "function", @@ -112808,7 +112856,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 229 + "line": 231 }, { "kind": "function", @@ -112816,7 +112864,7 @@ "typeParams": "", "receiver": null, "signature": "function shuffle()", - "doc": "Performs a Fisher–Yates shuffle on this list", + "doc": "Performs a Fisher-Yates shuffle on this list.\n\t\tPermutes the elements in place - no nodes are destroyed or reallocated.", "deprecated": { "flag": false, "message": null @@ -112824,7 +112872,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 237 + "line": 240 }, { "kind": "function", @@ -112832,7 +112880,7 @@ "typeParams": "", "receiver": null, "signature": "function getRandomElement() returns T", - "doc": "Returns a random element from this list or null, if empty", + "doc": "Returns a random element from this list, or null if it is empty", "deprecated": { "flag": false, "message": null @@ -112840,7 +112888,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 260 + "line": 259 }, { "kind": "function", @@ -112848,7 +112896,7 @@ "typeParams": "", "receiver": null, "signature": "function addAt(T elem, int index)", - "doc": "Adds the given element directly behind the element at the given index", + "doc": "Inserts the given element at the given index, shifting the element that\n\t\twas there (and everything after it) one position to the right.\n\t\tAn index equal to the list's size appends to the end.", "deprecated": { "flag": false, "message": null @@ -112856,7 +112904,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 264 + "line": 267 }, { "kind": "function", @@ -112872,7 +112920,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 272 + "line": 277 }, { "kind": "function", @@ -112888,7 +112936,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 282 + "line": 287 }, { "kind": "function", @@ -112896,7 +112944,7 @@ "typeParams": "", "receiver": null, "signature": "function filter(LinkedListPredicate predicate) returns LinkedList", - "doc": "Returns a new list of the elements that satisfy the predicate", + "doc": "Returns a new list of the elements that satisfy the predicate.\n\t\tBuilds the result directly instead of copying and pruning, so only the\n\t\tmatching elements are ever allocated.", "deprecated": { "flag": false, "message": null @@ -112904,7 +112952,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 289 + "line": 296 }, { "kind": "function", @@ -112920,7 +112968,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 297 + "line": 308 }, { "kind": "function", @@ -112936,7 +112984,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 307 + "line": 318 }, { "kind": "function", @@ -112944,7 +112992,7 @@ "typeParams": "", "receiver": null, "signature": "function toString() returns string", - "doc": "Prints the content of the list", + "doc": "Prints the content of the list. Only meaningful for int-like element types.", "deprecated": { "flag": false, "message": null @@ -112952,7 +113000,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 380 + "line": 391 }, { "kind": "function", @@ -112968,7 +113016,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 385 + "line": 398 } ], "enumMembers": [], @@ -112988,7 +113036,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 422 + "line": 445 }, { "kind": "class", @@ -113017,7 +113065,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 444 + "line": 467 }, { "kind": "function", @@ -113033,7 +113081,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 448 + "line": 472 }, { "kind": "function", @@ -113049,7 +113097,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 453 + "line": 478 }, { "kind": "function", @@ -113065,7 +113113,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 459 + "line": 484 }, { "kind": "function", @@ -113081,7 +113129,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 468 + "line": 495 }, { "kind": "function", @@ -113097,7 +113145,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 472 + "line": 499 }, { "kind": "function", @@ -113113,7 +113161,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 475 + "line": 502 }, { "kind": "function", @@ -113129,7 +113177,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 479 + "line": 506 }, { "kind": "function", @@ -113145,7 +113193,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 485 + "line": 512 }, { "kind": "function", @@ -113161,7 +113209,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 489 + "line": 516 }, { "kind": "function", @@ -113177,11 +113225,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 495 + "line": 522 } ], "enumMembers": [], - "line": 438 + "line": 461 }, { "kind": "class", @@ -113210,7 +113258,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 505 + "line": 532 }, { "kind": "function", @@ -113226,7 +113274,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 510 + "line": 538 }, { "kind": "function", @@ -113242,7 +113290,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 514 + "line": 543 }, { "kind": "function", @@ -113258,7 +113306,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 519 + "line": 548 }, { "kind": "function", @@ -113274,7 +113322,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 523 + "line": 552 }, { "kind": "function", @@ -113290,7 +113338,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 526 + "line": 555 }, { "kind": "function", @@ -113306,7 +113354,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 530 + "line": 559 }, { "kind": "function", @@ -113322,7 +113370,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 537 + "line": 566 }, { "kind": "function", @@ -113338,11 +113386,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 543 + "line": 572 } ], "enumMembers": [], - "line": 499 + "line": 526 }, { "kind": "interface", @@ -113371,11 +113419,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 548 + "line": 577 } ], "enumMembers": [], - "line": 547 + "line": 576 }, { "kind": "interface", @@ -113404,11 +113452,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 551 + "line": 580 } ], "enumMembers": [], - "line": 550 + "line": 579 }, { "kind": "interface", @@ -113437,11 +113485,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 554 + "line": 583 } ], "enumMembers": [], - "line": 553 + "line": 582 }, { "kind": "interface", @@ -113470,11 +113518,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 557 + "line": 586 } ], "enumMembers": [], - "line": 556 + "line": 585 }, { "kind": "interface", @@ -113503,11 +113551,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 560 + "line": 589 } ], "enumMembers": [], - "line": 559 + "line": 588 }, { "kind": "interface", @@ -113536,11 +113584,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 563 + "line": 592 } ], "enumMembers": [], - "line": 562 + "line": 591 }, { "kind": "extension-function", @@ -113556,7 +113604,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 566 + "line": 597 }, { "kind": "extension-function", @@ -113572,7 +113620,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 570 + "line": 601 }, { "kind": "extension-function", @@ -113588,7 +113636,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 574 + "line": 605 }, { "kind": "extension-function", @@ -113604,7 +113652,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 577 + "line": 608 }, { "kind": "extension-function", @@ -113620,7 +113668,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 584 + "line": 615 }, { "kind": "extension-function", @@ -113636,7 +113684,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 600 + "line": 631 }, { "kind": "extension-function", @@ -113652,7 +113700,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 613 + "line": 644 } ] }, @@ -113712,7 +113760,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 24 + "line": 23 }, { "kind": "function", @@ -113720,7 +113768,7 @@ "typeParams": "", "receiver": null, "signature": "function getNext() returns thistype", - "doc": "", + "doc": "The next instance, wrapping around to the first one at the end of the list", "deprecated": { "flag": false, "message": null @@ -113736,7 +113784,7 @@ "typeParams": "", "receiver": null, "signature": "function getPrev() returns thistype", - "doc": "", + "doc": "The previous instance, wrapping around to the last one at the start of the list", "deprecated": { "flag": false, "message": null @@ -113744,7 +113792,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 32 + "line": 33 }, { "kind": "function", @@ -113760,7 +113808,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 37 + "line": 38 }, { "kind": "function", @@ -113776,7 +113824,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 52 + "line": 55 }, { "kind": "function", @@ -113792,7 +113840,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 58 + "line": 61 }, { "kind": "function", @@ -113808,7 +113856,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 62 + "line": 65 }, { "kind": "function", @@ -113824,7 +113872,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 71 } ], "enumMembers": [], @@ -113832,6 +113880,149 @@ } ] }, + { + "package": "PriorityQueue", + "category": "data", + "categoryLabel": "Data Structures", + "sourcePath": "wurst/data/PriorityQueue.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/PriorityQueue.wurst", + "summary": "A binary heap priority queue.\n\nThe comparator defines priority: a negative result means that the first\nvalue has higher priority, so ArrayList.intComparator creates a min-heap.\nReverse the comparator to create a max-heap. Equal-priority elements are\nnot stable.\n\nAdding and removing the highest-priority element are O(log n). Peeking is\nO(1). The queue does not support changing an element's priority in place;\nremove and re-add it after changing any fields used by the comparator.", + "summaryFirstLine": "A binary heap priority queue.", + "tags": [ + "data" + ], + "imports": [], + "entities": [ + { + "kind": "class", + "name": "PriorityQueue", + "typeParams": "", + "receiver": null, + "signature": "public class PriorityQueue", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 25 + } + ] + }, + { + "package": "SparseSet", + "category": "data", + "categoryLabel": "Data Structures", + "sourcePath": "wurst/data/SparseSet.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSet.wurst", + "summary": "A set with O(1) membership checks, insertion, and unordered removal.\n\nElements are stored in a dense typed array. The sparse index maps the key\nsupplied by SparseSetKey to the element's dense index. Keys must be unique\nand stable for the lifetime of an element in the set. A key may be reused\nafter its old value is gone; add() validates the stored value before\naccepting the new one.\n\nRemoval swaps the last element into the removed element's slot, so dense\niteration order is not preserved.", + "summaryFirstLine": "A set with O(1) membership checks, insertion, and unordered removal.", + "tags": [ + "data" + ], + "imports": [ + "TypeCasting" + ], + "entities": [ + { + "kind": "interface", + "name": "SparseSetKey", + "typeParams": "", + "receiver": null, + "signature": "public interface SparseSetKey", + "doc": "Supplies the stable, unique integer key used by a SparseSet.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 9 + }, + { + "kind": "class", + "name": "SparseSet", + "typeParams": "", + "receiver": null, + "signature": "public class SparseSet", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 24 + }, + { + "kind": "class", + "name": "UnitSparseSetKey", + "typeParams": "", + "receiver": null, + "signature": "public class UnitSparseSetKey implements SparseSetKey", + "doc": "Key provider for unit sets.\n\nThis deliberately uses the native handle identity rather than UnitIndexer\nIDs. That matches native groups: membership is not automatically removed\nwhen a unit is deindexed. SparseSet validates the stored unit when a key is\nreused, so a new unit cannot silently inherit stale membership.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 150 + }, + { + "kind": "constant", + "name": "UNIT_SPARSE_SET_KEY", + "typeParams": "", + "receiver": null, + "signature": "public constant SparseSetKey UNIT_SPARSE_SET_KEY = new UnitSparseSetKey()", + "doc": "Reusable key provider for SparseSet.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 155 + } + ] + }, + { + "package": "SparseSetBenchmark", + "category": "data", + "categoryLabel": "Data Structures", + "sourcePath": "wurst/data/SparseSetBenchmark.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSetBenchmark.wurst", + "summary": "", + "summaryFirstLine": "", + "tags": [ + "data" + ], + "imports": [], + "entities": [ + { + "kind": "function", + "name": "startSparseSetBenchmark", + "typeParams": "", + "receiver": null, + "signature": "public function startSparseSetBenchmark()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 222 + } + ] + }, { "package": "Table", "category": "data", @@ -115642,8 +115833,8 @@ "categoryLabel": "Closures", "sourcePath": "wurst/closures/ClosureForGroups.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/ClosureForGroups.wurst", - "summary": "Executes the given closure for every unit in this group,\n\tremoving the units from the group as processed.\n\tReturn true to continue iteration, false to stop.", - "summaryFirstLine": "Executes the given closure for every unit in this group,", + "summary": "Executes the given closure for every unit of the given type.\n\tStops invoking the closure after *count* units. The underlying enumeration\n\tcannot be aborted, so it still visits every match.", + "summaryFirstLine": "Executes the given closure for every unit of the given type.", "tags": [ "closure", "closures", @@ -115731,7 +115922,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 79 + "line": 98 }, { "kind": "extension-function", @@ -115747,7 +115938,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 86 + "line": 105 }, { "kind": "function", @@ -115763,7 +115954,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 93 + "line": 112 }, { "kind": "function", @@ -115771,7 +115962,7 @@ "typeParams": "", "receiver": null, "signature": "public function forUnitsOfTypeCounted(string unitname, int count, ForGroupCallback c)", - "doc": "Executes the given closure for every unit of the given player.\n\tCancels itself after *count* iterations", + "doc": "", "deprecated": { "flag": false, "message": null @@ -115779,7 +115970,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 100 + "line": 120 }, { "kind": "function", @@ -115795,7 +115986,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 106 + "line": 126 }, { "kind": "function", @@ -115811,7 +116002,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 112 + "line": 132 }, { "kind": "function", @@ -115827,7 +116018,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 120 + "line": 140 }, { "kind": "function", @@ -115835,7 +116026,7 @@ "typeParams": "", "receiver": null, "signature": "public function forUnitsInRectCounted(rect r, int count, ForGroupCallback c)", - "doc": "Executes the given closure for every unit in the given rect.\n\tCancels itself after *count* iterations", + "doc": "Executes the given closure for every unit in the given rect.\n\tStops invoking the closure after *count* units. The underlying enumeration\n\tcannot be aborted, so it still visits every unit in the rect.", "deprecated": { "flag": false, "message": null @@ -115843,7 +116034,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 127 + "line": 148 }, { "kind": "function", @@ -115859,7 +116050,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 133 + "line": 154 }, { "kind": "function", @@ -115875,7 +116066,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 138 + "line": 159 }, { "kind": "function", @@ -115883,7 +116074,7 @@ "typeParams": "", "receiver": null, "signature": "public function forUnitsInRangeCounted(vec2 pos, real radius, int count, ForGroupCallback c)", - "doc": "Executes the given closure for every unit in range of the given position\n\tCancels itself after *count* iterations", + "doc": "Executes the given closure for every unit in range of the given position.\n\tStops invoking the closure after *count* units. The underlying enumeration\n\tcannot be aborted, so it still visits every unit in range.", "deprecated": { "flag": false, "message": null @@ -115891,7 +116082,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 153 + "line": 178 }, { "kind": "function", @@ -115907,7 +116098,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 159 + "line": 184 }, { "kind": "function", @@ -115923,7 +116114,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 166 + "line": 191 }, { "kind": "extension-function", @@ -115931,7 +116122,7 @@ "typeParams": "", "receiver": "group", "signature": "public function group.forEachFromUntil(ForGroupCallbackUntil cb)", - "doc": "", + "doc": "Executes the given closure for every unit in this group,\n\tremoving the units from the group as processed.\n\tReturn true to continue iteration, false to stop.", "deprecated": { "flag": false, "message": null @@ -115939,7 +116130,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 182 + "line": 208 }, { "kind": "extension-function", @@ -115955,7 +116146,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 191 + "line": 217 }, { "kind": "function", @@ -115971,7 +116162,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 201 + "line": 227 }, { "kind": "function", @@ -115987,7 +116178,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 208 + "line": 234 }, { "kind": "function", @@ -116003,7 +116194,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 215 + "line": 241 }, { "kind": "function", @@ -116019,7 +116210,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 225 + "line": 251 }, { "kind": "function", @@ -116035,7 +116226,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 232 + "line": 258 }, { "kind": "function", @@ -116051,7 +116242,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 239 + "line": 265 }, { "kind": "interface", @@ -116080,11 +116271,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 247 + "line": 273 } ], "enumMembers": [], - "line": 246 + "line": 272 }, { "kind": "function", @@ -116092,7 +116283,7 @@ "typeParams": "", "receiver": null, "signature": "public function forDestructablesInRange(vec2 pos, real range, ForGroupCallbackD cb)", - "doc": "Executes the given closure for all destructables in a rect\n\tthat incompasses the circle with the range radius at the given position.", + "doc": "Executes the given closure for all destructables in a rect\n\tthat encompasses the circle with the range radius at the given position.", "deprecated": { "flag": false, "message": null @@ -116100,7 +116291,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 272 + "line": 311 }, { "kind": "function", @@ -116108,7 +116299,7 @@ "typeParams": "", "receiver": null, "signature": "public function forDestructablesInRange(vec2 pos, real range, boolexpr filter, ForGroupCallbackD cb)", - "doc": "Executes the given closure for all destructables in a rect\n\tthat incompasses the circle with the range radius at the given position.", + "doc": "Executes the given closure for all destructables in a rect\n\tthat encompasses the circle with the range radius at the given position.", "deprecated": { "flag": false, "message": null @@ -116116,7 +116307,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 277 + "line": 316 }, { "kind": "function", @@ -116132,7 +116323,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 282 + "line": 322 }, { "kind": "function", @@ -116148,7 +116339,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 286 + "line": 326 }, { "kind": "function", @@ -116156,7 +116347,7 @@ "typeParams": "", "receiver": null, "signature": "public function forNearestDestructable(vec2 pos, real range, ForGroupCallbackD c)", - "doc": "Executes the given closure for the closes destructable in the given rect.\n\tIf there is no destructable in range, the closure will be run with \"null\"", + "doc": "Executes the given closure for the closest destructable in the given range.\n\tIf there is no destructable in range, the closure will be run with \"null\"", "deprecated": { "flag": false, "message": null @@ -116164,7 +116355,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 298 + "line": 342 } ] }, @@ -116898,7 +117089,39 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 154 + "line": 155 + }, + { + "kind": "function", + "name": "disable", + "typeParams": "", + "receiver": null, + "signature": "function disable()", + "doc": "Pauses this periodic callback without destroying it. Safe to call when already disabled.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 167 + }, + { + "kind": "function", + "name": "enable", + "typeParams": "", + "receiver": null, + "signature": "function enable()", + "doc": "Resumes a previously disabled periodic callback. Safe to call when already enabled.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 172 } ], "enumMembers": [], @@ -116931,7 +117154,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 173 + "line": 185 }, { "kind": "function", @@ -116947,7 +117170,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 182 + "line": 194 }, { "kind": "function", @@ -116955,7 +117178,7 @@ "typeParams": "", "receiver": null, "signature": "function getCount() returns int", - "doc": "", + "doc": "The number of this call, counting down: maxCount on the first call and\n\t\t1 on the last. Returns maxCount before the first call.", "deprecated": { "flag": false, "message": null @@ -116963,7 +117186,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 185 + "line": 199 }, { "kind": "function", @@ -116971,7 +117194,7 @@ "typeParams": "", "receiver": null, "signature": "function progress() returns real", - "doc": "Returns a value between 0 and 1.", + "doc": "Progress through the run as a value between 0 and 1.\n\t\tReturns 0 if the callback was started with a call count of 0.", "deprecated": { "flag": false, "message": null @@ -116979,7 +117202,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 189 + "line": 204 }, { "kind": "function", @@ -116987,7 +117210,7 @@ "typeParams": "", "receiver": null, "signature": "function stop()", - "doc": "", + "doc": "Stops the callback. The remaining calls are skipped and the object is\n\t\tdestroyed on the next tick, not immediately.", "deprecated": { "flag": false, "message": null @@ -116995,7 +117218,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 192 + "line": 211 }, { "kind": "function", @@ -117011,11 +117234,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 198 + "line": 217 } ], "enumMembers": [], - "line": 168 + "line": 180 } ] }, @@ -117121,7 +117344,7 @@ "categoryLabel": "Events", "sourcePath": "wurst/event/DamageEvent.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/event/DamageEvent.wurst", - "summary": "This package provides a light-weight damage detection system with priority-ordered listeners.\n\n**IMPORTANT**\n This package **doesn't** provide protection from cyclic damage.\n Damage from code **must** be declared by the user using DamageEvent.setNextDamageFromCode() before dealing damage.\n If you set damage amount to zero or less in the unreduced listeners, reduced listeners will not fire.\n\n if DETECT_NATIVE_ABILITIES is true:\n > Any damage instance of attacktype ATTACK_TYPE_NORMAL is passed with DamageType SPELL\n\n\nTo listen to any damage instance firing:\n\n DamageEvent.addListener() ->\n print(DamageEvent.getSource().getName() + \" dealt \" + DamageEvent.getAmount().toString() + \" damage to \" + DamageEvent.getTarget().getName() + \".\")\n\nIf the order of firing of the listeners is important, the user can give a priority to the listener:\n\n DamageEvent.addListener(2) ->\n print(\"This fires after.\")\n DamageEvent.addListener(0) ->\n print(\"This fires before.\")\n\nIf you want to catch the damage instance before it has been reduced by any damage reducing effect (such as armor) you can use the unreduced verions of the listeners:\n\n DamageEvent.addUnreducedListener() ->\n print(\"this fire before any damage reduction\")\n\n\nEach damage instance has a DamageType associated to it.\nCODE **must** be declared by the user using DamageEvent.setNextDamageFromCode() before dealing damage.\nATTACK and SPELL are detected by the system (if DETECT_NATIVE_ABILITIES is false then native abilities will be detected as ATTACK)\n\n DamageEvent.addListener() ->\n switch DamageEvent.getType()\n case ATTACK\n print(\"This damage is from a unit's attack.\")\n case SPELL\n print(\"This damage is from a native ability.\")\n case CODE\n print(\"This damage is from code.\")\n default\n\nEach damage instance can have an id and/or an element.DamageEvent\nAllowing the user to easily categorize (DamageElement) or/and identify a damage instance (id):\n\n DamageEvent.setNextDamageFromCode()\n DamageEvent.setNextDamageId('A000') // This damage instance is from the spell 'A000'\n DamageEvent.setNextDamageElement(DAMAGE_ELEMENT_FIRE) // This damage instance will be categorized as a Fire damage instance.\n UnitDamageTarget(source, target, amount, [...])\n\nUsing globally defined priorities for a map can help easily understand and use a damage pipeline:\n\n public constant DAMAGE_EVENT_PRIO_START = 0 // Abort damage at this priority\n public constant DAMAGE_EVENT_PRIO_RELATIVE = 1 // Apply relative changes (multiplication and division)\n public constant DAMAGE_EVENT_PRIO_ABSOLUTE = 2 // Apply absolute changes (addition and subtraction)\n public constant DAMAGE_EVENT_PRIO_SHIELD = 4 // Apply reduction from \"shield\" effects\n public constant DAMAGE_EVENT_PRIO_FINAL = 5 // Final damage (won't be changed at this stage)", + "summary": "This package provides a light-weight damage detection system with priority-ordered listeners.\n\n**IMPORTANT**\n This package **doesn't** provide protection from cyclic damage.\n Damage from code **must** be declared by the user using DamageEvent.setNextDamageFromCode() before dealing damage.\n Setting the damage amount to zero or less in the unreduced listeners does **not** skip the reduced\n listeners: EVENT_PLAYER_UNIT_DAMAGED still fires and they run with an amount of zero.\n (This corrects an older note here which claimed the opposite. Verified in game by check 10 of\n package StdlibIngameTests.)\n\n if DETECT_NATIVE_ABILITIES is true:\n > Any damage instance of attacktype ATTACK_TYPE_NORMAL is passed with DamageType SPELL\n\n\nTo listen to any damage instance firing:\n\n DamageEvent.addListener() ->\n print(DamageEvent.getSource().getName() + \" dealt \" + DamageEvent.getAmount().toString() + \" damage to \" + DamageEvent.getTarget().getName() + \".\")\n\nIf the order of firing of the listeners is important, the user can give a priority to the listener:\n\n DamageEvent.addListener(2) ->\n print(\"This fires after.\")\n DamageEvent.addListener(0) ->\n print(\"This fires before.\")\n\nIf you want to catch the damage instance before it has been reduced by any damage reducing effect (such as armor) you can use the unreduced versions of the listeners:\n\n DamageEvent.addUnreducedListener() ->\n print(\"this fire before any damage reduction\")\n\n\nEach damage instance has a DamageType associated to it.\nCODE **must** be declared by the user using DamageEvent.setNextDamageFromCode() before dealing damage.\nATTACK and SPELL are detected by the system (if DETECT_NATIVE_ABILITIES is false then native abilities will be detected as ATTACK)\n\n DamageEvent.addListener() ->\n switch DamageEvent.getType()\n case ATTACK\n print(\"This damage is from a unit's attack.\")\n case SPELL\n print(\"This damage is from a native ability.\")\n case CODE\n print(\"This damage is from code.\")\n default\n\nEach damage instance can have an id and/or an element.DamageEvent\nAllowing the user to easily categorize (DamageElement) or/and identify a damage instance (id):\n\n DamageEvent.setNextDamageFromCode()\n DamageEvent.setNextDamageId('A000') // This damage instance is from the spell 'A000'\n DamageEvent.setNextDamageElement(DAMAGE_ELEMENT_FIRE) // This damage instance will be categorized as a Fire damage instance.\n UnitDamageTarget(source, target, amount, [...])\n\nUsing globally defined priorities for a map can help easily understand and use a damage pipeline:\n\n public constant DAMAGE_EVENT_PRIO_START = 0 // Abort damage at this priority\n public constant DAMAGE_EVENT_PRIO_RELATIVE = 1 // Apply relative changes (multiplication and division)\n public constant DAMAGE_EVENT_PRIO_ABSOLUTE = 2 // Apply absolute changes (addition and subtraction)\n public constant DAMAGE_EVENT_PRIO_SHIELD = 4 // Apply reduction from \"shield\" effects\n public constant DAMAGE_EVENT_PRIO_FINAL = 5 // Final damage (won't be changed at this stage)", "summaryFirstLine": "This package provides a light-weight damage detection system with priority-ordered listeners.", "tags": [ "damage", @@ -117144,7 +117367,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 68 + "line": 71 }, { "kind": "constant", @@ -117152,7 +117375,7 @@ "typeParams": "", "receiver": null, "signature": "public constant DAMAGE_ELEMENT_ATTACK = new DamageElement(\"Physical\", colorA(223, 59, 33, 255))", - "doc": "A damage instance can have an element.\n DAMAGE_ELEMENT_ATTACK is the defaut element added to any damage instances of DamageType ATTACK", + "doc": "A damage instance can have an element.\n DAMAGE_ELEMENT_ATTACK is the default element added to any damage instances of DamageType ATTACK", "deprecated": { "flag": false, "message": null @@ -117160,7 +117383,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 72 + "line": 75 }, { "kind": "enum", @@ -117176,7 +117399,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 80 + "line": 83 }, { "kind": "class", @@ -117184,7 +117407,7 @@ "typeParams": "", "receiver": null, "signature": "public class DamageElement", - "doc": "Each damage instance can have a DamageElement associated to it.\n Allowing for categories of damage instances:\n\n DAMAGE_ELEMENT_FIRE = new DamageElement(\"Fire\", colorA(255, 0, 0, 255))\n DAMAGE_ELEMENT_WATER = new DamageElement(\"Water\", colorA(0, 0, 255, 255))\n\n The user can extends from DamageElement to add his own settings.", + "doc": "Each damage instance can have a DamageElement associated to it.\n Allowing for categories of damage instances:\n\n DAMAGE_ELEMENT_FIRE = new DamageElement(\"Fire\", colorA(255, 0, 0, 255))\n DAMAGE_ELEMENT_WATER = new DamageElement(\"Water\", colorA(0, 0, 255, 255))\n\n DamageElement can be extended to carry additional per-element settings.", "deprecated": { "flag": false, "message": null @@ -117192,7 +117415,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 97 + "line": 100 }, { "kind": "class", @@ -117208,7 +117431,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 169 + "line": 172 }, { "kind": "class", @@ -117224,7 +117447,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 431 + "line": 520 }, { "kind": "function", @@ -117240,7 +117463,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 445 + "line": 536 }, { "kind": "function", @@ -117256,7 +117479,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 457 + "line": 548 } ] }, @@ -117463,7 +117686,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 52 + "line": 63 }, { "kind": "extension-function", @@ -117479,7 +117702,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 56 + "line": 66 }, { "kind": "extension-function", @@ -117495,7 +117718,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 60 + "line": 69 }, { "kind": "class", @@ -117524,7 +117747,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 70 + "line": 78 }, { "kind": "function", @@ -117540,7 +117763,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 73 + "line": 81 }, { "kind": "function", @@ -117556,7 +117779,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 77 + "line": 85 }, { "kind": "function", @@ -117572,7 +117795,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 82 + "line": 89 }, { "kind": "function", @@ -117588,7 +117811,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 87 + "line": 93 }, { "kind": "function", @@ -117604,7 +117827,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 96 }, { "kind": "function", @@ -117620,7 +117843,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 94 + "line": 99 }, { "kind": "function", @@ -117636,7 +117859,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 97 + "line": 102 }, { "kind": "function", @@ -117652,7 +117875,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 100 + "line": 105 }, { "kind": "function", @@ -117668,7 +117891,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 103 + "line": 108 }, { "kind": "function", @@ -117684,7 +117907,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 106 + "line": 111 }, { "kind": "function", @@ -117700,7 +117923,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 109 + "line": 114 }, { "kind": "function", @@ -117716,7 +117939,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 112 + "line": 117 }, { "kind": "function", @@ -117732,7 +117955,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 115 + "line": 120 }, { "kind": "function", @@ -117748,7 +117971,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 118 + "line": 123 }, { "kind": "function", @@ -117764,7 +117987,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 121 + "line": 126 }, { "kind": "function", @@ -117780,7 +118003,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 124 + "line": 129 }, { "kind": "function", @@ -117796,7 +118019,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 131 + "line": 136 }, { "kind": "function", @@ -117812,7 +118035,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 135 + "line": 140 }, { "kind": "function", @@ -117828,7 +118051,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 139 + "line": 144 }, { "kind": "function", @@ -117844,7 +118067,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 142 + "line": 147 }, { "kind": "function", @@ -117860,7 +118083,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 145 + "line": 150 }, { "kind": "function", @@ -117876,7 +118099,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 148 + "line": 153 }, { "kind": "function", @@ -117892,7 +118115,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 151 + "line": 156 }, { "kind": "function", @@ -117908,7 +118131,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 154 + "line": 159 }, { "kind": "function", @@ -117924,7 +118147,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 158 + "line": 163 }, { "kind": "function", @@ -117940,7 +118163,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 162 + "line": 167 }, { "kind": "function", @@ -117956,7 +118179,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 165 + "line": 170 }, { "kind": "function", @@ -117972,7 +118195,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 168 + "line": 173 }, { "kind": "function", @@ -117988,7 +118211,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 171 + "line": 176 }, { "kind": "function", @@ -118004,7 +118227,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 174 + "line": 179 }, { "kind": "function", @@ -118020,7 +118243,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 186 + "line": 191 }, { "kind": "function", @@ -118036,7 +118259,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 189 + "line": 194 }, { "kind": "function", @@ -118052,7 +118275,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 192 + "line": 197 }, { "kind": "function", @@ -118068,7 +118291,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 195 + "line": 200 }, { "kind": "function", @@ -118084,7 +118307,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 198 + "line": 203 }, { "kind": "function", @@ -118100,7 +118323,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 201 + "line": 206 }, { "kind": "function", @@ -118116,7 +118339,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 204 + "line": 209 }, { "kind": "function", @@ -118132,7 +118355,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 207 + "line": 212 }, { "kind": "function", @@ -118148,7 +118371,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 210 + "line": 215 }, { "kind": "function", @@ -118164,7 +118387,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 213 + "line": 218 }, { "kind": "function", @@ -118180,7 +118403,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 216 + "line": 221 }, { "kind": "function", @@ -118196,7 +118419,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 219 + "line": 224 }, { "kind": "function", @@ -118212,7 +118435,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 222 + "line": 227 }, { "kind": "function", @@ -118228,7 +118451,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 225 + "line": 230 }, { "kind": "function", @@ -118244,7 +118467,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 229 + "line": 234 }, { "kind": "function", @@ -118260,7 +118483,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 233 + "line": 238 }, { "kind": "function", @@ -118276,7 +118499,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 236 + "line": 241 }, { "kind": "function", @@ -118292,7 +118515,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 239 + "line": 244 }, { "kind": "function", @@ -118308,7 +118531,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 242 + "line": 247 }, { "kind": "function", @@ -118324,7 +118547,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 245 + "line": 250 }, { "kind": "function", @@ -118340,7 +118563,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 249 + "line": 254 }, { "kind": "function", @@ -118356,7 +118579,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 253 + "line": 258 }, { "kind": "function", @@ -118372,7 +118595,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 256 + "line": 261 }, { "kind": "function", @@ -118388,7 +118611,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 259 + "line": 264 }, { "kind": "function", @@ -118404,7 +118627,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 262 + "line": 267 }, { "kind": "function", @@ -118420,7 +118643,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 265 + "line": 270 }, { "kind": "function", @@ -118436,7 +118659,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 268 + "line": 273 }, { "kind": "function", @@ -118452,7 +118675,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 271 + "line": 276 }, { "kind": "function", @@ -118468,7 +118691,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 274 + "line": 279 }, { "kind": "function", @@ -118484,7 +118707,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 277 + "line": 282 }, { "kind": "function", @@ -118500,7 +118723,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 280 + "line": 285 }, { "kind": "function", @@ -118516,7 +118739,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 283 + "line": 288 }, { "kind": "function", @@ -118532,7 +118755,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 286 + "line": 291 }, { "kind": "function", @@ -118548,7 +118771,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 291 + "line": 296 }, { "kind": "function", @@ -118564,7 +118787,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 296 + "line": 301 }, { "kind": "function", @@ -118580,7 +118803,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 299 + "line": 304 }, { "kind": "function", @@ -118596,7 +118819,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 302 + "line": 307 }, { "kind": "function", @@ -118612,7 +118835,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 305 + "line": 310 }, { "kind": "function", @@ -118628,7 +118851,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 308 + "line": 313 }, { "kind": "function", @@ -118644,7 +118867,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 311 + "line": 316 }, { "kind": "function", @@ -118660,7 +118883,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 314 + "line": 319 }, { "kind": "function", @@ -118676,7 +118899,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 317 + "line": 322 }, { "kind": "function", @@ -118692,7 +118915,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 320 + "line": 325 }, { "kind": "function", @@ -118708,7 +118931,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 323 + "line": 328 }, { "kind": "function", @@ -118724,7 +118947,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 326 + "line": 331 }, { "kind": "function", @@ -118740,7 +118963,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 329 + "line": 334 }, { "kind": "function", @@ -118756,7 +118979,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 332 + "line": 337 }, { "kind": "function", @@ -118772,7 +118995,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 335 + "line": 340 }, { "kind": "function", @@ -118788,7 +119011,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 338 + "line": 343 }, { "kind": "function", @@ -118804,7 +119027,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 341 + "line": 346 }, { "kind": "function", @@ -118820,7 +119043,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 344 + "line": 349 }, { "kind": "function", @@ -118836,7 +119059,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 347 + "line": 352 }, { "kind": "function", @@ -118852,7 +119075,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 350 + "line": 355 }, { "kind": "function", @@ -118868,7 +119091,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 353 + "line": 358 }, { "kind": "function", @@ -118884,7 +119107,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 356 + "line": 361 }, { "kind": "function", @@ -118900,7 +119123,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 359 + "line": 364 }, { "kind": "function", @@ -118916,7 +119139,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 362 + "line": 367 }, { "kind": "function", @@ -118932,7 +119155,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 365 + "line": 370 }, { "kind": "function", @@ -118948,7 +119171,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 368 + "line": 373 }, { "kind": "function", @@ -118964,7 +119187,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 371 + "line": 376 }, { "kind": "function", @@ -118980,7 +119203,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 374 + "line": 379 }, { "kind": "function", @@ -118996,7 +119219,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 377 + "line": 382 }, { "kind": "function", @@ -119012,7 +119235,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 380 + "line": 385 }, { "kind": "function", @@ -119028,7 +119251,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 383 + "line": 388 }, { "kind": "function", @@ -119044,7 +119267,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 387 + "line": 392 }, { "kind": "function", @@ -119060,7 +119283,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 391 + "line": 396 }, { "kind": "function", @@ -119076,7 +119299,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 395 + "line": 400 }, { "kind": "function", @@ -119092,7 +119315,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 399 + "line": 404 }, { "kind": "function", @@ -119108,11 +119331,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 403 + "line": 408 } ], "enumMembers": [], - "line": 67 + "line": 75 } ] }, @@ -121004,7 +121227,7 @@ "typeParams": "", "receiver": "real", "signature": "public function real.fromRad() returns angle", - "doc": "interpret this real as an angle given in degrees", + "doc": "interpret this real as an angle given in radians", "deprecated": { "flag": false, "message": null @@ -121020,7 +121243,7 @@ "typeParams": "", "receiver": "int", "signature": "public function int.fromRad() returns angle", - "doc": "interpret this int as an angle given in degrees", + "doc": "interpret this int as an angle given in radians", "deprecated": { "flag": false, "message": null @@ -121628,7 +121851,7 @@ "typeParams": "", "receiver": "int", "signature": "public function int.toBitString() returns string", - "doc": "Produces a bistring from this integer.\n*", + "doc": "Produces a bitstring from this integer. Zero yields \"0\", and negative\nvalues yield their full 32 bit two's complement representation.\n*", "deprecated": { "flag": false, "message": null @@ -121636,7 +121859,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 114 + "line": 115 }, { "kind": "extension-function", @@ -121652,7 +121875,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 206 + "line": 210 }, { "kind": "extension-function", @@ -121668,7 +121891,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 214 + "line": 218 }, { "kind": "extension-function", @@ -121684,7 +121907,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 223 + "line": 227 }, { "kind": "extension-function", @@ -121700,7 +121923,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 231 + "line": 235 }, { "kind": "extension-function", @@ -121716,7 +121939,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 240 + "line": 244 }, { "kind": "extension-function", @@ -121732,7 +121955,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 248 + "line": 252 }, { "kind": "extension-function", @@ -121748,7 +121971,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 257 + "line": 261 }, { "kind": "extension-function", @@ -121764,7 +121987,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 265 + "line": 269 }, { "kind": "extension-function", @@ -121772,7 +121995,7 @@ "typeParams": "", "receiver": "int", "signature": "public function int.shiftl(int amount) returns int", - "doc": "32-bit SHIFTL (<<)\n\nnumber.shiftl(amount) equivalent to (number << amount)\n*", + "doc": "32-bit SHIFTL (<<)\n\nnumber.shiftl(amount) equivalent to (number << amount)\nBits shifted past bit 31 are discarded, so a shift of 32 yields 0.\n`amount` must be in [0, 32]; other values read outside the shift table.\n*", "deprecated": { "flag": false, "message": null @@ -121780,7 +122003,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 273 + "line": 279 }, { "kind": "extension-function", @@ -121788,7 +122011,7 @@ "typeParams": "", "receiver": "int", "signature": "public function int.shiftr(int amount) returns int", - "doc": "32-bit SHIFTR (>>)\n\nnumber.shiftr(amount) equivalent to (number >> amount)\n*", + "doc": "32-bit logical SHIFTR (>>>)\n\nnumber.shiftr(amount) equivalent to (number >>> amount): the sign bit is\nshifted in as data rather than replicated, so negative inputs produce a\npositive result for any amount > 0.\n\n`amount` must be in [0, 31] - one less than shiftl accepts. The shift table\nholds 2^32 as 0 after wrapping, so an amount of 32 divides by zero rather\nthan returning 0. Guard the call if the amount is computed.\n*", "deprecated": { "flag": false, "message": null @@ -121796,7 +122019,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 281 + "line": 293 } ] }, @@ -122186,7 +122409,7 @@ "typeParams": "", "receiver": null, "signature": "public function hermite(real start, real stop, real tangent1, real tangent2, real s) returns real", - "doc": "Hermite Interpolation", + "doc": "Cubic Hermite interpolation between `start` and `stop` for s in [0, 1],\n\twith `tangent1` and `tangent2` as the derivatives at s = 0 and s = 1.\n\tThe basis is h00 = 2s^3-3s^2+1, h10 = s^3-2s^2+s, h01 = -2s^3+3s^2, h11 = s^3-s^2.", "deprecated": { "flag": false, "message": null @@ -122194,7 +122417,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 84 + "line": 86 }, { "kind": "function", @@ -122210,7 +122433,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 103 + "line": 105 }, { "kind": "function", @@ -122226,7 +122449,118 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 107 + "line": 109 + } + ] + }, + { + "package": "LineGeometry", + "category": "math", + "categoryLabel": "Math", + "sourcePath": "wurst/math/LineGeometry.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/math/LineGeometry.wurst", + "summary": "", + "summaryFirstLine": "", + "tags": [ + "math" + ], + "imports": [], + "entities": [ + { + "kind": "tuple", + "name": "lineFormular", + "typeParams": "", + "receiver": null, + "signature": "public tuple lineFormular(real m, real b)", + "doc": "Line formula tuple representing y = m*x + b where m is slope and b is y-intercept", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 7 + }, + { + "kind": "extension-function", + "name": "getYOnLine", + "typeParams": "", + "receiver": "real", + "signature": "public function real.getYOnLine(lineFormular line) returns real", + "doc": "Returns f(x) = m*x + b for a given x value on a line", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 10 + }, + { + "kind": "extension-function", + "name": "getXOnLine", + "typeParams": "", + "receiver": "real", + "signature": "public function real.getXOnLine(lineFormular line) returns real", + "doc": "Returns the x value for a given y on a line: x = (y - b) / m", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 14 + }, + { + "kind": "extension-function", + "name": "getLineFormular", + "typeParams": "", + "receiver": "vec2", + "signature": "public function vec2.getLineFormular(vec2 p) returns lineFormular", + "doc": "Returns the line formula for the line passing through this point and p.\n\tWARNING: Undefined behavior for vertical lines (p.x == this.x causes division by zero).", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 19 + }, + { + "kind": "extension-function", + "name": "getParallelLineWithOrthogonalDistance", + "typeParams": "", + "receiver": "lineFormular", + "signature": "public function lineFormular.getParallelLineWithOrthogonalDistance(real d) returns lineFormular", + "doc": "Returns a parallel line with orthogonal distance d from the original line", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 23 + }, + { + "kind": "extension-function", + "name": "getOrthogonalSidePoint", + "typeParams": "", + "receiver": "vec2", + "signature": "public function vec2.getOrthogonalSidePoint(lineFormular line, real d) returns vec2", + "doc": "Returns a point on the side of a line at orthogonal distance d", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 27 } ] }, @@ -122282,7 +122616,7 @@ "name": "PI2", "typeParams": "", "receiver": null, - "signature": "public constant real PI2 = 6.28318", + "signature": "public constant real PI2 = 6.283185307", "doc": "PI * 2 constant", "deprecated": { "flag": false, @@ -123893,7 +124227,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 177 + "line": 182 }, { "kind": "extension-function", @@ -123909,7 +124243,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 184 + "line": 189 }, { "kind": "extension-function", @@ -123925,7 +124259,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 187 + "line": 192 }, { "kind": "extension-function", @@ -123941,7 +124275,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 192 + "line": 197 }, { "kind": "extension-function", @@ -123957,7 +124291,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 197 + "line": 202 }, { "kind": "extension-function", @@ -123973,7 +124307,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 227 + "line": 232 }, { "kind": "extension-function", @@ -123989,7 +124323,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 233 + "line": 238 }, { "kind": "extension-function", @@ -124005,7 +124339,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 237 + "line": 242 }, { "kind": "extension-function", @@ -124021,7 +124355,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 243 + "line": 248 }, { "kind": "extension-function", @@ -124037,7 +124371,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 261 + "line": 266 } ] }, @@ -124526,7 +124860,7 @@ "typeParams": "", "receiver": "vec2", "signature": "public function vec2.op_mult(vec2 v) returns vec2", - "doc": "dot product Operator", + "doc": "Operator, component-wise (Hadamard) product. For the dot product use vec2.dot", "deprecated": { "flag": false, "message": null @@ -125054,7 +125388,7 @@ "typeParams": "", "receiver": "real", "signature": "public function real.op_mult(vec3 v) returns vec3", - "doc": "dot Operator", + "doc": "Operator, scales the vector by this scalar", "deprecated": { "flag": false, "message": null @@ -125134,7 +125468,7 @@ "typeParams": "", "receiver": "vec3", "signature": "public function vec3.setLengthSq(real lengthSq) returns vec3", - "doc": "Sets the length of the given Vector", + "doc": "Returns this vector rescaled so that its *squared* length equals the given\n\tvalue. Scaling by lengthSq/currentSq would give a squared length of\n\tlengthSq^2/currentSq, so the factor has to be the square root of the ratio.", "deprecated": { "flag": false, "message": null @@ -125142,7 +125476,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 288 + "line": 290 }, { "kind": "extension-function", @@ -125158,7 +125492,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 297 + "line": 301 }, { "kind": "extension-function", @@ -125174,7 +125508,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 306 + "line": 310 }, { "kind": "extension-function", @@ -125190,7 +125524,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 310 + "line": 314 }, { "kind": "extension-function", @@ -125206,7 +125540,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 314 + "line": 318 }, { "kind": "extension-function", @@ -125222,7 +125556,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 318 + "line": 322 }, { "kind": "extension-function", @@ -125238,7 +125572,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 327 + "line": 331 }, { "kind": "extension-function", @@ -125246,7 +125580,7 @@ "typeParams": "", "receiver": "vec3", "signature": "public function vec3.inRange(vec3 v2, real radius) returns boolean", - "doc": "Is this vector inside the given circle", + "doc": "Is this vector inside the given circle. Only the x and y coordinates are\n\tcompared - the height difference is ignored. Use inRange3d for a spherical\n\ttest that includes z.", "deprecated": { "flag": false, "message": null @@ -125254,7 +125588,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 331 + "line": 337 + }, + { + "kind": "extension-function", + "name": "inRange3d", + "typeParams": "", + "receiver": "vec3", + "signature": "public function vec3.inRange3d(vec3 v2, real radius) returns boolean", + "doc": "Is this vector inside the given sphere, taking the z coordinate into\n\taccount. Compare vec3.inRange, which only compares x and y.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 342 }, { "kind": "extension-function", @@ -125270,7 +125620,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 335 + "line": 346 }, { "kind": "extension-function", @@ -125286,7 +125636,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 339 + "line": 350 }, { "kind": "extension-function", @@ -125302,7 +125652,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 343 + "line": 354 }, { "kind": "extension-function", @@ -125318,7 +125668,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 347 + "line": 358 }, { "kind": "extension-function", @@ -125334,7 +125684,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 351 + "line": 362 }, { "kind": "extension-function", @@ -125350,7 +125700,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 355 + "line": 366 }, { "kind": "extension-function", @@ -125366,7 +125716,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 359 + "line": 370 }, { "kind": "extension-function", @@ -125382,7 +125732,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 363 + "line": 374 }, { "kind": "extension-function", @@ -125398,7 +125748,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 367 + "line": 378 }, { "kind": "extension-function", @@ -125414,7 +125764,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 370 + "line": 381 }, { "kind": "extension-function", @@ -125430,7 +125780,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 374 + "line": 385 }, { "kind": "extension-function", @@ -125446,7 +125796,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 382 + "line": 393 }, { "kind": "extension-function", @@ -125462,7 +125812,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 395 + "line": 406 }, { "kind": "extension-function", @@ -125478,7 +125828,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 399 + "line": 410 }, { "kind": "extension-function", @@ -125494,7 +125844,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 403 + "line": 414 }, { "kind": "extension-function", @@ -125510,7 +125860,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 407 + "line": 418 }, { "kind": "extension-function", @@ -125526,7 +125876,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 411 + "line": 422 }, { "kind": "extension-function", @@ -125542,7 +125892,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 414 + "line": 425 }, { "kind": "extension-function", @@ -125558,7 +125908,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 420 + "line": 431 }, { "kind": "extension-function", @@ -125574,7 +125924,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 428 + "line": 439 }, { "kind": "extension-function", @@ -125590,7 +125940,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 433 + "line": 444 } ] }, @@ -125653,7 +126003,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 77 + "line": 80 }, { "kind": "class", @@ -125669,7 +126019,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 184 + "line": 187 }, { "kind": "extension-function", @@ -125685,7 +126035,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 264 + "line": 267 }, { "kind": "extension-function", @@ -125701,7 +126051,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 268 + "line": 271 }, { "kind": "extension-function", @@ -125717,7 +126067,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 272 + "line": 275 } ] }, @@ -125761,7 +126111,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 41 + "line": 43 }, { "kind": "function", @@ -125777,7 +126127,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 51 + "line": 53 }, { "kind": "function", @@ -125793,7 +126143,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 58 + "line": 60 }, { "kind": "function", @@ -125809,7 +126159,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 62 + "line": 64 }, { "kind": "function", @@ -125825,7 +126175,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 66 + "line": 68 }, { "kind": "function", @@ -125833,7 +126183,7 @@ "typeParams": "", "receiver": null, "signature": "function hasByte() returns bool", - "doc": "", + "doc": "Returns whether at least one unread byte remains.\n\t\tCompares against the total byte count rather than the internal int index,\n\t\tso a buffer whose size is an exact multiple of 4 does not report a\n\t\tphantom trailing byte from the empty write buffer.", "deprecated": { "flag": false, "message": null @@ -125841,7 +126191,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 70 + "line": 76 }, { "kind": "function", @@ -125849,7 +126199,7 @@ "typeParams": "", "receiver": null, "signature": "function readByte() returns int", - "doc": "Reads a single unsigned byte from this buffer. The returned value will be in the range [0, 255]. *", + "doc": "Reads a single unsigned byte from this buffer. The returned value will be in the range [0, 255].\n\t\tReading past the end yields 0; guard with hasByte(). *", "deprecated": { "flag": false, "message": null @@ -125857,7 +126207,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 74 + "line": 81 }, { "kind": "function", @@ -125873,7 +126223,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 84 + "line": 92 }, { "kind": "function", @@ -125889,7 +126239,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 88 + "line": 96 }, { "kind": "function", @@ -125905,7 +126255,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 99 }, { "kind": "function", @@ -125921,7 +126271,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 95 + "line": 104 }, { "kind": "function", @@ -125929,7 +126279,7 @@ "typeParams": "", "receiver": null, "signature": "function getIntCount() returns int", - "doc": "", + "doc": "Number of ints backing this buffer, counting the partially filled write\n\t\tbuffer as one. An empty buffer therefore reports 1, not 0.", "deprecated": { "flag": false, "message": null @@ -125937,7 +126287,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 100 + "line": 111 }, { "kind": "function", @@ -125953,7 +126303,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 104 + "line": 115 }, { "kind": "function", @@ -125969,7 +126319,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 107 + "line": 118 }, { "kind": "function", @@ -125985,11 +126335,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 118 + "line": 129 } ], "enumMembers": [], - "line": 13 + "line": 14 } ] }, @@ -126262,7 +126612,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 18 + "line": 35 }, { "kind": "constant", @@ -126278,7 +126628,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 19 + "line": 36 }, { "kind": "constant", @@ -126294,7 +126644,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 23 + "line": 40 }, { "kind": "class", @@ -126323,7 +126673,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 28 + "line": 45 }, { "kind": "function", @@ -126339,7 +126689,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 31 + "line": 48 }, { "kind": "function", @@ -126355,7 +126705,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 37 + "line": 54 }, { "kind": "function", @@ -126371,7 +126721,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 46 + "line": 63 }, { "kind": "function", @@ -126379,7 +126729,7 @@ "typeParams": "", "receiver": null, "signature": "function read(player p) returns ChunkedString", - "doc": "", + "doc": "Reads the file's contents. Only the given player actually reads from\n\t\tdisk; every other client gets an empty ChunkedString, so the result is\n\t\tnot synchronised - see the desync warning at the top of this package.", "deprecated": { "flag": false, "message": null @@ -126387,7 +126737,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 49 + "line": 69 }, { "kind": "function", @@ -126395,7 +126745,7 @@ "typeParams": "", "receiver": null, "signature": "function readAsString(player p) returns string", - "doc": "", + "doc": "Reads the file's contents as one string. Not synchronised - see read().", "deprecated": { "flag": false, "message": null @@ -126403,11 +126753,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 55 + "line": 76 } ], "enumMembers": [], - "line": 25 + "line": 42 } ] }, @@ -126756,8 +127106,8 @@ "categoryLabel": "File & Network", "sourcePath": "wurst/file/SyncSimple.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/SyncSimple.wurst", - "summary": "", - "summaryFirstLine": "", + "summary": "Generic sync listener for arbitrary types that can be cast to/from int.\n\tOnly works for values representable as an int (class instances, handle ids).\n\tThe synced object must already be in sync across all clients.", + "summaryFirstLine": "Generic sync listener for arbitrary types that can be cast to/from int.", "tags": [ "file" ], @@ -126976,6 +127326,39 @@ "enumMembers": [], "line": 37 }, + { + "kind": "interface", + "name": "AnySyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface AnySyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(T data)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 44 + } + ], + "enumMembers": [], + "line": 43 + }, { "kind": "extension-function", "name": "sync", @@ -126990,7 +127373,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 43 + "line": 49 }, { "kind": "extension-function", @@ -127006,7 +127389,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 49 + "line": 55 }, { "kind": "extension-function", @@ -127022,7 +127405,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 55 + "line": 61 + }, + { + "kind": "extension-function", + "name": "sync", + "typeParams": "", + "receiver": "player", + "signature": "public function player.sync(T data, AnySyncListener listener)", + "doc": "Syncs an arbitrary type from the given player.\n\tOnly works for values representable as an int handle/index (class instances, handle ids).\n\tThe synced object must already be in sync across clients. Listener is destroyed after firing.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 69 }, { "kind": "extension-function", @@ -127038,7 +127437,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 61 + "line": 76 }, { "kind": "extension-function", @@ -127054,7 +127453,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 83 } ] }, @@ -127283,7 +127682,7 @@ "typeParams": "", "receiver": null, "signature": "public constant COLOR_BLACK = colorA(0,0,0,0)", - "doc": "", + "doc": "Black with alpha 0, i.e. fully transparent. COLOR_BLACK_STR therefore\n\trenders text invisible - use colorA(0, 0, 0, 255) for opaque black.", "deprecated": { "flag": false, "message": null @@ -127291,7 +127690,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 18 + "line": 20 }, { "kind": "constant", @@ -127307,7 +127706,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 19 + "line": 21 }, { "kind": "constant", @@ -127323,7 +127722,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 21 + "line": 23 }, { "kind": "constant", @@ -127339,7 +127738,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 22 + "line": 24 }, { "kind": "constant", @@ -127355,7 +127754,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 23 + "line": 25 }, { "kind": "constant", @@ -127371,7 +127770,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 25 + "line": 27 }, { "kind": "constant", @@ -127387,7 +127786,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 27 + "line": 29 }, { "kind": "constant", @@ -127403,7 +127802,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 29 + "line": 31 }, { "kind": "constant", @@ -127419,7 +127818,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 39 + "line": 41 }, { "kind": "extension-function", @@ -127435,7 +127834,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 48 + "line": 50 }, { "kind": "extension-function", @@ -127451,7 +127850,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 51 + "line": 53 }, { "kind": "extension-function", @@ -127467,7 +127866,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 55 + "line": 57 }, { "kind": "extension-function", @@ -127483,7 +127882,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 59 + "line": 61 }, { "kind": "tuple", @@ -127499,7 +127898,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 63 + "line": 65 }, { "kind": "tuple", @@ -127515,7 +127914,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 65 + "line": 67 }, { "kind": "tuple", @@ -127531,7 +127930,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 70 }, { "kind": "extension-function", @@ -127547,7 +127946,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 71 + "line": 73 }, { "kind": "extension-function", @@ -127563,7 +127962,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 74 + "line": 76 }, { "kind": "extension-function", @@ -127579,7 +127978,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 78 + "line": 80 }, { "kind": "extension-function", @@ -127595,7 +127994,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 101 + "line": 103 }, { "kind": "function", @@ -127611,7 +128010,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 136 + "line": 138 }, { "kind": "extension-function", @@ -127627,7 +128026,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 143 + "line": 145 }, { "kind": "extension-function", @@ -127643,7 +128042,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 146 + "line": 148 }, { "kind": "function", @@ -127659,7 +128058,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 149 + "line": 151 }, { "kind": "extension-function", @@ -127675,7 +128074,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 178 + "line": 180 }, { "kind": "extension-function", @@ -127691,7 +128090,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 185 + "line": 187 }, { "kind": "extension-function", @@ -127707,7 +128106,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 189 + "line": 191 }, { "kind": "extension-function", @@ -127723,7 +128122,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 193 + "line": 195 }, { "kind": "extension-function", @@ -127739,7 +128138,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 197 + "line": 199 }, { "kind": "extension-function", @@ -127755,7 +128154,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 201 + "line": 203 }, { "kind": "extension-function", @@ -127771,7 +128170,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 205 + "line": 207 }, { "kind": "extension-function", @@ -127787,7 +128186,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 209 + "line": 211 }, { "kind": "function", @@ -127803,7 +128202,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 213 + "line": 215 }, { "kind": "function", @@ -127819,7 +128218,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 219 + "line": 221 }, { "kind": "extension-function", @@ -127835,7 +128234,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 229 + "line": 231 }, { "kind": "function", @@ -127851,7 +128250,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 238 + "line": 240 }, { "kind": "extension-function", @@ -127867,7 +128266,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 243 + "line": 245 }, { "kind": "extension-function", @@ -127883,7 +128282,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 252 + "line": 254 }, { "kind": "extension-function", @@ -127899,7 +128298,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 267 + "line": 269 }, { "kind": "extension-function", @@ -127915,7 +128314,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 270 + "line": 272 }, { "kind": "extension-function", @@ -127931,7 +128330,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 273 + "line": 275 } ] }, @@ -128235,7 +128634,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 15 + "line": 16 }, { "kind": "extension-function", @@ -128251,7 +128650,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 22 + "line": 24 } ] }, @@ -128261,8 +128660,8 @@ "categoryLabel": "Utilities", "sourcePath": "wurst/util/GameTimer.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/GameTimer.wurst", - "summary": "", - "summaryFirstLine": "", + "summary": "Seconds elapsed since map start.\n\nCaveat for @Test code: the compiletime interpreter backs this with the\nwall clock, so it returns a unix epoch timestamp (~1.7e9). At that\nmagnitude a 32 bit real only resolves ~128 second steps, so instants built\nfrom smaller offsets are indistinguishable from instantNow() there. Build\ninstants explicitly, e.g. instant(10.), when unit testing package Time.", + "summaryFirstLine": "Seconds elapsed since map start.", "tags": [ "util" ], @@ -128282,7 +128681,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 11 + "line": 18 } ] }, @@ -128313,7 +128712,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 22 + "line": 24 }, { "kind": "constant", @@ -128329,7 +128728,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 25 + "line": 27 }, { "kind": "constant", @@ -128345,7 +128744,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 28 + "line": 30 }, { "kind": "function", @@ -128361,7 +128760,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 40 + "line": 42 }, { "kind": "extension-function", @@ -128377,7 +128776,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 53 + "line": 55 }, { "kind": "extension-function", @@ -128385,7 +128784,7 @@ "typeParams": "", "receiver": "group", "signature": "public function group.recyclableIterator() returns group", - "doc": "", + "doc": "Copies this group's units into a freshly acquired recyclable group and\n\treturns it, so the copy can be iterated while the original is modified.\n\tThe caller owns the result and must call .release() on it.\n\n\tNot re-entrant: the copy is staged through a single package global, so this\n\tmust not be called again from inside an iteration over its own result.", "deprecated": { "flag": false, "message": null @@ -128393,7 +128792,39 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 70 + "line": 78 + }, + { + "kind": "extension-function", + "name": "getClosestUnit", + "typeParams": "", + "receiver": "group", + "signature": "public function group.getClosestUnit(vec2 pos) returns unit", + "doc": "Returns the closest unit in this group to the given position.\n\tReturns null if the group is empty.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 150 + }, + { + "kind": "extension-function", + "name": "filterAliveUnits", + "typeParams": "", + "receiver": "group", + "signature": "public function group.filterAliveUnits(unit mustBeEnemyOf, int ownerId) returns group", + "doc": "Filters this group to include only alive units, optionally filtering by allegiance and owner.\n\tmustBeEnemyOf: If not null, only units that are enemies of this unit are kept. Pass null to ignore allegiance.\n\townerId: If not -1, only units owned by this player ID are kept. Pass -1 to ignore owner.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 163 } ] }, @@ -128528,7 +128959,7 @@ "typeParams": "", "receiver": null, "signature": "static function add(unit u, real velocity, angle groundAngle, angle airAngle)", - "doc": "Apply a knockback vector to unit u. `velocity` is initial speed in units\nper second. `groundAngle` and `airAngle` are the direction and trajectory\nparameters, respectively. Example:", + "doc": "Apply a knockback vector to unit u. `velocity` is initial speed in units\nper second. `groundAngle` and `airAngle` are the direction and trajectory\nparameters, respectively. Example:\n\n> Knockback3.add(u, 1000., 0 .fromDeg(), 45 .fromDeg())", "deprecated": { "flag": false, "message": null @@ -128536,7 +128967,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 131 + "line": 138 }, { "kind": "function", @@ -128544,7 +128975,7 @@ "typeParams": "", "receiver": null, "signature": "static function add(unit u, vec2 target, real groundSpeed)", - "doc": "Apply a knockback vector to unit u. If the unit is stopped, this vector will\nthrow the unit to the position at vec2 `target`. Along the XY-plane, the\nunit will move `groundSpeed` units per second. Note that the more vertical\nangle will always be used from the pair of possible trajectories. Example:", + "doc": "Apply a knockback vector to unit u. If the unit is stopped, this vector will\nthrow the unit to the position at vec2 `target`. Along the XY-plane, the\nunit will move `groundSpeed` units per second. Note that the more vertical\nangle will always be used from the pair of possible trajectories. Example:\n\n> Knockback3.add(caster, getSpellTargetPos(), 500.)", "deprecated": { "flag": false, "message": null @@ -128552,7 +128983,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 157 + "line": 166 }, { "kind": "function", @@ -128568,7 +128999,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 171 + "line": 182 }, { "kind": "function", @@ -128576,7 +129007,7 @@ "typeParams": "", "receiver": null, "signature": "static function getVel(unit u) returns vec3", - "doc": "Getter for the knockback vector on unit u. If the unit is not already tracked, returns (0, 0, 0).", + "doc": "Getter for the knockback vector on unit u, as a per-tick displacement\n(speed * ANIMATION_PERIOD) - note that `add` and `setVel` take units per\n*second*. Returns (0, 0, 0) if the unit is not tracked.", "deprecated": { "flag": false, "message": null @@ -128584,7 +129015,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 184 + "line": 197 + }, + { + "kind": "function", + "name": "getVelPerSecond", + "typeParams": "", + "receiver": null, + "signature": "static function getVelPerSecond(unit u) returns vec3", + "doc": "Getter for the knockback velocity on unit u in units per second, i.e. in\nthe same units that `add` and `setVel` accept.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 204 }, { "kind": "function", @@ -128600,7 +129047,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 192 + "line": 212 } ], "enumMembers": [], @@ -128916,7 +129363,7 @@ "typeParams": "", "receiver": null, "signature": "static function error(string msg)", - "doc": "Prints a warning logmessage", + "doc": "Prints an error logmessage", "deprecated": { "flag": false, "message": null @@ -129016,7 +129463,7 @@ "typeParams": "", "receiver": null, "signature": "public function printLog(Loglevel loglvl, string msg)", - "doc": "Prints a special motification-message", + "doc": "Prints a special notification-message", "deprecated": { "flag": false, "message": null @@ -130043,7 +130490,7 @@ "categoryLabel": "Utilities", "sourcePath": "wurst/util/StringUtils.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/StringUtils.wurst", - "summary": "Returns the width of the string.\n\tOnly accounts for single byte (latin) characters, multibyte characters\n\tcontribute no width.", + "summary": "Returns the width of the string.\n\tOnly meaningful for single byte (latin) characters. Each byte of a\n\tmultibyte (non-latin) character is looked up individually and falls back to\n\tthe width of a space, so the result for non-latin text is an approximation\n\trather than a true width.", "summaryFirstLine": "Returns the width of the string.", "tags": [ "util" @@ -130112,7 +130559,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 43 + "line": 45 }, { "kind": "function", @@ -130128,7 +130575,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 49 + "line": 51 }, { "kind": "extension-function", @@ -130144,7 +130591,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 59 + "line": 61 }, { "kind": "extension-function", @@ -130160,7 +130607,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 64 + "line": 66 }, { "kind": "extension-function", @@ -130176,7 +130623,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 67 + "line": 69 }, { "kind": "extension-function", @@ -130192,7 +130639,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 72 + "line": 74 }, { "kind": "extension-function", @@ -130208,7 +130655,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 77 + "line": 79 }, { "kind": "extension-function", @@ -130224,7 +130671,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 83 + "line": 85 }, { "kind": "function", @@ -130240,7 +130687,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 86 + "line": 88 }, { "kind": "function", @@ -130256,7 +130703,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 89 + "line": 91 }, { "kind": "extension-function", @@ -130272,7 +130719,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 94 + "line": 96 }, { "kind": "extension-function", @@ -130288,7 +130735,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 111 + "line": 113 }, { "kind": "extension-function", @@ -130304,7 +130751,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 127 + "line": 129 }, { "kind": "interface", @@ -130333,11 +130780,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 131 + "line": 133 } ], "enumMembers": [], - "line": 130 + "line": 132 }, { "kind": "extension-function", @@ -130353,7 +130800,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 138 + "line": 140 }, { "kind": "extension-function", @@ -130361,7 +130808,7 @@ "typeParams": "", "receiver": "string", "signature": "public function string.isNumber() returns bool", - "doc": "Checks whether a string is a number or not.", + "doc": "Checks whether a string is a decimal number: an optional leading \"-\",\n\tat least one digit, and at most one decimal point.\n\t\"\", \"-\", \".\" and \"-.\" are not numbers.", "deprecated": { "flag": false, "message": null @@ -130369,7 +130816,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 155 + "line": 159 }, { "kind": "extension-function", @@ -130385,7 +130832,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 169 + "line": 177 }, { "kind": "extension-function", @@ -130401,7 +130848,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 177 + "line": 185 } ] }, @@ -131431,7 +131878,7 @@ "typeParams": "", "receiver": "instant", "signature": "public function instant.isOlderThan(instant other) returns bool", - "doc": "Instant > instant ?", + "doc": "True if this instant happened before `other`.", "deprecated": { "flag": false, "message": null @@ -131447,7 +131894,7 @@ "typeParams": "", "receiver": "instant", "signature": "public function instant.isNewerThan(instant other) returns bool", - "doc": "Instant < instant ?", + "doc": "True if this instant happens after `other`.", "deprecated": { "flag": false, "message": null @@ -131527,7 +131974,7 @@ "typeParams": "", "receiver": "duration", "signature": "public function duration.displayVerbose() returns string", - "doc": "Tranform a duration to a verbose string. Example:\n\n61..seconds().displayVerbose()\n> \"1 minutes, and 1 seconds\"", + "doc": "Transform a duration to a verbose string. Example:\n\n61..seconds().displayVerbose()\n> \"1 minutes, and 1 seconds\"", "deprecated": { "flag": false, "message": null @@ -131535,7 +131982,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 231 + "line": 240 }, { "kind": "extension-function", @@ -131543,7 +131990,7 @@ "typeParams": "", "receiver": "duration", "signature": "public function duration.display(string prefix) returns string", - "doc": "Tranform a duration to a short string. Example:\n\n61..minutes().display(\"T-\")\n> \"T-1H1M0S\"", + "doc": "Transform a duration to a short string. Example:\n\n61..minutes().display(\"T-\")\n> \"T-1H1M0S\"", "deprecated": { "flag": false, "message": null @@ -131551,7 +131998,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 240 + "line": 249 }, { "kind": "extension-function", @@ -131567,7 +132014,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 249 + "line": 258 }, { "kind": "extension-function", @@ -131583,7 +132030,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 257 + "line": 266 }, { "kind": "extension-function", @@ -131599,7 +132046,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 265 + "line": 274 }, { "kind": "function", @@ -131615,7 +132062,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 270 + "line": 279 }, { "kind": "function", @@ -131631,7 +132078,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 273 + "line": 282 }, { "kind": "function", @@ -131647,7 +132094,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 276 + "line": 285 }, { "kind": "function", @@ -131663,7 +132110,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 279 + "line": 288 } ] }, @@ -131794,7 +132241,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 105 + "line": 110 }, { "kind": "function", @@ -131802,7 +132249,7 @@ "typeParams": "", "receiver": null, "signature": "function getPeriod() returns real", - "doc": "Returns the period of the timed loop.\n\t\tOvewrite this to set a custom period", + "doc": "Returns the period of the timed loop.\n\t\tOverwrite this to set a custom period. It is read once, when the first\n\t\tinstance of this class starts its loop.", "deprecated": { "flag": false, "message": null @@ -131810,7 +132257,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 109 + "line": 115 }, { "kind": "function", @@ -131826,7 +132273,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 135 + "line": 142 }, { "kind": "function", @@ -131842,7 +132289,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 139 + "line": 146 }, { "kind": "function", @@ -131850,7 +132297,7 @@ "typeParams": "", "receiver": null, "signature": "function startTimedLoop()", - "doc": "Starts the periodic updates for this object", + "doc": "Starts the periodic updates for this object.\n\t\tCalling this on an already running instance has no effect.", "deprecated": { "flag": false, "message": null @@ -131858,7 +132305,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 143 + "line": 151 } ], "enumMembers": [], @@ -131895,7 +132342,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 121 + "line": 142 }, { "kind": "extension-function", @@ -131911,7 +132358,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 127 + "line": 148 }, { "kind": "extension-function", @@ -131927,7 +132374,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 131 + "line": 152 }, { "kind": "function", @@ -131943,7 +132390,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 142 + "line": 163 }, { "kind": "function", @@ -131959,7 +132406,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 149 + "line": 170 }, { "kind": "function", @@ -131975,7 +132422,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 154 + "line": 175 }, { "kind": "extension-function", @@ -131991,7 +132438,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 159 + "line": 180 }, { "kind": "class", @@ -132020,7 +132467,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 169 + "line": 190 }, { "kind": "function", @@ -132036,7 +132483,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 172 + "line": 193 }, { "kind": "function", @@ -132052,11 +132499,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 175 + "line": 196 } ], "enumMembers": [], - "line": 166 + "line": 187 } ] }, @@ -142847,8 +143294,8 @@ "categoryLabel": "Handle Wrappers", "sourcePath": "wurst/_handles/primitives/Integer.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_handles/primitives/Integer.wurst", - "summary": "", - "summaryFirstLine": "", + "summary": "Returns this int to the power of the argument int.\n\tA negative exponent yields 1, since the true result is not an integer.\n\tOverflow wraps silently.", + "summaryFirstLine": "Returns this int to the power of the argument int.", "tags": [ "handles" ], @@ -142982,13 +143429,29 @@ "enumMembers": [], "line": 29 }, + { + "kind": "extension-function", + "name": "toStringOrdinal", + "typeParams": "", + "receiver": "int", + "signature": "public function int.toStringOrdinal() returns string", + "doc": "Returns this int with its English ordinal suffix, e.g. 1 -> \"1st\", 2 -> \"2nd\", 3 -> \"3rd\", 4 -> \"4th\".\n\tHandles the 11/12/13 exceptions correctly.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 34 + }, { "kind": "extension-function", "name": "pow", "typeParams": "", "receiver": "int", "signature": "public function int.pow(int x) returns int", - "doc": "Returns this int to the power of the argument int", + "doc": "", "deprecated": { "flag": false, "message": null @@ -142996,7 +143459,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 33 + "line": 50 }, { "kind": "extension-function", @@ -143012,7 +143475,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 40 + "line": 57 }, { "kind": "extension-function", @@ -143028,7 +143491,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 44 + "line": 61 }, { "kind": "extension-function", @@ -143044,7 +143507,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 48 + "line": 65 }, { "kind": "extension-function", @@ -143060,7 +143523,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 52 + "line": 69 }, { "kind": "extension-function", @@ -143076,7 +143539,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 56 + "line": 73 }, { "kind": "extension-function", @@ -143092,7 +143555,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 60 + "line": 77 }, { "kind": "extension-function", @@ -143108,7 +143571,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 64 + "line": 81 }, { "kind": "extension-function", @@ -143124,7 +143587,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 85 }, { "kind": "extension-function", @@ -143140,7 +143603,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 76 + "line": 93 } ] }, @@ -147053,7 +147516,7 @@ "typeParams": "", "receiver": "real", "signature": "public function real.abs() returns real", - "doc": "Returns the abolsute value of the given real.\nThis means, negative values will be return positive.", + "doc": "Returns the absolute value of the given real.\nThis means, negative values will be return positive.", "deprecated": { "flag": false, "message": null @@ -147798,6 +148261,54 @@ "enumMembers": [], "line": 66 }, + { + "kind": "extension-function", + "name": "toRegion", + "typeParams": "", + "receiver": "rect", + "signature": "public function rect.toRegion() returns region", + "doc": "Converts this rect to a region.\n\tWARNING: Creates a new region; caller owns it and must call .destr() to avoid a handle leak.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 71 + }, + { + "kind": "extension-function", + "name": "fromCenter", + "typeParams": "", + "receiver": "rect", + "signature": "public function rect.fromCenter(real sizeX, real sizeY) returns rect", + "doc": "Creates a rect centered at this rect's center with the given full width and height.\n\tExample: A rect at (100,100) with sizeX=20, sizeY=30 spans from (90,85) to (110,115).", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 78 + }, + { + "kind": "extension-function", + "name": "fromCenterWithOffset", + "typeParams": "", + "receiver": "rect", + "signature": "public function rect.fromCenterWithOffset(real sizeX, real sizeY, vec2 offset) returns rect", + "doc": "Creates a rect centered at this rect's center plus offset, with the given full width and height.\n\tExample: A rect at (100,100) with offset (10,0), sizeX=20, sizeY=30 spans from (100,85) to (120,115).", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 84 + }, { "kind": "extension-function", "name": "setRectFromLoc", @@ -147812,7 +148323,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 92 + "line": 111 }, { "kind": "extension-function", @@ -147828,7 +148339,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 95 + "line": 114 }, { "kind": "extension-function", @@ -147844,7 +148355,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 98 + "line": 117 }, { "kind": "extension-function", @@ -147860,7 +148371,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 101 + "line": 120 }, { "kind": "extension-function", @@ -147876,7 +148387,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 104 + "line": 123 }, { "kind": "extension-function", @@ -147892,7 +148403,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 107 + "line": 126 } ] }, @@ -148689,7 +149200,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 54 + "line": 50 }, { "kind": "extension-function", @@ -148705,7 +149216,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 71 + "line": 121 }, { "kind": "extension-function", @@ -148721,7 +149232,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 77 + "line": 127 }, { "kind": "extension-function", @@ -148737,7 +149248,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 87 + "line": 137 }, { "kind": "extension-function", @@ -148753,7 +149264,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 141 }, { "kind": "extension-function", @@ -148769,7 +149280,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 95 + "line": 145 }, { "kind": "extension-function", @@ -148785,7 +149296,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 101 + "line": 151 }, { "kind": "extension-function", @@ -148801,7 +149312,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 106 + "line": 156 }, { "kind": "extension-function", @@ -148817,7 +149328,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 112 + "line": 162 }, { "kind": "extension-function", @@ -148833,7 +149344,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 118 + "line": 168 }, { "kind": "extension-function", @@ -148849,7 +149360,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 122 + "line": 172 }, { "kind": "extension-function", @@ -148865,7 +149376,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 126 + "line": 176 }, { "kind": "extension-function", @@ -148881,7 +149392,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 135 + "line": 185 }, { "kind": "extension-function", @@ -148897,7 +149408,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 142 + "line": 192 }, { "kind": "extension-function", @@ -148913,7 +149424,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 146 + "line": 196 }, { "kind": "extension-function", @@ -148929,7 +149440,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 150 + "line": 200 }, { "kind": "extension-function", @@ -148945,7 +149456,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 154 + "line": 204 }, { "kind": "extension-function", @@ -148953,7 +149464,7 @@ "typeParams": "", "receiver": "string", "signature": "public function string.trim() returns string", - "doc": "Returns the given string with whitespaces removed from both ends", + "doc": "Returns the given string with whitespace (\" \", \\n, \\t, \\r) removed from both ends", "deprecated": { "flag": false, "message": null @@ -148961,7 +149472,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 158 + "line": 208 }, { "kind": "extension-function", @@ -148969,7 +149480,7 @@ "typeParams": "", "receiver": "string", "signature": "public function string.ltrim() returns string", - "doc": "Returns the given string with whitespaces removed from the left end", + "doc": "Returns the given string with whitespace (\" \", \\n, \\t, \\r) removed from the left end", "deprecated": { "flag": false, "message": null @@ -148977,7 +149488,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 168 + "line": 218 }, { "kind": "extension-function", @@ -148985,7 +149496,7 @@ "typeParams": "", "receiver": "string", "signature": "public function string.rtrim() returns string", - "doc": "Returns the given string with whitespaces removed from the right end", + "doc": "Returns the given string with whitespace (\" \", \\n, \\t, \\r) removed from the right end", "deprecated": { "flag": false, "message": null @@ -148993,7 +149504,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 176 + "line": 226 }, { "kind": "extension-function", @@ -149009,7 +149520,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 183 + "line": 233 }, { "kind": "extension-function", @@ -149025,7 +149536,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 190 + "line": 240 }, { "kind": "extension-function", @@ -149041,7 +149552,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 197 + "line": 247 }, { "kind": "extension-function", @@ -149057,7 +149568,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 204 + "line": 254 }, { "kind": "extension-function", @@ -149073,7 +149584,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 216 + "line": 266 }, { "kind": "extension-function", @@ -149089,7 +149600,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 226 + "line": 276 }, { "kind": "extension-function", @@ -149105,7 +149616,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 233 + "line": 283 }, { "kind": "extension-function", @@ -149121,7 +149632,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 245 + "line": 295 }, { "kind": "extension-function", @@ -149137,7 +149648,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 249 + "line": 299 }, { "kind": "extension-function", @@ -149153,7 +149664,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 253 + "line": 303 }, { "kind": "extension-function", @@ -149169,7 +149680,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 259 + "line": 309 }, { "kind": "extension-function", @@ -149185,7 +149696,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 265 + "line": 315 }, { "kind": "function", @@ -149193,7 +149704,7 @@ "typeParams": "", "receiver": null, "signature": "public function stringCompare(string s1, string s2) returns int", - "doc": "Returns an integer result based on a lexicographic string comparison of strings s1 and s2.", + "doc": "Returns a negative number if s1 sorts before s2, a positive number if it\nsorts after, and 0 only if the two strings are equal.\n\nAlphanumerics keep their long standing order: digits, then lowercase, then\nuppercase, so \"Hello\" sorts after \"hello\". Every other printable ascii\ncharacter sorts after all alphanumerics, ordered by ascii code point among\nthemselves. Bytes outside printable ascii - control characters and the\nindividual bytes of multibyte characters - sort last, tie-broken by string\nhash so the result stays consistent.", "deprecated": { "flag": false, "message": null @@ -149201,7 +149712,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 275 + "line": 333 }, { "kind": "extension-function", @@ -149217,7 +149728,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 292 + "line": 359 }, { "kind": "extension-function", @@ -149233,7 +149744,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 297 + "line": 364 }, { "kind": "extension-function", @@ -149249,7 +149760,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 307 + "line": 374 }, { "kind": "class", @@ -149278,7 +149789,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 315 + "line": 382 }, { "kind": "function", @@ -149294,7 +149805,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 320 + "line": 387 }, { "kind": "function", @@ -149310,7 +149821,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 323 + "line": 390 }, { "kind": "function", @@ -149326,11 +149837,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 342 + "line": 409 } ], "enumMembers": [], - "line": 310 + "line": 377 }, { "kind": "class", @@ -149359,7 +149870,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 352 + "line": 419 }, { "kind": "function", @@ -149375,7 +149886,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 358 + "line": 425 }, { "kind": "function", @@ -149391,7 +149902,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 362 + "line": 429 }, { "kind": "function", @@ -149407,7 +149918,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 366 + "line": 433 }, { "kind": "function", @@ -149423,11 +149934,11 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 373 + "line": 440 } ], "enumMembers": [], - "line": 346 + "line": 413 }, { "kind": "extension-function", @@ -149443,7 +149954,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 379 + "line": 446 } ] }, @@ -154374,6 +154885,22 @@ "enumMembers": [], "line": 749 }, + { + "kind": "extension-function", + "name": "disableAttackEx", + "typeParams": "", + "receiver": "unit", + "signature": "public function unit.disableAttackEx(int index, bool flag)", + "doc": "Enables/disables a single weapon by index (0 = the unit's first/regular attack).\n\tUnlike disableAttack this toggles the weapon field directly, so it can disable one\n\tweapon on a multi-weapon unit without hiding the attack command.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 755 + }, { "kind": "extension-function", "name": "disableWorkQueue", @@ -154388,7 +154915,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 752 + "line": 758 }, { "kind": "extension-function", @@ -154404,7 +154931,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 755 + "line": 761 }, { "kind": "extension-function", @@ -154420,7 +154947,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 758 + "line": 764 }, { "kind": "extension-function", @@ -154436,7 +154963,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 761 + "line": 767 }, { "kind": "extension-function", @@ -154452,7 +154979,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 764 + "line": 770 }, { "kind": "extension-function", @@ -154468,7 +154995,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 767 + "line": 773 }, { "kind": "extension-function", @@ -154484,7 +155011,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 770 + "line": 776 }, { "kind": "extension-function", @@ -154500,7 +155027,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 774 + "line": 780 }, { "kind": "extension-function", @@ -154516,7 +155043,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 778 + "line": 784 }, { "kind": "extension-function", @@ -154532,7 +155059,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 781 + "line": 787 }, { "kind": "extension-function", @@ -154548,7 +155075,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 784 + "line": 790 }, { "kind": "extension-function", @@ -154564,7 +155091,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 787 + "line": 793 }, { "kind": "extension-function", @@ -154580,7 +155107,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 790 + "line": 796 }, { "kind": "extension-function", @@ -154596,7 +155123,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 793 + "line": 799 }, { "kind": "extension-function", @@ -154612,7 +155139,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 796 + "line": 802 }, { "kind": "extension-function", @@ -154628,7 +155155,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 799 + "line": 805 }, { "kind": "extension-function", @@ -154644,7 +155171,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 802 + "line": 808 }, { "kind": "extension-function", @@ -154660,7 +155187,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 805 + "line": 811 }, { "kind": "extension-function", @@ -154676,7 +155203,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 808 + "line": 814 }, { "kind": "extension-function", @@ -154692,7 +155219,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 811 + "line": 817 }, { "kind": "extension-function", @@ -154708,7 +155235,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 814 + "line": 820 }, { "kind": "extension-function", @@ -154724,7 +155251,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 817 + "line": 823 }, { "kind": "extension-function", @@ -154740,7 +155267,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 820 + "line": 826 }, { "kind": "extension-function", @@ -154756,7 +155283,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 823 + "line": 829 }, { "kind": "extension-function", @@ -154772,7 +155299,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 829 + "line": 835 }, { "kind": "extension-function", @@ -154788,7 +155315,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 832 + "line": 838 }, { "kind": "enum", @@ -154808,7 +155335,7 @@ "UNIT", "DESTRUCTABLE" ], - "line": 835 + "line": 841 }, { "kind": "tuple", @@ -154824,7 +155351,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 840 + "line": 846 }, { "kind": "extension-function", @@ -154840,7 +155367,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 843 + "line": 849 }, { "kind": "extension-function", @@ -154856,7 +155383,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 881 + "line": 887 }, { "kind": "extension-function", @@ -154872,7 +155399,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 886 + "line": 892 }, { "kind": "extension-function", @@ -154888,7 +155415,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 894 + "line": 900 }, { "kind": "extension-function", @@ -154904,7 +155431,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 901 + "line": 907 }, { "kind": "extension-function", @@ -154920,7 +155447,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 904 + "line": 910 }, { "kind": "extension-function", @@ -154936,7 +155463,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 907 + "line": 913 }, { "kind": "extension-function", @@ -154952,7 +155479,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 910 + "line": 916 }, { "kind": "extension-function", @@ -154968,7 +155495,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 913 + "line": 919 }, { "kind": "extension-function", @@ -154984,7 +155511,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 916 + "line": 922 }, { "kind": "extension-function", @@ -155000,7 +155527,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 919 + "line": 925 }, { "kind": "extension-function", @@ -155016,7 +155543,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 922 + "line": 928 }, { "kind": "extension-function", @@ -155032,7 +155559,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 926 + "line": 932 }, { "kind": "extension-function", @@ -155048,7 +155575,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 929 + "line": 935 }, { "kind": "extension-function", @@ -155064,7 +155591,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 932 + "line": 938 }, { "kind": "extension-function", @@ -155080,7 +155607,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 935 + "line": 941 }, { "kind": "extension-function", @@ -155096,7 +155623,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 938 + "line": 944 }, { "kind": "extension-function", @@ -155112,7 +155639,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 941 + "line": 947 }, { "kind": "extension-function", @@ -155128,7 +155655,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 944 + "line": 950 }, { "kind": "extension-function", @@ -155144,7 +155671,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 947 + "line": 953 }, { "kind": "extension-function", @@ -155160,7 +155687,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 950 + "line": 956 }, { "kind": "extension-function", @@ -155176,7 +155703,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 953 + "line": 959 }, { "kind": "extension-function", @@ -155192,7 +155719,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 956 + "line": 962 }, { "kind": "extension-function", @@ -155208,7 +155735,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 959 + "line": 965 }, { "kind": "extension-function", @@ -155224,7 +155751,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 962 + "line": 968 }, { "kind": "extension-function", @@ -155240,7 +155767,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 965 + "line": 971 }, { "kind": "extension-function", @@ -155256,7 +155783,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 968 + "line": 974 }, { "kind": "extension-function", @@ -155272,7 +155799,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 971 + "line": 977 }, { "kind": "extension-function", @@ -155288,7 +155815,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 974 + "line": 980 }, { "kind": "extension-function", @@ -155304,7 +155831,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 977 + "line": 983 }, { "kind": "extension-function", @@ -155320,7 +155847,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 980 + "line": 986 }, { "kind": "extension-function", @@ -155336,7 +155863,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 983 + "line": 989 }, { "kind": "extension-function", @@ -155352,7 +155879,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 986 + "line": 992 }, { "kind": "extension-function", @@ -155368,7 +155895,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 989 + "line": 995 }, { "kind": "extension-function", @@ -155384,7 +155911,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 992 + "line": 998 }, { "kind": "extension-function", @@ -155400,7 +155927,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 995 + "line": 1001 }, { "kind": "extension-function", @@ -155416,7 +155943,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 998 + "line": 1004 }, { "kind": "extension-function", @@ -155432,7 +155959,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1001 + "line": 1007 }, { "kind": "extension-function", @@ -155448,7 +155975,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1004 + "line": 1010 }, { "kind": "extension-function", @@ -155464,7 +155991,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1007 + "line": 1013 }, { "kind": "extension-function", @@ -155480,7 +156007,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1010 + "line": 1016 }, { "kind": "extension-function", @@ -155496,7 +156023,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1013 + "line": 1019 }, { "kind": "extension-function", @@ -155512,7 +156039,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1016 + "line": 1022 }, { "kind": "extension-function", @@ -155528,7 +156055,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1019 + "line": 1025 }, { "kind": "extension-function", @@ -155544,7 +156071,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1022 + "line": 1028 }, { "kind": "extension-function", @@ -155560,7 +156087,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1025 + "line": 1031 }, { "kind": "extension-function", @@ -155576,7 +156103,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1028 + "line": 1034 }, { "kind": "extension-function", @@ -155592,7 +156119,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1031 + "line": 1037 }, { "kind": "extension-function", @@ -155608,7 +156135,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1034 + "line": 1040 }, { "kind": "extension-function", @@ -155624,7 +156151,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1037 + "line": 1043 }, { "kind": "extension-function", @@ -155640,7 +156167,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1040 + "line": 1046 }, { "kind": "extension-function", @@ -155656,7 +156183,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1043 + "line": 1049 }, { "kind": "extension-function", @@ -155672,7 +156199,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1046 + "line": 1052 }, { "kind": "extension-function", @@ -155688,7 +156215,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1049 + "line": 1055 }, { "kind": "extension-function", @@ -155704,7 +156231,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1052 + "line": 1058 }, { "kind": "extension-function", @@ -155720,7 +156247,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1055 + "line": 1061 }, { "kind": "extension-function", @@ -155736,7 +156263,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1058 + "line": 1064 }, { "kind": "extension-function", @@ -155752,7 +156279,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1061 + "line": 1067 }, { "kind": "extension-function", @@ -155768,7 +156295,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1064 + "line": 1070 }, { "kind": "extension-function", @@ -155784,7 +156311,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1067 + "line": 1073 }, { "kind": "extension-function", @@ -155800,7 +156327,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1070 + "line": 1076 }, { "kind": "extension-function", @@ -155816,7 +156343,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 1073 + "line": 1079 } ] }, diff --git a/_doc/stdlib/ref/_handles/Integer.md b/_doc/stdlib/ref/_handles/Integer.md index dee78d4..c8f0b7b 100644 --- a/_doc/stdlib/ref/_handles/Integer.md +++ b/_doc/stdlib/ref/_handles/Integer.md @@ -10,6 +10,10 @@ generated: true toc: sections --- +Returns this int to the power of the argument int. + A negative exponent yields 1, since the true result is not an integer. + Overflow wraps silently. + **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_handles/primitives/Integer.wurst)** ## Extension Functions @@ -62,14 +66,21 @@ public function int.toString() returns string Returns the string representation of this int +### int.toStringOrdinal + +```wurst +public function int.toStringOrdinal() returns string +``` + +Returns this int with its English ordinal suffix, e.g. 1 -> "1st", 2 -> "2nd", 3 -> "3rd", 4 -> "4th". + Handles the 11/12/13 exceptions correctly. + ### int.pow ```wurst public function int.pow(int x) returns int ``` -Returns this int to the power of the argument int - ### int.lerp ```wurst diff --git a/_doc/stdlib/ref/_handles/Real.md b/_doc/stdlib/ref/_handles/Real.md index b6f3d15..b595a0a 100644 --- a/_doc/stdlib/ref/_handles/Real.md +++ b/_doc/stdlib/ref/_handles/Real.md @@ -24,7 +24,7 @@ The arctangent function with two arguments. public function real.abs() returns real ``` -Returns the abolsute value of the given real. +Returns the absolute value of the given real. This means, negative values will be return positive. ### real.squared diff --git a/_doc/stdlib/ref/_handles/Rect.md b/_doc/stdlib/ref/_handles/Rect.md index 35de573..d76dd44 100644 --- a/_doc/stdlib/ref/_handles/Rect.md +++ b/_doc/stdlib/ref/_handles/Rect.md @@ -140,6 +140,33 @@ public function rect.remove() public function rect.copy() returns rect ``` +### rect.toRegion + +```wurst +public function rect.toRegion() returns region +``` + +Converts this rect to a region. + WARNING: Creates a new region; caller owns it and must call .destr() to avoid a handle leak. + +### rect.fromCenter + +```wurst +public function rect.fromCenter(real sizeX, real sizeY) returns rect +``` + +Creates a rect centered at this rect's center with the given full width and height. + Example: A rect at (100,100) with sizeX=20, sizeY=30 spans from (90,85) to (110,115). + +### rect.fromCenterWithOffset + +```wurst +public function rect.fromCenterWithOffset(real sizeX, real sizeY, vec2 offset) returns rect +``` + +Creates a rect centered at this rect's center plus offset, with the given full width and height. + Example: A rect at (100,100) with offset (10,0), sizeX=20, sizeY=30 spans from (100,85) to (120,115). + ### rect.setRectFromLoc ```wurst diff --git a/_doc/stdlib/ref/_handles/String.md b/_doc/stdlib/ref/_handles/String.md index 75f1588..74dd220 100644 --- a/_doc/stdlib/ref/_handles/String.md +++ b/_doc/stdlib/ref/_handles/String.md @@ -61,7 +61,15 @@ public class StringLines public function stringCompare(string s1, string s2) returns int ``` -Returns an integer result based on a lexicographic string comparison of strings s1 and s2. +Returns a negative number if s1 sorts before s2, a positive number if it +sorts after, and 0 only if the two strings are equal. + +Alphanumerics keep their long standing order: digits, then lowercase, then +uppercase, so "Hello" sorts after "hello". Every other printable ascii +character sorts after all alphanumerics, ordered by ascii code point among +themselves. Bytes outside printable ascii - control characters and the +individual bytes of multibyte characters - sort last, tie-broken by string +hash so the result stays consistent. ## Extension Functions @@ -230,7 +238,7 @@ True when string contains only lowercase letters public function string.trim() returns string ``` -Returns the given string with whitespaces removed from both ends +Returns the given string with whitespace (" ", \n, \t, \r) removed from both ends ### string.ltrim @@ -238,7 +246,7 @@ Returns the given string with whitespaces removed from both ends public function string.ltrim() returns string ``` -Returns the given string with whitespaces removed from the left end +Returns the given string with whitespace (" ", \n, \t, \r) removed from the left end ### string.rtrim @@ -246,7 +254,7 @@ Returns the given string with whitespaces removed from the left end public function string.rtrim() returns string ``` -Returns the given string with whitespaces removed from the right end +Returns the given string with whitespace (" ", \n, \t, \r) removed from the right end ### string.ltrim diff --git a/_doc/stdlib/ref/_handles/Unit.md b/_doc/stdlib/ref/_handles/Unit.md index 8aa6ac1..26ee122 100644 --- a/_doc/stdlib/ref/_handles/Unit.md +++ b/_doc/stdlib/ref/_handles/Unit.md @@ -1386,6 +1386,16 @@ public function unit.disableAbility(int abilId, boolean flag, boolean hideUI) public function unit.disableAttack(boolean flag, boolean hideUI) ``` +### unit.disableAttackEx + +```wurst +public function unit.disableAttackEx(int index, bool flag) +``` + +Enables/disables a single weapon by index (0 = the unit's first/regular attack). + Unlike disableAttack this toggles the weapon field directly, so it can disable one + weapon on a multi-weapon unit without hiding the attack command. + ### unit.disableWorkQueue ```wurst diff --git a/_doc/stdlib/ref/closures/ClosureForGroups.md b/_doc/stdlib/ref/closures/ClosureForGroups.md index 806c705..c042ba2 100644 --- a/_doc/stdlib/ref/closures/ClosureForGroups.md +++ b/_doc/stdlib/ref/closures/ClosureForGroups.md @@ -13,9 +13,9 @@ toc: sections curated: /stdlib/closure_for_groups --- -Executes the given closure for every unit in this group, - removing the units from the group as processed. - Return true to continue iteration, false to stop. +Executes the given closure for every unit of the given type. + Stops invoking the closure after *count* units. The underlying enumeration + cannot be aborted, so it still visits every match. **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/ClosureForGroups.wurst)** @@ -72,9 +72,6 @@ Executes the given closure for every unit of the given type. public function forUnitsOfTypeCounted(string unitname, int count, ForGroupCallback c) ``` -Executes the given closure for every unit of the given player. - Cancels itself after *count* iterations - ### forUnitsOfPlayer ```wurst @@ -106,7 +103,8 @@ public function forUnitsInRectCounted(rect r, int count, ForGroupCallback c) ``` Executes the given closure for every unit in the given rect. - Cancels itself after *count* iterations + Stops invoking the closure after *count* units. The underlying enumeration + cannot be aborted, so it still visits every unit in the rect. ### forUnitsInRange @@ -131,8 +129,9 @@ Executes the given closure for every unit in range of the given position public function forUnitsInRangeCounted(vec2 pos, real radius, int count, ForGroupCallback c) ``` -Executes the given closure for every unit in range of the given position - Cancels itself after *count* iterations +Executes the given closure for every unit in range of the given position. + Stops invoking the closure after *count* units. The underlying enumeration + cannot be aborted, so it still visits every unit in range. ### forUnitsSelected @@ -212,7 +211,7 @@ public function forDestructablesInRange(vec2 pos, real range, ForGroupCallbackD ``` Executes the given closure for all destructables in a rect - that incompasses the circle with the range radius at the given position. + that encompasses the circle with the range radius at the given position. ### forDestructablesInRange @@ -221,7 +220,7 @@ public function forDestructablesInRange(vec2 pos, real range, boolexpr filter, F ``` Executes the given closure for all destructables in a rect - that incompasses the circle with the range radius at the given position. + that encompasses the circle with the range radius at the given position. ### forDestructablesInRect @@ -245,7 +244,7 @@ Executes the given closure for all destructables in the given rect public function forNearestDestructable(vec2 pos, real range, ForGroupCallbackD c) ``` -Executes the given closure for the closes destructable in the given rect. +Executes the given closure for the closest destructable in the given range. If there is no destructable in range, the closure will be run with "null" ## Extension Functions @@ -274,6 +273,10 @@ Executes the given closure for every unit in this group, public function group.forEachFromUntil(ForGroupCallbackUntil cb) ``` +Executes the given closure for every unit in this group, + removing the units from the group as processed. + Return true to continue iteration, false to stop. + ### group.forEachInUntil ```wurst diff --git a/_doc/stdlib/ref/closures/ClosureTimers.md b/_doc/stdlib/ref/closures/ClosureTimers.md index 9dc3106..29a1b90 100644 --- a/_doc/stdlib/ref/closures/ClosureTimers.md +++ b/_doc/stdlib/ref/closures/ClosureTimers.md @@ -49,6 +49,10 @@ public abstract class CallbackPeriodic **Members:** - `abstract function call(thistype cb)` +- `disable()` + Pauses this periodic callback without destroying it. Safe to call when already disabled. +- `enable()` + Resumes a previously disabled periodic callback. Safe to call when already enabled. ### CallbackCounted @@ -61,9 +65,14 @@ public abstract class CallbackCounted - `abstract function call(thistype cb)` - `isLast() returns boolean` - `getCount() returns int` + The number of this call, counting down: maxCount on the first call and + 1 on the last. Returns maxCount before the first call. - `progress() returns real` - Returns a value between 0 and 1. + Progress through the run as a value between 0 and 1. + Returns 0 if the callback was started with a call count of 0. - `stop()` + Stops the callback. The remaining calls are skipped and the object is + destroyed on the next tick, not immediately. - `callAndCount()` ## Interfaces diff --git a/_doc/stdlib/ref/data/ArrayList.md b/_doc/stdlib/ref/data/ArrayList.md index fa59b95..d661915 100644 --- a/_doc/stdlib/ref/data/ArrayList.md +++ b/_doc/stdlib/ref/data/ArrayList.md @@ -197,3 +197,23 @@ public function ArrayList.join() returns string ``` Joins elements from a string list into one string + +## Constants + +### intComparator + +```wurst +public constant Comparator intComparator = (i1, i2) -> i1 < i2 ? -1 : (i1 > i2 ? 1 : 0) +``` + +### realComparator + +```wurst +public constant Comparator realComparator = (r1, r2) -> r1 < r2 ? -1 : (r1 > r2 ? 1 : 0) +``` + +### stringComparator + +```wurst +public constant Comparator stringComparator = (s1, s2) -> stringCompare(s1, s2) +``` diff --git a/_doc/stdlib/ref/data/HashList.md b/_doc/stdlib/ref/data/HashList.md index 6d3b02d..921e681 100644 --- a/_doc/stdlib/ref/data/HashList.md +++ b/_doc/stdlib/ref/data/HashList.md @@ -57,7 +57,8 @@ public class HashList - `isEmpty() returns bool` Return whether the list is empty - `get(int index) returns T` - Get the element at the given index from this list + Get the element at the given index from this list. + Indices outside [0, size) are not validated and yield the null/zero value. - `has(T elem) returns bool` Return whether the element exists in the list - `hasAt(int index) returns bool` @@ -71,7 +72,9 @@ public class HashList - `staticItr() returns HLIterator` get the static iterator for this list - `removeIf(RemovePredicate predicate)` - Removes the element if the predicates returns true + Removes the element if the predicates returns true. + Single pass compaction - removing through the iterator instead would + shift the tail once per removal, making this O(n^2). - `getRandomElement() returns T` ### HLIterator diff --git a/_doc/stdlib/ref/data/HashMap.md b/_doc/stdlib/ref/data/HashMap.md index 7242435..e0ff01a 100644 --- a/_doc/stdlib/ref/data/HashMap.md +++ b/_doc/stdlib/ref/data/HashMap.md @@ -64,7 +64,9 @@ Iterable generic Table Wrapper - `override function flush()` Remove all data from this map - `override function getAndRemove(K key) returns V` - Retrieves the value saved under the given key and removes it + Retrieves the value saved under the given key and removes it. + super.getAndRemove dispatches back into this class's remove(), which + already drops the key, so no second keys.remove() is needed here. - `iterator() returns HLIterator` Returns an iterator that iterates over the map's keys - `hasKey(K key) returns bool` diff --git a/_doc/stdlib/ref/data/LinkedList.md b/_doc/stdlib/ref/data/LinkedList.md index 883790c..abe22ab 100644 --- a/_doc/stdlib/ref/data/LinkedList.md +++ b/_doc/stdlib/ref/data/LinkedList.md @@ -48,17 +48,19 @@ public class LinkedList It does not add/remove elements internally, only the internal pointers of the list nodes are re-pointed. The other list will be empty, but not destroyed. - `get(int index) returns T` - Returns the element at the specified index + Returns the element at the specified index. + Errors if the index is outside [0, size). - `indexOf(T t) returns int` Returns the index of the specified element or -1 is it doesn't exist - `set(int index, T elem)` - Sets the element at the specified index + Sets the element at the specified index. + Errors if the index is outside [0, size). - `push(T elem)` Adds an element to the end of the list (top of stack, beginning of queue) - `getFirst() returns T` - Returns the first element in the list + Returns the first element in the list, or null if it is empty - `getLast() returns T` - Returns the last element in the list + Returns the last element in the list, or null if it is empty - `dequeue() returns T` Returns and removes the first added Element (FIFO) - `pop() returns T` @@ -101,24 +103,29 @@ public class LinkedList - `updateAll(LinkedListUpdater f)` Updates all elements - `shuffle()` - Performs a Fisher–Yates shuffle on this list + Performs a Fisher-Yates shuffle on this list. + Permutes the elements in place - no nodes are destroyed or reallocated. - `getRandomElement() returns T` - Returns a random element from this list or null, if empty + Returns a random element from this list, or null if it is empty - `addAt(T elem, int index)` - Adds the given element directly behind the element at the given index + Inserts the given element at the given index, shifting the element that + was there (and everything after it) one position to the right. + An index equal to the list's size appends to the end. - `sortWith(Comparator comparator)` Sorts the list according the the comparator using merge sort - `map(MapClosure itr) returns LinkedList` Returns the list obtained by applying the given closure to each element of the original list - `filter(LinkedListPredicate predicate) returns LinkedList` - Returns a new list of the elements that satisfy the predicate + Returns a new list of the elements that satisfy the predicate. + Builds the result directly instead of copying and pruning, so only the + matching elements are ever allocated. - `foldl(Q startValue, FoldClosure predicate) returns Q` 'Folds' this list into a single value of type Q Example int-list sum: `list.foldl(0, (i, q) -> q + i)` - `find(LinkedListPredicate predicate) returns T` Returns the first element that satisfies the predicate, or null if none present - `toString() returns string` - Prints the content of the list + Prints the content of the list. Only meaningful for int-like element types. - `clear()` Removes all elements from the list diff --git a/_doc/stdlib/ref/data/LinkedListModule.md b/_doc/stdlib/ref/data/LinkedListModule.md index c1977ce..93f7034 100644 --- a/_doc/stdlib/ref/data/LinkedListModule.md +++ b/_doc/stdlib/ref/data/LinkedListModule.md @@ -28,7 +28,9 @@ public module LinkedListModule - `construct()` - `static function getFirst() returns thistype` - `getNext() returns thistype` + The next instance, wrapping around to the first one at the end of the list - `getPrev() returns thistype` + The previous instance, wrapping around to the last one at the start of the list - `remove()` - `static function iterator() returns Iterator` An iterator which iterates over all instances of this class diff --git a/_doc/stdlib/ref/data/PriorityQueue.md b/_doc/stdlib/ref/data/PriorityQueue.md new file mode 100644 index 0000000..50eea4f --- /dev/null +++ b/_doc/stdlib/ref/data/PriorityQueue.md @@ -0,0 +1,32 @@ +--- +title: PriorityQueue +layout: stdlibref +category: data +categoryLabel: Data Structures +tags: + - data +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/PriorityQueue.wurst' +generated: true +toc: sections +--- + +A binary heap priority queue. + +The comparator defines priority: a negative result means that the first +value has higher priority, so ArrayList.intComparator creates a min-heap. +Reverse the comparator to create a max-heap. Equal-priority elements are +not stable. + +Adding and removing the highest-priority element are O(log n). Peeking is +O(1). The queue does not support changing an element's priority in place; +remove and re-add it after changing any fields used by the comparator. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/PriorityQueue.wurst)** + +## Classes + +### PriorityQueue + +```wurst +public class PriorityQueue +``` diff --git a/_doc/stdlib/ref/data/SparseSet.md b/_doc/stdlib/ref/data/SparseSet.md new file mode 100644 index 0000000..bff4e8b --- /dev/null +++ b/_doc/stdlib/ref/data/SparseSet.md @@ -0,0 +1,67 @@ +--- +title: SparseSet +layout: stdlibref +category: data +categoryLabel: Data Structures +tags: + - data +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSet.wurst' +generated: true +toc: sections +--- + +A set with O(1) membership checks, insertion, and unordered removal. + +Elements are stored in a dense typed array. The sparse index maps the key +supplied by SparseSetKey to the element's dense index. Keys must be unique +and stable for the lifetime of an element in the set. A key may be reused +after its old value is gone; add() validates the stored value before +accepting the new one. + +Removal swaps the last element into the removed element's slot, so dense +iteration order is not preserved. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSet.wurst)** + +**Re-exports:** `TypeCasting` + +## Classes + +### SparseSet + +```wurst +public class SparseSet +``` + +### UnitSparseSetKey + +```wurst +public class UnitSparseSetKey implements SparseSetKey +``` + +Key provider for unit sets. + +This deliberately uses the native handle identity rather than UnitIndexer +IDs. That matches native groups: membership is not automatically removed +when a unit is deindexed. SparseSet validates the stored unit when a key is +reused, so a new unit cannot silently inherit stale membership. + +## Interfaces + +### SparseSetKey + +```wurst +public interface SparseSetKey +``` + +Supplies the stable, unique integer key used by a SparseSet. + +## Constants + +### UNIT_SPARSE_SET_KEY + +```wurst +public constant SparseSetKey UNIT_SPARSE_SET_KEY = new UnitSparseSetKey() +``` + +Reusable key provider for SparseSet. diff --git a/_doc/stdlib/ref/data/SparseSetBenchmark.md b/_doc/stdlib/ref/data/SparseSetBenchmark.md new file mode 100644 index 0000000..c656c28 --- /dev/null +++ b/_doc/stdlib/ref/data/SparseSetBenchmark.md @@ -0,0 +1,21 @@ +--- +title: SparseSetBenchmark +layout: stdlibref +category: data +categoryLabel: Data Structures +tags: + - data +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSetBenchmark.wurst' +generated: true +toc: sections +--- + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/SparseSetBenchmark.wurst)** + +## Functions + +### startSparseSetBenchmark + +```wurst +public function startSparseSetBenchmark() +``` diff --git a/_doc/stdlib/ref/event/DamageEvent.md b/_doc/stdlib/ref/event/DamageEvent.md index 9e28de9..f5cb2d9 100644 --- a/_doc/stdlib/ref/event/DamageEvent.md +++ b/_doc/stdlib/ref/event/DamageEvent.md @@ -17,7 +17,10 @@ This package provides a light-weight damage detection system with priority-order **IMPORTANT** This package **doesn't** provide protection from cyclic damage. Damage from code **must** be declared by the user using DamageEvent.setNextDamageFromCode() before dealing damage. - If you set damage amount to zero or less in the unreduced listeners, reduced listeners will not fire. + Setting the damage amount to zero or less in the unreduced listeners does **not** skip the reduced + listeners: EVENT_PLAYER_UNIT_DAMAGED still fires and they run with an amount of zero. + (This corrects an older note here which claimed the opposite. Verified in game by check 10 of + package StdlibIngameTests.) if DETECT_NATIVE_ABILITIES is true: ```wurst @@ -36,7 +39,7 @@ If the order of firing of the listeners is important, the user can give a priori DamageEvent.addListener(0) -> print("This fires before.") -If you want to catch the damage instance before it has been reduced by any damage reducing effect (such as armor) you can use the unreduced verions of the listeners: +If you want to catch the damage instance before it has been reduced by any damage reducing effect (such as armor) you can use the unreduced versions of the listeners: DamageEvent.addUnreducedListener() -> print("this fire before any damage reduction") @@ -87,7 +90,7 @@ Each damage instance can have a DamageElement associated to it. DAMAGE_ELEMENT_FIRE = new DamageElement("Fire", colorA(255, 0, 0, 255)) DAMAGE_ELEMENT_WATER = new DamageElement("Water", colorA(0, 0, 255, 255)) - The user can extends from DamageElement to add his own settings. + DamageElement can be extended to carry additional per-element settings. ### DamageEvent @@ -156,4 +159,4 @@ public constant DAMAGE_ELEMENT_ATTACK = new DamageElement("Physical", colorA(223 > 🔧 **Configurable.** Override it in your map's config package. A damage instance can have an element. - DAMAGE_ELEMENT_ATTACK is the defaut element added to any damage instances of DamageType ATTACK + DAMAGE_ELEMENT_ATTACK is the default element added to any damage instances of DamageType ATTACK diff --git a/_doc/stdlib/ref/file/ByteBuffer.md b/_doc/stdlib/ref/file/ByteBuffer.md index cb7d288..82a40c6 100644 --- a/_doc/stdlib/ref/file/ByteBuffer.md +++ b/_doc/stdlib/ref/file/ByteBuffer.md @@ -35,8 +35,13 @@ public class ByteBuffer - `writeInt(int n)` Writes a signed integer into the buffer. - `hasByte() returns bool` + Returns whether at least one unread byte remains. + Compares against the total byte count rather than the internal int index, + so a buffer whose size is an exact multiple of 4 does not report a + phantom trailing byte from the empty write buffer. - `readByte() returns int` - Reads a single unsigned byte from this buffer. The returned value will be in the range [0, 255]. * + Reads a single unsigned byte from this buffer. The returned value will be in the range [0, 255]. + Reading past the end yields 0; guard with hasByte(). * - `readShort() returns int` Reads a single unsigned short from this buffer. The returned value will be in the range [0, 65535]. * - `readInt() returns int` @@ -44,6 +49,8 @@ public class ByteBuffer - `resetRead()` - `getInt(int i) returns int` - `getIntCount() returns int` + Number of ints backing this buffer, counting the partially filled write + buffer as one. An empty buffer therefore reports 1, not 0. - `size() returns int` Returns the number of bytes in the buffer. * - `getByte(int i) returns int` diff --git a/_doc/stdlib/ref/file/FileIO.md b/_doc/stdlib/ref/file/FileIO.md index df7f641..5e8252b 100644 --- a/_doc/stdlib/ref/file/FileIO.md +++ b/_doc/stdlib/ref/file/FileIO.md @@ -29,7 +29,11 @@ public class File - `write(player p, ChunkedString buffer)` - `close()` - `read(player p) returns ChunkedString` + Reads the file's contents. Only the given player actually reads from + disk; every other client gets an empty ChunkedString, so the result is + not synchronised - see the desync warning at the top of this package. - `readAsString(player p) returns string` + Reads the file's contents as one string. Not synchronised - see read(). ## Constants diff --git a/_doc/stdlib/ref/file/SyncSimple.md b/_doc/stdlib/ref/file/SyncSimple.md index 06ce47d..ba72cf2 100644 --- a/_doc/stdlib/ref/file/SyncSimple.md +++ b/_doc/stdlib/ref/file/SyncSimple.md @@ -10,6 +10,10 @@ generated: true toc: sections --- +Generic sync listener for arbitrary types that can be cast to/from int. + Only works for values representable as an int (class instances, handle ids). + The synced object must already be in sync across all clients. + **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/SyncSimple.wurst)** ## Interfaces @@ -64,6 +68,16 @@ public interface BufferSyncListener - `onDataSynced(ChunkedString buffer)` +### AnySyncListener + +```wurst +public interface AnySyncListener +``` + +**Members:** + +- `onDataSynced(T data)` + ## Extension Functions ### bool.sync @@ -90,6 +104,16 @@ public function real.sync(player p, RealSyncListener listener) Syncs a real from the given player. +### player.sync + +```wurst +public function player.sync(T data, AnySyncListener listener) +``` + +Syncs an arbitrary type from the given player. + Only works for values representable as an int handle/index (class instances, handle ids). + The synced object must already be in sync across clients. Listener is destroyed after firing. + ### string.sync ```wurst diff --git a/_doc/stdlib/ref/index.md b/_doc/stdlib/ref/index.md index 84cd99f..42ff60c 100644 --- a/_doc/stdlib/ref/index.md +++ b/_doc/stdlib/ref/index.md @@ -38,12 +38,15 @@ If you are choosing a capability, start with the [standard library overview](/st - [HashSet](/stdlib/ref/data/HashSet.html): Generic set implementation - [LinkedList](/stdlib/ref/data/LinkedList.html): Doubly-linked list implementation that implements all common list, stack and queue operations. - [LinkedListModule](/stdlib/ref/data/LinkedListModule.html): Turns a class into a linked list where each instance knows it's previous +- [PriorityQueue](/stdlib/ref/data/PriorityQueue.html): A binary heap priority queue. +- [SparseSet](/stdlib/ref/data/SparseSet.html): A set with O(1) membership checks, insertion, and unordered removal. +- [SparseSetBenchmark](/stdlib/ref/data/SparseSetBenchmark.html) - [Table](/stdlib/ref/data/Table.html): Wraps a hashtable to provide single key tables ## Closures - [ClosureEvents](/stdlib/ref/closures/ClosureEvents.html): This package is a comfort wrapper around wc3 events, -- [ClosureForGroups](/stdlib/ref/closures/ClosureForGroups.html): Executes the given closure for every unit in this group, +- [ClosureForGroups](/stdlib/ref/closures/ClosureForGroups.html): Executes the given closure for every unit of the given type. - [ClosureFrames](/stdlib/ref/closures/ClosureFrames.html) - [ClosureKeyPresses](/stdlib/ref/closures/ClosureKeyPresses.html) - [ClosureTimers](/stdlib/ref/closures/ClosureTimers.html): Execute an action after a certain time. @@ -73,6 +76,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [Bitwise](/stdlib/ref/math/Bitwise.html): A tuple containing 4 bytes comprising a 4-byte integer. - [BitwiseInit](/stdlib/ref/math/BitwiseInit.html) - [Interpolation](/stdlib/ref/math/Interpolation.html): Linear Interpolation +- [LineGeometry](/stdlib/ref/math/LineGeometry.html) - [Maths](/stdlib/ref/math/Maths.html): Returns the length of the hypotenuse of a right-angle triangle with the - [Matrices](/stdlib/ref/math/Matrices.html): Matrix 2x2 - [Quaternion](/stdlib/ref/math/Quaternion.html): Linear interpolation. @@ -90,7 +94,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [SaveLoadData](/stdlib/ref/file/SaveLoadData.html): Asynchronously loads the data from the file of the given player - [Serializable](/stdlib/ref/file/Serializable.html) - [SQLite](/stdlib/ref/file/SQLite.html) -- [SyncSimple](/stdlib/ref/file/SyncSimple.html) +- [SyncSimple](/stdlib/ref/file/SyncSimple.html): Generic sync listener for arbitrary types that can be cast to/from int. ## Utilities @@ -99,7 +103,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [Colors](/stdlib/ref/util/Colors.html): Mixes two colors, s would be a number 0<=s<=1 that determines - [DialogBox](/stdlib/ref/util/DialogBox.html): DialogBox lets you create dialogs more easily and associate its buttons with closures. - [EffectUtils](/stdlib/ref/util/EffectUtils.html) -- [GameTimer](/stdlib/ref/util/GameTimer.html) +- [GameTimer](/stdlib/ref/util/GameTimer.html): Seconds elapsed since map start. - [GroupUtils](/stdlib/ref/util/GroupUtils.html): The max number of recyclable groups. - [Knockback3](/stdlib/ref/util/Knockback3.html): Use the `Knockback3.add(..)` functions to apply 3D knockback to units. - [MapBounds](/stdlib/ref/util/MapBounds.html) @@ -134,7 +138,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [Group](/stdlib/ref/_handles/Group.html): Use this group for your non-nested group enum calls - [Hashtable](/stdlib/ref/_handles/Hashtable.html) - [Image](/stdlib/ref/_handles/Image.html): ImageLayer influences the order in which the images are drawn above one another -- [Integer](/stdlib/ref/_handles/Integer.html) +- [Integer](/stdlib/ref/_handles/Integer.html): Returns this int to the power of the argument int. - [Item](/stdlib/ref/_handles/Item.html): Updates the item's name, tooltip, extendedtooltip, description or icon for the specific player. - [Lightning](/stdlib/ref/_handles/Lightning.html) - [Multiboard](/stdlib/ref/_handles/Multiboard.html) diff --git a/_doc/stdlib/ref/math/Angle.md b/_doc/stdlib/ref/math/Angle.md index dddc560..148be14 100644 --- a/_doc/stdlib/ref/math/Angle.md +++ b/_doc/stdlib/ref/math/Angle.md @@ -66,7 +66,7 @@ interpret this real as an angle given in degrees public function real.fromRad() returns angle ``` -interpret this real as an angle given in degrees +interpret this real as an angle given in radians ### int.fromRad @@ -74,7 +74,7 @@ interpret this real as an angle given in degrees public function int.fromRad() returns angle ``` -interpret this int as an angle given in degrees +interpret this int as an angle given in radians ### int.asAngleRadians diff --git a/_doc/stdlib/ref/math/Bitwise.md b/_doc/stdlib/ref/math/Bitwise.md index 927e30d..dcbee4a 100644 --- a/_doc/stdlib/ref/math/Bitwise.md +++ b/_doc/stdlib/ref/math/Bitwise.md @@ -118,7 +118,8 @@ Input string may contain whitespace for padding. public function int.toBitString() returns string ``` -Produces a bistring from this integer. +Produces a bitstring from this integer. Zero yields "0", and negative +values yield their full 32 bit two's complement representation. * ### int.not8 @@ -222,6 +223,8 @@ public function int.shiftl(int amount) returns int 32-bit SHIFTL (<<) number.shiftl(amount) equivalent to (number << amount) +Bits shifted past bit 31 are discarded, so a shift of 32 yields 0. +`amount` must be in [0, 32]; other values read outside the shift table. * ### int.shiftr @@ -230,7 +233,13 @@ number.shiftl(amount) equivalent to (number << amount) public function int.shiftr(int amount) returns int ``` -32-bit SHIFTR (>>) +32-bit logical SHIFTR (>>>) -number.shiftr(amount) equivalent to (number >> amount) +number.shiftr(amount) equivalent to (number >>> amount): the sign bit is +shifted in as data rather than replicated, so negative inputs produce a +positive result for any amount > 0. + +`amount` must be in [0, 31] - one less than shiftl accepts. The shift table +holds 2^32 as 0 after wrapping, so an amount of 32 divides by zero rather +than returning 0. Guard the call if the amount is computed. * diff --git a/_doc/stdlib/ref/math/Interpolation.md b/_doc/stdlib/ref/math/Interpolation.md index c606795..376ad97 100644 --- a/_doc/stdlib/ref/math/Interpolation.md +++ b/_doc/stdlib/ref/math/Interpolation.md @@ -76,7 +76,9 @@ This function returns the derivate of the 4-Point-Bezier curve on certain point. public function hermite(real start, real stop, real tangent1, real tangent2, real s) returns real ``` -Hermite Interpolation +Cubic Hermite interpolation between `start` and `stop` for s in [0, 1], + with `tangent1` and `tangent2` as the derivatives at s = 0 and s = 1. + The basis is h00 = 2s^3-3s^2+1, h10 = s^3-2s^2+s, h01 = -2s^3+3s^2, h11 = s^3-s^2. ### inTan diff --git a/_doc/stdlib/ref/math/LineGeometry.md b/_doc/stdlib/ref/math/LineGeometry.md new file mode 100644 index 0000000..79a735b --- /dev/null +++ b/_doc/stdlib/ref/math/LineGeometry.md @@ -0,0 +1,66 @@ +--- +title: LineGeometry +layout: stdlibref +category: math +categoryLabel: Math +tags: + - math +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/math/LineGeometry.wurst' +generated: true +toc: sections +--- + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/math/LineGeometry.wurst)** + +## Tuples + +### lineFormular + +```wurst +public tuple lineFormular(real m, real b) +``` + +Line formula tuple representing y = m*x + b where m is slope and b is y-intercept + +## Extension Functions + +### real.getYOnLine + +```wurst +public function real.getYOnLine(lineFormular line) returns real +``` + +Returns f(x) = m*x + b for a given x value on a line + +### real.getXOnLine + +```wurst +public function real.getXOnLine(lineFormular line) returns real +``` + +Returns the x value for a given y on a line: x = (y - b) / m + +### vec2.getLineFormular + +```wurst +public function vec2.getLineFormular(vec2 p) returns lineFormular +``` + +Returns the line formula for the line passing through this point and p. + WARNING: Undefined behavior for vertical lines (p.x == this.x causes division by zero). + +### lineFormular.getParallelLineWithOrthogonalDistance + +```wurst +public function lineFormular.getParallelLineWithOrthogonalDistance(real d) returns lineFormular +``` + +Returns a parallel line with orthogonal distance d from the original line + +### vec2.getOrthogonalSidePoint + +```wurst +public function vec2.getOrthogonalSidePoint(lineFormular line, real d) returns vec2 +``` + +Returns a point on the side of a line at orthogonal distance d diff --git a/_doc/stdlib/ref/math/Maths.md b/_doc/stdlib/ref/math/Maths.md index 9aa1beb..a86e775 100644 --- a/_doc/stdlib/ref/math/Maths.md +++ b/_doc/stdlib/ref/math/Maths.md @@ -99,7 +99,7 @@ PI constant ### PI2 ```wurst -public constant real PI2 = 6.28318 +public constant real PI2 = 6.283185307 ``` PI * 2 constant diff --git a/_doc/stdlib/ref/math/Vectors.md b/_doc/stdlib/ref/math/Vectors.md index fca2fb6..bdfdb57 100644 --- a/_doc/stdlib/ref/math/Vectors.md +++ b/_doc/stdlib/ref/math/Vectors.md @@ -88,7 +88,7 @@ Operator public function vec2.op_mult(vec2 v) returns vec2 ``` -dot product Operator +Operator, component-wise (Hadamard) product. For the dot product use vec2.dot ### vec2.op_divReal @@ -339,7 +339,7 @@ Operator public function real.op_mult(vec3 v) returns vec3 ``` -dot Operator +Operator, scales the vector by this scalar ### vec3.add @@ -379,7 +379,9 @@ Rotate this vector around an axis public function vec3.setLengthSq(real lengthSq) returns vec3 ``` -Sets the length of the given Vector +Returns this vector rescaled so that its *squared* length equals the given + value. Scaling by lengthSq/currentSq would give a squared length of + lengthSq^2/currentSq, so the factor has to be the square root of the ratio. ### vec3.setLength @@ -435,7 +437,18 @@ Convert a vec3 to a vec2 (z-coordinate gets removed) public function vec3.inRange(vec3 v2, real radius) returns boolean ``` -Is this vector inside the given circle +Is this vector inside the given circle. Only the x and y coordinates are + compared - the height difference is ignored. Use inRange3d for a spherical + test that includes z. + +### vec3.inRange3d + +```wurst +public function vec3.inRange3d(vec3 v2, real radius) returns boolean +``` + +Is this vector inside the given sphere, taking the z coordinate into + account. Compare vec3.inRange, which only compares x and y. ### vec3.distanceTo diff --git a/_doc/stdlib/ref/util/Colors.md b/_doc/stdlib/ref/util/Colors.md index 42cc3f3..01b2dce 100644 --- a/_doc/stdlib/ref/util/Colors.md +++ b/_doc/stdlib/ref/util/Colors.md @@ -285,6 +285,9 @@ public constant COLOR_WHITE = colorA(255,255,255,255) public constant COLOR_BLACK = colorA(0,0,0,0) ``` +Black with alpha 0, i.e. fully transparent. COLOR_BLACK_STR therefore + renders text invisible - use colorA(0, 0, 0, 255) for opaque black. + ### COLOR_GOLD ```wurst diff --git a/_doc/stdlib/ref/util/GameTimer.md b/_doc/stdlib/ref/util/GameTimer.md index ae939f3..2a2dab2 100644 --- a/_doc/stdlib/ref/util/GameTimer.md +++ b/_doc/stdlib/ref/util/GameTimer.md @@ -10,6 +10,14 @@ generated: true toc: sections --- +Seconds elapsed since map start. + +Caveat for @Test code: the compiletime interpreter backs this with the +wall clock, so it returns a unix epoch timestamp (~1.7e9). At that +magnitude a 32 bit real only resolves ~128 second steps, so instants built +from smaller offsets are indistinguishable from instantNow() there. Build +instants explicitly, e.g. instant(10.), when unit testing package Time. + **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/GameTimer.wurst)** ## Functions diff --git a/_doc/stdlib/ref/util/GroupUtils.md b/_doc/stdlib/ref/util/GroupUtils.md index 45158a2..871d00c 100644 --- a/_doc/stdlib/ref/util/GroupUtils.md +++ b/_doc/stdlib/ref/util/GroupUtils.md @@ -45,6 +45,32 @@ Recycles a group if it is created through GroupUtils, otherwise just destroys it public function group.recyclableIterator() returns group ``` +Copies this group's units into a freshly acquired recyclable group and + returns it, so the copy can be iterated while the original is modified. + The caller owns the result and must call .release() on it. + + Not re-entrant: the copy is staged through a single package global, so this + must not be called again from inside an iteration over its own result. + +### group.getClosestUnit + +```wurst +public function group.getClosestUnit(vec2 pos) returns unit +``` + +Returns the closest unit in this group to the given position. + Returns null if the group is empty. + +### group.filterAliveUnits + +```wurst +public function group.filterAliveUnits(unit mustBeEnemyOf, int ownerId) returns group +``` + +Filters this group to include only alive units, optionally filtering by allegiance and owner. + mustBeEnemyOf: If not null, only units that are enemies of this unit are kept. Pass null to ignore allegiance. + ownerId: If not -1, only units owned by this player ID are kept. Pass -1 to ignore owner. + ## Constants ### GROUP_NUMBER_LIMIT diff --git a/_doc/stdlib/ref/util/Knockback3.md b/_doc/stdlib/ref/util/Knockback3.md index 0c1085d..f5c190f 100644 --- a/_doc/stdlib/ref/util/Knockback3.md +++ b/_doc/stdlib/ref/util/Knockback3.md @@ -52,16 +52,29 @@ public class Knockback3 Apply a knockback vector to unit u. `velocity` is initial speed in units per second. `groundAngle` and `airAngle` are the direction and trajectory parameters, respectively. Example: + + ```wurst + Knockback3.add(u, 1000., 0 .fromDeg(), 45 .fromDeg()) + ``` - `static function add(unit u, vec2 target, real groundSpeed)` Apply a knockback vector to unit u. If the unit is stopped, this vector will throw the unit to the position at vec2 `target`. Along the XY-plane, the unit will move `groundSpeed` units per second. Note that the more vertical angle will always be used from the pair of possible trajectories. Example: + + ```wurst + Knockback3.add(caster, getSpellTargetPos(), 500.) + ``` - `static function setVel(unit u, real velocity, angle groundAngle, angle airAngle)` Setter for the knockback vector on unit u. If the unit is not already tracked, this has the same behavior as `add`. - `static function getVel(unit u) returns vec3` - Getter for the knockback vector on unit u. If the unit is not already tracked, returns (0, 0, 0). + Getter for the knockback vector on unit u, as a per-tick displacement + (speed * ANIMATION_PERIOD) - note that `add` and `setVel` take units per + *second*. Returns (0, 0, 0) if the unit is not tracked. +- `static function getVelPerSecond(unit u) returns vec3` + Getter for the knockback velocity on unit u in units per second, i.e. in + the same units that `add` and `setVel` accept. - `static function forget(unit u)` Stop tracking unit u. If the unit is middair it will simply stop moving. If the unit is already untracked, nothing happens. diff --git a/_doc/stdlib/ref/util/Printing.md b/_doc/stdlib/ref/util/Printing.md index 93955f7..978599c 100644 --- a/_doc/stdlib/ref/util/Printing.md +++ b/_doc/stdlib/ref/util/Printing.md @@ -31,7 +31,7 @@ public class Log - `static function warn(string msg)` Prints a warning logmessage - `static function error(string msg)` - Prints a warning logmessage + Prints an error logmessage - `static function setLevel(Loglevel lvl)` ## Enums @@ -94,7 +94,7 @@ public function printLog(Loglevel loglvl, string msg) > 🔧 **Configurable.** Override it in your map's config package. -Prints a special motification-message +Prints a special notification-message ### printLog diff --git a/_doc/stdlib/ref/util/StringUtils.md b/_doc/stdlib/ref/util/StringUtils.md index f2dc6b6..5b648ee 100644 --- a/_doc/stdlib/ref/util/StringUtils.md +++ b/_doc/stdlib/ref/util/StringUtils.md @@ -11,8 +11,10 @@ toc: sections --- Returns the width of the string. - Only accounts for single byte (latin) characters, multibyte characters - contribute no width. + Only meaningful for single byte (latin) characters. Each byte of a + multibyte (non-latin) character is looked up individually and falls back to + the width of a space, so the result for non-latin text is an approximation + rather than a true width. **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/StringUtils.wurst)** @@ -160,7 +162,9 @@ Custom Function which can split strings and runs callback for each string. public function string.isNumber() returns bool ``` -Checks whether a string is a number or not. +Checks whether a string is a decimal number: an optional leading "-", + at least one digit, and at most one decimal point. + "", "-", "." and "-." are not numbers. ### string.isValidDescription diff --git a/_doc/stdlib/ref/util/Time.md b/_doc/stdlib/ref/util/Time.md index 15931e5..8ca31e8 100644 --- a/_doc/stdlib/ref/util/Time.md +++ b/_doc/stdlib/ref/util/Time.md @@ -326,7 +326,7 @@ Provides duration until an instant. Convenience for the negative of durationSinc public function instant.isOlderThan(instant other) returns bool ``` -Instant > instant ? +True if this instant happened before `other`. ### instant.isNewerThan @@ -334,7 +334,7 @@ Instant > instant ? public function instant.isNewerThan(instant other) returns bool ``` -Instant < instant ? +True if this instant happens after `other`. ### duration.greaterThan @@ -374,7 +374,7 @@ Convenience for checking if an instant comes before instantNow. public function duration.displayVerbose() returns string ``` -Tranform a duration to a verbose string. Example: +Transform a duration to a verbose string. Example: 61..seconds().displayVerbose() ```wurst @@ -387,7 +387,7 @@ Tranform a duration to a verbose string. Example: public function duration.display(string prefix) returns string ``` -Tranform a duration to a short string. Example: +Transform a duration to a short string. Example: 61..minutes().display("T-") ```wurst diff --git a/_doc/stdlib/ref/util/TimerUtils.md b/_doc/stdlib/ref/util/TimerUtils.md index 15b614a..86f45cd 100644 --- a/_doc/stdlib/ref/util/TimerUtils.md +++ b/_doc/stdlib/ref/util/TimerUtils.md @@ -41,13 +41,15 @@ public module TimedLoop - `abstract function onTimedLoop()` - `getPeriod() returns real` Returns the period of the timed loop. - Ovewrite this to set a custom period + Overwrite this to set a custom period. It is read once, when the first + instance of this class starts its loop. - `stopTimedLoop()` Stops the periodic update of this object. - `stopTimedLoopAndDestroy()` Stops the periodic update and destroys the object. - `startTimedLoop()` - Starts the periodic updates for this object + Starts the periodic updates for this object. + Calling this on an already running instance has no effect. ## Functions