diff --git a/_data/stdlib_index.json b/_data/stdlib_index.json index 8cb0fcc..8c3a3e8 100644 --- a/_data/stdlib_index.json +++ b/_data/stdlib_index.json @@ -112352,6 +112352,37 @@ } ] }, + { + "package": "IntMap", + "category": "data", + "categoryLabel": "Data Structures", + "sourcePath": "wurst/data/IntMap.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/IntMap.wurst", + "summary": "O(1) integer-keyed map with compiler-specialized value storage.\n\nJASS hashtables use integer child keys, so fixing the key type avoids an artificial generic\nhash adapter while `V:` keeps strings, reals, booleans, handles, tuples, and class references\nin typed arrays. Removal is unordered. The map does not own stored values.", + "summaryFirstLine": "O(1) integer-keyed map with compiler-specialized value storage.", + "tags": [ + "data" + ], + "imports": [], + "entities": [ + { + "kind": "class", + "name": "IntMap", + "typeParams": "", + "receiver": null, + "signature": "public class IntMap", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 13 + } + ] + }, { "package": "LinkedList", "category": "data", @@ -114119,6 +114150,38 @@ "members": [], "enumMembers": [], "line": 155 + }, + { + "kind": "class", + "name": "DestructableSparseSetKey", + "typeParams": "", + "receiver": null, + "signature": "public class DestructableSparseSetKey implements SparseSetKey", + "doc": "Key provider for destructable sets.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 158 + }, + { + "kind": "constant", + "name": "DESTRUCTABLE_SPARSE_SET_KEY", + "typeParams": "", + "receiver": null, + "signature": "public constant SparseSetKey DESTRUCTABLE_SPARSE_SET_KEY = new DestructableSparseSetKey()", + "doc": "Reusable key provider for SparseSet.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 163 } ] }, @@ -117020,7 +117083,7 @@ "typeParams": "", "receiver": "timer", "signature": "public function timer.doPeriodically(real time, CallbackPeriodic cb) returns CallbackPeriodic", - "doc": "Execute an action periodically.\n\tThe callback has to be destroyed manually.\n\tMust be used on a timer acquired with `getTimer()`\n\n\tExample use:\n\t| someTimer.doPeriodically(0.5) cb ->\n\t|\t if i > 10\n\t|\t\tdestroy cb", + "doc": "Execute an action periodically.\n\tThe callback has to be destroyed manually.\n\tMust be used on a timer acquired with `getTimer()`\n\n\tExample use:\n\t| someTimer.doPeriodically(0.5) (_) ->\n\t|\t if i > 10\n\t|\t\tdestroy it", "deprecated": { "flag": false, "message": null @@ -117036,7 +117099,7 @@ "typeParams": "", "receiver": null, "signature": "public function doPeriodically(real time, CallbackPeriodic cb) returns CallbackPeriodic", - "doc": "Execute an action periodically.\n\tThe callback has to be destroyed manually.\n\n\tExample use:\n\t| doPeriodically(0.5) cb ->\n\t|\t if i > 10\n\t|\t\tdestroy cb", + "doc": "Execute an action periodically.\n\tThe callback has to be destroyed manually.\n\n\tExample use:\n\t| doPeriodically(0.5) (_) ->\n\t|\t if i > 10\n\t|\t\tdestroy it", "deprecated": { "flag": false, "message": null @@ -117052,7 +117115,7 @@ "typeParams": "", "receiver": "timer", "signature": "public function timer.doPeriodicallyCounted(real time, int callAmount, CallbackCounted cb) returns CallbackCounted", - "doc": "execute an action periodically, with a limited amount of calls\n\tThe callback object is destroyed after the action has been executed callAmount times.\n\tMust be used on a timer acquired with `getTimer()`\n\n\tExample use:\n\t| someTimer.doPeriodicallyCounted(0.5, 100) cb ->\n\t|\t doSomething()", + "doc": "execute an action periodically, with a limited amount of calls\n\tThe callback object is destroyed after the action has been executed callAmount times.\n\tMust be used on a timer acquired with `getTimer()`\n\n\tExample use:\n\t| someTimer.doPeriodicallyCounted(0.5, 100) (_) ->\n\t|\t doSomething()", "deprecated": { "flag": false, "message": null @@ -117068,7 +117131,7 @@ "typeParams": "", "receiver": null, "signature": "public function doPeriodicallyCounted(real time, int callAmount, CallbackCounted cb) returns CallbackCounted", - "doc": "execute an action periodically, with a limited amount of calls\n\tThe callback object is destroyed after the action has been executed callAmount times.\n\n\tExample use:\n\t| doPeriodicallyCounted(0.5, 100) cb ->\n\t|\t doSomething()", + "doc": "execute an action periodically, with a limited amount of calls\n\tThe callback object is destroyed after the action has been executed callAmount times.\n\n\tExample use:\n\t| doPeriodicallyCounted(0.5, 100) (_) ->\n\t|\t doSomething()", "deprecated": { "flag": false, "message": null @@ -117468,6 +117531,53 @@ } ] }, + { + "package": "SpatialIndexForDestructables", + "category": "closures", + "categoryLabel": "Closures", + "sourcePath": "wurst/closures/SpatialIndexForDestructables.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/SpatialIndexForDestructables.wurst", + "summary": "", + "summaryFirstLine": "", + "tags": [ + "closures" + ], + "imports": [], + "entities": [ + { + "kind": "function", + "name": "destructablesInRect", + "typeParams": "", + "receiver": null, + "signature": "public function destructablesInRect(rect area) returns SparseSet", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 17 + }, + { + "kind": "function", + "name": "destructablesInRange", + "typeParams": "", + "receiver": null, + "signature": "public function destructablesInRange(vec2 center, real range) returns SparseSet", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 27 + } + ] + }, { "package": "SpatialIndexForUnits", "category": "closures", @@ -117495,7 +117605,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 23 + "line": 24 }, { "kind": "function", @@ -117511,7 +117621,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 27 + "line": 28 }, { "kind": "function", @@ -117527,7 +117637,23 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 34 + "line": 35 + }, + { + "kind": "function", + "name": "unitsInRect", + "typeParams": "", + "receiver": null, + "signature": "public function unitsInRect(rect area) returns SparseSet", + "doc": "Returns units matching GroupEnumUnitsInRect semantics for the given rect.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 45 }, { "kind": "function", @@ -117535,7 +117661,7 @@ "typeParams": "", "receiver": null, "signature": "public function unitsOfPlayer(player owner) returns SparseSet", - "doc": "Returns currently indexed units owned by owner.", + "doc": "Returns currently indexed units owned by owner. This is a linear registry scan; per-player\n\tsecondary sets are intentionally not maintained in this first iteration.", "deprecated": { "flag": false, "message": null @@ -117543,7 +117669,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 44 + "line": 52 } ] }, @@ -120639,7 +120765,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 78 + "line": 77 }, { "kind": "function", @@ -120655,7 +120781,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 82 + "line": 81 }, { "kind": "function", @@ -120671,7 +120797,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 86 + "line": 85 }, { "kind": "function", @@ -120687,7 +120813,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 90 + "line": 89 }, { "kind": "function", @@ -120703,7 +120829,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 96 + "line": 95 }, { "kind": "function", @@ -120719,7 +120845,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 102 + "line": 101 }, { "kind": "function", @@ -120735,7 +120861,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 106 + "line": 105 }, { "kind": "function", @@ -120751,7 +120877,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 110 + "line": 109 }, { "kind": "function", @@ -120767,7 +120893,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 114 + "line": 113 }, { "kind": "function", @@ -120783,7 +120909,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 121 + "line": 120 }, { "kind": "function", @@ -120799,7 +120925,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 125 + "line": 124 }, { "kind": "function", @@ -120815,7 +120941,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 135 + "line": 134 }, { "kind": "function", @@ -120831,7 +120957,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 139 + "line": 138 }, { "kind": "function", @@ -120847,7 +120973,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 143 + "line": 142 }, { "kind": "function", @@ -120863,7 +120989,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 147 + "line": 146 }, { "kind": "function", @@ -120879,7 +121005,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 151 + "line": 150 } ], "enumMembers": [], @@ -127745,7 +127871,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 62 + "line": 104 } ] }, @@ -127829,271 +127955,123 @@ ] }, { - "package": "SyncSimple", + "package": "StructuredSerialization", "category": "file", "categoryLabel": "File & Network", - "sourcePath": "wurst/file/SyncSimple.wurst", - "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/SyncSimple.wurst", - "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.", + "sourcePath": "wurst/file/StructuredSerialization.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerialization.wurst", + "summary": "Standard tuple codecs.\n\nField names passed to these codecs are converted by `FieldSerializationWriter` to fixed-width\nnumeric IDs; names are not stored in the save string. Classes and tuples therefore use the same\nwire representation and migration rules. The compiler does not derive persistence IDs from field\nannotations; serialization metadata deliberately remains owned by this library.\n\nCustom tuples need three overloads because tuples cannot implement `FieldSerializable`. The field\nintrinsics keep the codec concise and support mixed component types through overload resolution:\n\n```\ntuple InventorySlot(int itemId, int charges)\n\npublic function FieldSerializationWriter.write(string name, InventorySlot value)\nlet child = new FieldSerializationWriter(1, this.getIntegrityKey())\nwurstForFields(value, (fieldName, fieldValue) -> child.write(fieldName, fieldValue))\nthis.writeObject(name, child)\n\npublic function FieldSerializationReader.read(string name, InventorySlot oldValue) returns InventorySlot\nlet child = this.readObject(name)\nvar result = oldValue\nif child.isValid()\n\twurstMapFields(result, (fieldName, fieldValue) -> fieldValue.readSerializedField(child, fieldName))\ndestroy child\nreturn result\n\npublic function InventorySlot.readSerializedField(FieldSerializationReader reader, string name) returns InventorySlot\nreturn reader.read(name, this)\n\nclass InventoryState implements FieldSerializable\nuse FieldSerializableLifecycle\nInventorySlot slot = InventorySlot(0, 0)\n\noverride function writeSerializedFields(FieldSerializationWriter writer)\n\twurstForFields((fieldName, fieldValue) -> writer.write(fieldName, fieldValue))\n\noverride function readSerializedFields(FieldSerializationReader reader)\n\twurstMapFields((fieldName, fieldValue) -> fieldValue.readSerializedField(reader, fieldName))\n```\n\n`SerializableFields` can automatically use codecs declared by `StructuredSerialization`. For\npackage-local codecs, use `FieldSerializableLifecycle` and keep the two intrinsic mapping methods\nin the same package as the overloads, as above. Nested custom tuples then compose once each tuple\ntype provides the three overloads. Keep component names stable. For tuple-specific schema changes,\nincrement the child writer's schema version and call `child.renameField(oldName, newName)` before\n`wurstMapFields` when reading older versions.", + "summaryFirstLine": "Standard tuple codecs.", "tags": [ "file" ], - "imports": [], + "imports": [ + "StructuredSerializationCore" + ], "entities": [ { - "kind": "constant", - "name": "DEFAULT_PREFIX", - "typeParams": "", - "receiver": null, - "signature": "public constant DEFAULT_PREFIX = \"S\"", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": true, - "members": [], - "enumMembers": [], - "line": 20 - }, - { - "kind": "constant", - "name": "LAST_CHUNK_PREFIX", - "typeParams": "", - "receiver": null, - "signature": "public constant LAST_CHUNK_PREFIX = \"T\"", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": true, - "members": [], - "enumMembers": [], - "line": 21 - }, - { - "kind": "constant", - "name": "SYNC_IN_REPLAYS", + "kind": "extension-function", + "name": "write", "typeParams": "", - "receiver": null, - "signature": "public constant SYNC_IN_REPLAYS = false", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, vec2 value)", "doc": "", "deprecated": { "flag": false, "message": null }, - "configurable": true, + "configurable": false, "members": [], "enumMembers": [], - "line": 22 + "line": 59 }, { - "kind": "interface", - "name": "BoolSyncListener", + "kind": "extension-function", + "name": "read", "typeParams": "", - "receiver": null, - "signature": "public interface BoolSyncListener", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, vec2 oldValue) returns vec2", "doc": "", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [ - { - "kind": "function", - "name": "onDataSynced", - "typeParams": "", - "receiver": null, - "signature": "function onDataSynced(bool data)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 26 - } - ], + "members": [], "enumMembers": [], - "line": 25 + "line": 65 }, { - "kind": "interface", - "name": "IntSyncListener", + "kind": "extension-function", + "name": "readSerializedField", "typeParams": "", - "receiver": null, - "signature": "public interface IntSyncListener", + "receiver": "vec2", + "signature": "public function vec2.readSerializedField(FieldSerializationReader reader, string name) returns vec2", "doc": "", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [ - { - "kind": "function", - "name": "onDataSynced", - "typeParams": "", - "receiver": null, - "signature": "function onDataSynced(int data)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 29 - } - ], + "members": [], "enumMembers": [], - "line": 28 + "line": 71 }, { - "kind": "interface", - "name": "RealSyncListener", + "kind": "extension-function", + "name": "write", "typeParams": "", - "receiver": null, - "signature": "public interface RealSyncListener", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, vec3 value)", "doc": "", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [ - { - "kind": "function", - "name": "onDataSynced", - "typeParams": "", - "receiver": null, - "signature": "function onDataSynced(real data)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 32 - } - ], + "members": [], "enumMembers": [], - "line": 31 + "line": 74 }, { - "kind": "interface", - "name": "StringSyncListener", + "kind": "extension-function", + "name": "read", "typeParams": "", - "receiver": null, - "signature": "public interface StringSyncListener", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, vec3 oldValue) returns vec3", "doc": "", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [ - { - "kind": "function", - "name": "onDataSynced", - "typeParams": "", - "receiver": null, - "signature": "function onDataSynced(string data)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 35 - } - ], + "members": [], "enumMembers": [], - "line": 34 + "line": 81 }, { - "kind": "interface", - "name": "BufferSyncListener", + "kind": "extension-function", + "name": "readSerializedField", "typeParams": "", - "receiver": null, - "signature": "public interface BufferSyncListener", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [ - { - "kind": "function", - "name": "onDataSynced", - "typeParams": "", - "receiver": null, - "signature": "function onDataSynced(ChunkedString buffer)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 38 - } - ], - "enumMembers": [], - "line": 37 - }, - { - "kind": "interface", - "name": "AnySyncListener", - "typeParams": "", - "receiver": null, - "signature": "public interface AnySyncListener", + "receiver": "vec3", + "signature": "public function vec3.readSerializedField(FieldSerializationReader reader, string name) returns vec3", "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 - } - ], + "members": [], "enumMembers": [], - "line": 43 + "line": 87 }, { "kind": "extension-function", - "name": "sync", + "name": "write", "typeParams": "", - "receiver": "bool", - "signature": "public function bool.sync(player p, BoolSyncListener listener)", - "doc": "Syncs a bool from the given player.", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, angle value)", + "doc": "", "deprecated": { "flag": false, "message": null @@ -128101,15 +128079,15 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 49 + "line": 90 }, { "kind": "extension-function", - "name": "sync", + "name": "read", "typeParams": "", - "receiver": "int", - "signature": "public function int.sync(player p, IntSyncListener listener)", - "doc": "Syncs an int from the given player.", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, angle oldValue) returns angle", + "doc": "", "deprecated": { "flag": false, "message": null @@ -128117,15 +128095,15 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 55 + "line": 95 }, { "kind": "extension-function", - "name": "sync", + "name": "readSerializedField", "typeParams": "", - "receiver": "real", - "signature": "public function real.sync(player p, RealSyncListener listener)", - "doc": "Syncs a real from the given player.", + "receiver": "angle", + "signature": "public function angle.readSerializedField(FieldSerializationReader reader, string name) returns angle", + "doc": "", "deprecated": { "flag": false, "message": null @@ -128133,15 +128111,15 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 61 + "line": 101 }, { "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.", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, color value)", + "doc": "", "deprecated": { "flag": false, "message": null @@ -128149,15 +128127,15 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 69 + "line": 104 }, { "kind": "extension-function", - "name": "sync", + "name": "read", "typeParams": "", - "receiver": "string", - "signature": "public function string.sync(player p, StringSyncListener listener)", - "doc": "Syncs a single string from the given player.", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, color oldValue) returns color", + "doc": "", "deprecated": { "flag": false, "message": null @@ -128165,45 +128143,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 76 + "line": 111 }, { "kind": "extension-function", - "name": "sync", + "name": "readSerializedField", "typeParams": "", - "receiver": "ChunkedString", - "signature": "public function ChunkedString.sync(player p, BufferSyncListener listener)", - "doc": "Syncs a chunked string from the given player.", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 83 - } - ] - }, - { - "package": "Board", - "category": "util", - "categoryLabel": "Utilities", - "sourcePath": "wurst/util/Board.wurst", - "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/Board.wurst", - "summary": "This Board library allows you to create a simple multi board with dynamic cell values.\n 1. Create a board\n `let board = new Board(\"myBoard\", 0.02)`\n\n 2. Define columns. The second parameter is width relative to board width.\n `board.columns(asList(new BoardColumn(\"Player\", 0.7), new BoardColumn(COLOR_GOLD.toColorString() + \"Kills\", 0.3)))`\n\n 3. Add rows and cells\n `let killcount = dynamicCell(0, i -> i.toString())\n board.addRow()\n ..addCell(\"My Name\")\n ..addDynamic(killcount)`\n\n 4. Show board\n `board.show()`\n\n 5. Update dynamic value\n `killcount.updateValue(killcount.value + 1)`", - "summaryFirstLine": "This Board library allows you to create a simple multi board with dynamic cell values.", - "tags": [ - "util" - ], - "imports": [], - "entities": [ - { - "kind": "function", - "name": "dynamicCellIcon", - "typeParams": "", - "receiver": null, - "signature": "public function dynamicCellIcon(string icon, DynamicCellValue observer) returns DynamicCellValue", + "receiver": "color", + "signature": "public function color.readSerializedField(FieldSerializationReader reader, string name) returns color", "doc": "", "deprecated": { "flag": false, @@ -128212,14 +128159,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 25 + "line": 117 }, { - "kind": "function", - "name": "dynamicCell", - "typeParams": "", - "receiver": null, - "signature": "public function dynamicCell(T defaultValue, DynamicCellValue observer) returns DynamicCellValue", + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, colorA value)", "doc": "", "deprecated": { "flag": false, @@ -128228,14 +128175,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 29 + "line": 120 }, { - "kind": "class", - "name": "DynamicCellValue", - "typeParams": "", - "receiver": null, - "signature": "public abstract class DynamicCellValue", + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, colorA oldValue) returns colorA", "doc": "", "deprecated": { "flag": false, @@ -128244,14 +128191,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 33 + "line": 128 }, { - "kind": "class", - "name": "BoardColumn", + "kind": "extension-function", + "name": "readSerializedField", "typeParams": "", - "receiver": null, - "signature": "public class BoardColumn", + "receiver": "colorA", + "signature": "public function colorA.readSerializedField(FieldSerializationReader reader, string name) returns colorA", "doc": "", "deprecated": { "flag": false, @@ -128260,14 +128207,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 58 + "line": 134 }, { - "kind": "class", - "name": "BoardCell", + "kind": "extension-function", + "name": "write", "typeParams": "", - "receiver": null, - "signature": "public class BoardCell", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, colorHSV value)", "doc": "", "deprecated": { "flag": false, @@ -128276,14 +128223,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 74 + "line": 137 }, { - "kind": "class", - "name": "BoardRow", + "kind": "extension-function", + "name": "read", "typeParams": "", - "receiver": null, - "signature": "public class BoardRow", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, colorHSV oldValue) returns colorHSV", "doc": "", "deprecated": { "flag": false, @@ -128292,14 +128239,14 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 107 + "line": 144 }, { - "kind": "class", - "name": "Board", + "kind": "extension-function", + "name": "readSerializedField", "typeParams": "", - "receiver": null, - "signature": "public class Board", + "receiver": "colorHSV", + "signature": "public function colorHSV.readSerializedField(FieldSerializationReader reader, string name) returns colorHSV", "doc": "", "deprecated": { "flag": false, @@ -128308,44 +128255,1654 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 144 - } - ] - }, - { - "package": "Cinematic", - "category": "util", - "categoryLabel": "Utilities", - "sourcePath": "wurst/util/Cinematic.wurst", - "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/Cinematic.wurst", - "summary": "Create a cinematic by composing cinematic sequences:\n\nlet cine = new Cinematic(\nasList(\n Cinematic.fadeOutSeq(0.5.seconds()),\n Cinematic.snapCameraPosSeq(ZERO2),\n Cinematic.fadeInSeq(1..seconds()),\n () -> begin\n print(\"Cinematic!\")\n return 5..seconds()\n end,\n Cinematic.fadeOutSeq(0.5.seconds())\n),\n// This final cinematic seq is always run, even if cinematic is skipped. Use this for cleanup.\n() -> begin\n FogEnable(true)\n SelectUnit(u, true)\n reurn 0..seconds()\nend,\n)\n\nA cinematic can be skipped, which signals the controller to halt processing sequences and play the closing sequence.\ncine.skip_()", - "summaryFirstLine": "Create a cinematic by composing cinematic sequences:", - "tags": [ - "util" - ], - "imports": [], - "entities": [ + "line": 150 + }, { - "kind": "interface", - "name": "CineSeq", + "kind": "module", + "name": "FieldSerializableLifecycle", "typeParams": "", "receiver": null, - "signature": "public interface CineSeq", - "doc": "A cinematic sequence. Cinematic has built-in cinematic sequences:\n\n- Cinematic.fadeOutSeq(duration)\n- Cinematic.fadeInSeq(duration)\n- Cinematic.applyCameraSetupSeq(camerasetup)\n- Cinematic.snapCameraPosSeq(vec2)\n- Cinematic.doNothingSeq()", + "signature": "public module FieldSerializableLifecycle", + "doc": "Shared typed lifecycle for `FieldSerializable` classes that provide their own field mapping.\n\nPrefer `SerializableFields` when all field codecs come from `StructuredSerialization`. Use this\nmodule when mapping fields in the class package is necessary, notably for package-local tuple\ncodecs. Implement `writeSerializedFields` and `readSerializedFields`; serialization, integrity,\nmigration, nested-object loading, and typed `load` remain provided here.", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [], - "enumMembers": [], - "line": 16 - }, - { - "kind": "class", - "name": "Cinematic", - "typeParams": "", - "receiver": null, + "members": [ + { + "kind": "function", + "name": "writeSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "abstract function writeSerializedFields(FieldSerializationWriter writer)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 162 + }, + { + "kind": "function", + "name": "readSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "abstract function readSerializedFields(FieldSerializationReader reader)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 163 + }, + { + "kind": "function", + "name": "readSerializedField", + "typeParams": "", + "receiver": null, + "signature": "function readSerializedField(FieldSerializationReader reader, string name) returns thistype", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 165 + }, + { + "kind": "function", + "name": "serialize", + "typeParams": "", + "receiver": null, + "signature": "function serialize() returns ChunkedString", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 172 + }, + { + "kind": "function", + "name": "serialize", + "typeParams": "", + "receiver": null, + "signature": "function serialize(int schemaVersion) returns ChunkedString", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 175 + }, + { + "kind": "function", + "name": "serialize", + "typeParams": "", + "receiver": null, + "signature": "function serialize(int schemaVersion, int integrityKey) returns ChunkedString", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 178 + }, + { + "kind": "function", + "name": "deserialize", + "typeParams": "", + "receiver": null, + "signature": "function deserialize(ChunkedString input) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 185 + }, + { + "kind": "function", + "name": "deserialize", + "typeParams": "", + "receiver": null, + "signature": "function deserialize(ChunkedString input, int integrityKey) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 188 + }, + { + "kind": "function", + "name": "deserialize", + "typeParams": "", + "receiver": null, + "signature": "function deserialize(ChunkedString input, int integrityKey, SerializationMigration migration) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 191 + }, + { + "kind": "function", + "name": "load", + "typeParams": "", + "receiver": null, + "signature": "function load(ChunkedString input) returns thistype", + "doc": "Loads valid data into this instance and returns it for concise construction and chaining.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 201 + } + ], + "enumMembers": [], + "line": 161 + }, + { + "kind": "module", + "name": "SerializableFieldMapping", + "typeParams": "", + "receiver": null, + "signature": "public module SerializableFieldMapping", + "doc": "Automatic field mapping without adding a second `serialize`/`deserialize` lifecycle.\n\nUse this during a compatibility window when a data class still extends legacy `Serializable`, or\nwhen another base class already owns lifecycle methods. The class must implement `FieldSerializable`.\nAll of its accessible mutable instance fields participate; keep runtime-only state in a separate\nclass because persisted-field annotation filtering is not available.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "writeSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "function writeSerializedFields(FieldSerializationWriter writer)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 214 + }, + { + "kind": "function", + "name": "readSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "function readSerializedFields(FieldSerializationReader reader)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 217 + }, + { + "kind": "function", + "name": "readSerializedField", + "typeParams": "", + "receiver": null, + "signature": "function readSerializedField(FieldSerializationReader reader, string name) returns thistype", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 220 + } + ], + "enumMembers": [], + "line": 213 + }, + { + "kind": "module", + "name": "SerializableFields", + "typeParams": "", + "receiver": null, + "signature": "public module SerializableFields", + "doc": "Modern automatic serialization for dedicated state/DAO classes using built-in codecs.\n\nAdd `implements FieldSerializable` and `use SerializableFields`. The compiler expands field\niteration to direct accesses. The tagged format tolerates field reordering, added/removed fields,\nand unknown future wire types. Missing fields retain constructor defaults. Use a schema version and\n`SerializationMigration` for semantic changes or `renameField` for renamed attributes. For custom\ntuple codecs declared in the consuming package, use `FieldSerializableLifecycle` as documented\nabove so overload resolution occurs where those codecs are visible. Classes that must also retain\nlegacy `Serializable` should use `SerializableFieldMapping` to avoid conflicting lifecycle methods.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "writeSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "override function writeSerializedFields(FieldSerializationWriter writer)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 241 + }, + { + "kind": "function", + "name": "readSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "override function readSerializedFields(FieldSerializationReader reader)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 245 + } + ], + "enumMembers": [], + "line": 238 + } + ] + }, + { + "package": "StructuredSerializationCore", + "category": "file", + "categoryLabel": "File & Network", + "sourcePath": "wurst/file/StructuredSerializationCore.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerializationCore.wurst", + "summary": "Default integrity key for structured saves. Override this in map configuration with a private,\nmap-specific value. It is intended to deter edited player save codes, not provide cryptographic\nauthentication against somebody who can inspect the map script.", + "summaryFirstLine": "Default integrity key for structured saves. Override this in map configuration with a private,", + "tags": [ + "file" + ], + "imports": [], + "entities": [ + { + "kind": "constant", + "name": "SERIALIZATION_FORMAT_VERSION", + "typeParams": "", + "receiver": null, + "signature": "public constant SERIALIZATION_FORMAT_VERSION = 2", + "doc": "Current tagged serialization wire format.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 8 + }, + { + "kind": "constant", + "name": "SERIALIZATION_INTEGRITY_KEY", + "typeParams": "", + "receiver": null, + "signature": "public constant SERIALIZATION_INTEGRITY_KEY = 0x6D2B79F5", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 15 + }, + { + "kind": "constant", + "name": "SERIALIZATION_REAL_DECIMALS", + "typeParams": "", + "receiver": null, + "signature": "public constant SERIALIZATION_REAL_DECIMALS = 6", + "doc": "Decimal places retained for Jass `real` values. Trailing zeroes are removed on the wire.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 18 + }, + { + "kind": "function", + "name": "serializationFieldId", + "typeParams": "", + "receiver": null, + "signature": "public function serializationFieldId(string name) returns int", + "doc": "Returns the stable, case-sensitive numeric ID used for a persisted field name.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 73 + }, + { + "kind": "interface", + "name": "SerializationMigration", + "typeParams": "", + "receiver": null, + "signature": "public interface SerializationMigration", + "doc": "A parsed migration hook. Hooks are invoked but not destroyed by `deserialize`.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "migrate", + "typeParams": "", + "receiver": null, + "signature": "function migrate(FieldSerializationReader reader)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 171 + } + ], + "enumMembers": [], + "line": 170 + }, + { + "kind": "interface", + "name": "FieldSerializable", + "typeParams": "", + "receiver": null, + "signature": "public interface FieldSerializable", + "doc": "Opt-in contract used for recursively serialized class fields.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "writeSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "function writeSerializedFields(FieldSerializationWriter writer)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 175 + }, + { + "kind": "function", + "name": "readSerializedFields", + "typeParams": "", + "receiver": null, + "signature": "function readSerializedFields(FieldSerializationReader reader)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 176 + }, + { + "kind": "function", + "name": "readSerializedField", + "typeParams": "", + "receiver": null, + "signature": "function readSerializedField(FieldSerializationReader reader, string name) returns thistype", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 177 + } + ], + "enumMembers": [], + "line": 174 + }, + { + "kind": "class", + "name": "FieldSerializationWriter", + "typeParams": "", + "receiver": null, + "signature": "public class FieldSerializationWriter", + "doc": "Builds one compact, versioned structured-save envelope.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct(int schemaVersion)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 186 + }, + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct(int schemaVersion, int integrityKey)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 189 + }, + { + "kind": "function", + "name": "writeRaw", + "typeParams": "", + "receiver": null, + "signature": "function writeRaw(string name, string token, string payload)", + "doc": "Writes a future-compatible raw field. Custom token values should be one ASCII byte.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 217 + }, + { + "kind": "function", + "name": "writeRaw", + "typeParams": "", + "receiver": null, + "signature": "function writeRaw(string name, string token, ChunkedString payload)", + "doc": "Writes a raw field without flattening its chunked payload. The caller retains ownership.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 222 + }, + { + "kind": "function", + "name": "write", + "typeParams": "", + "receiver": null, + "signature": "function write(string name, int value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 226 + }, + { + "kind": "function", + "name": "write", + "typeParams": "", + "receiver": null, + "signature": "function write(string name, real value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 229 + }, + { + "kind": "function", + "name": "write", + "typeParams": "", + "receiver": null, + "signature": "function write(string name, string value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 232 + }, + { + "kind": "function", + "name": "write", + "typeParams": "", + "receiver": null, + "signature": "function write(string name, boolean value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 235 + }, + { + "kind": "function", + "name": "getIntegrityKey", + "typeParams": "", + "receiver": null, + "signature": "function getIntegrityKey() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 238 + }, + { + "kind": "function", + "name": "write", + "typeParams": "", + "receiver": null, + "signature": "function write(string name, FieldSerializable value)", + "doc": "Recursively writes an opted-in non-null class instance.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 242 + }, + { + "kind": "function", + "name": "writeObject", + "typeParams": "", + "receiver": null, + "signature": "function writeObject(string name, FieldSerializationWriter child)", + "doc": "Writes and consumes a child writer as a nested class or tuple envelope.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 248 + }, + { + "kind": "function", + "name": "finish", + "typeParams": "", + "receiver": null, + "signature": "function finish() returns ChunkedString", + "doc": "Completes the envelope. The returned value belongs to the caller.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 255 + } + ], + "enumMembers": [], + "line": 180 + }, + { + "kind": "class", + "name": "FieldSerializationReader", + "typeParams": "", + "receiver": null, + "signature": "public class FieldSerializationReader", + "doc": "Parsed field table. Unknown fields and wire tokens are retained and safely skippable.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 359 + }, + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct(ChunkedString input)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 361 + }, + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct(ChunkedString input, int integrityKey)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 364 + }, + { + "kind": "function", + "name": "isValid", + "typeParams": "", + "receiver": null, + "signature": "function isValid() returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 391 + }, + { + "kind": "function", + "name": "getSchemaVersion", + "typeParams": "", + "receiver": null, + "signature": "function getSchemaVersion() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 394 + }, + { + "kind": "function", + "name": "getIntegrityKey", + "typeParams": "", + "receiver": null, + "signature": "function getIntegrityKey() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 397 + }, + { + "kind": "function", + "name": "hasField", + "typeParams": "", + "receiver": null, + "signature": "function hasField(string name) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 400 + }, + { + "kind": "function", + "name": "hasRaw", + "typeParams": "", + "receiver": null, + "signature": "function hasRaw(string name, string token) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 403 + }, + { + "kind": "function", + "name": "readRaw", + "typeParams": "", + "receiver": null, + "signature": "function readRaw(string name, string token, string oldValue) returns string", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 407 + }, + { + "kind": "function", + "name": "readRawChunked", + "typeParams": "", + "receiver": null, + "signature": "function readRawChunked(string name, string token) returns ChunkedString", + "doc": "Returns an independent chunked copy of a raw payload, or `null` when the field/token is absent.\nThe caller owns and must destroy the returned value.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 415 + }, + { + "kind": "function", + "name": "read", + "typeParams": "", + "receiver": null, + "signature": "function read(string name, int oldValue) returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 421 + }, + { + "kind": "function", + "name": "read", + "typeParams": "", + "receiver": null, + "signature": "function read(string name, real oldValue) returns real", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 425 + }, + { + "kind": "function", + "name": "read", + "typeParams": "", + "receiver": null, + "signature": "function read(string name, string oldValue) returns string", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 429 + }, + { + "kind": "function", + "name": "read", + "typeParams": "", + "receiver": null, + "signature": "function read(string name, boolean oldValue) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 432 + }, + { + "kind": "function", + "name": "setRaw", + "typeParams": "", + "receiver": null, + "signature": "function setRaw(string name, string token, string payload)", + "doc": "Replaces or creates a decoded field during migration.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 437 + }, + { + "kind": "function", + "name": "set", + "typeParams": "", + "receiver": null, + "signature": "function set(string name, int value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 449 + }, + { + "kind": "function", + "name": "set", + "typeParams": "", + "receiver": null, + "signature": "function set(string name, real value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 452 + }, + { + "kind": "function", + "name": "set", + "typeParams": "", + "receiver": null, + "signature": "function set(string name, string value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 455 + }, + { + "kind": "function", + "name": "set", + "typeParams": "", + "receiver": null, + "signature": "function set(string name, boolean value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 458 + }, + { + "kind": "function", + "name": "removeField", + "typeParams": "", + "receiver": null, + "signature": "function removeField(string name)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 461 + }, + { + "kind": "function", + "name": "readInto", + "typeParams": "", + "receiver": null, + "signature": "function readInto(string name, FieldSerializable oldValue) returns boolean", + "doc": "Mutates an existing opted-in child object when a valid nested envelope is present.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 469 + }, + { + "kind": "function", + "name": "readObject", + "typeParams": "", + "receiver": null, + "signature": "function readObject(string name) returns FieldSerializationReader", + "doc": "Returns a nested reader borrowed from this reader, or an invalid reader when absent.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 478 + }, + { + "kind": "function", + "name": "renameField", + "typeParams": "", + "receiver": null, + "signature": "function renameField(string oldName, string newName)", + "doc": "Moves a persisted value from an old field name to a new one. Call this from a migration before\nfield mapping. Existing data under the new name wins, making repeated migrations idempotent.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 488 + } + ], + "enumMembers": [], + "line": 353 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "int", + "signature": "public function int.readSerializedField(FieldSerializationReader reader, string name) returns int", + "doc": "Type-directed field readers used by the compiler-expanded mapper.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 510 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "real", + "signature": "public function real.readSerializedField(FieldSerializationReader reader, string name) returns real", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 513 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "string", + "signature": "public function string.readSerializedField(FieldSerializationReader reader, string name) returns string", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 516 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "boolean", + "signature": "public function boolean.readSerializedField(FieldSerializationReader reader, string name) returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 519 + } + ] + }, + { + "package": "SyncSimple", + "category": "file", + "categoryLabel": "File & Network", + "sourcePath": "wurst/file/SyncSimple.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/SyncSimple.wurst", + "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" + ], + "imports": [], + "entities": [ + { + "kind": "constant", + "name": "DEFAULT_PREFIX", + "typeParams": "", + "receiver": null, + "signature": "public constant DEFAULT_PREFIX = \"S\"", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 20 + }, + { + "kind": "constant", + "name": "LAST_CHUNK_PREFIX", + "typeParams": "", + "receiver": null, + "signature": "public constant LAST_CHUNK_PREFIX = \"T\"", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 21 + }, + { + "kind": "constant", + "name": "SYNC_IN_REPLAYS", + "typeParams": "", + "receiver": null, + "signature": "public constant SYNC_IN_REPLAYS = false", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 22 + }, + { + "kind": "interface", + "name": "BoolSyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface BoolSyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(bool data)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 26 + } + ], + "enumMembers": [], + "line": 25 + }, + { + "kind": "interface", + "name": "IntSyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface IntSyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(int data)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 29 + } + ], + "enumMembers": [], + "line": 28 + }, + { + "kind": "interface", + "name": "RealSyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface RealSyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(real data)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 32 + } + ], + "enumMembers": [], + "line": 31 + }, + { + "kind": "interface", + "name": "StringSyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface StringSyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(string data)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 35 + } + ], + "enumMembers": [], + "line": 34 + }, + { + "kind": "interface", + "name": "BufferSyncListener", + "typeParams": "", + "receiver": null, + "signature": "public interface BufferSyncListener", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "onDataSynced", + "typeParams": "", + "receiver": null, + "signature": "function onDataSynced(ChunkedString buffer)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 38 + } + ], + "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", + "typeParams": "", + "receiver": "bool", + "signature": "public function bool.sync(player p, BoolSyncListener listener)", + "doc": "Syncs a bool from the given player.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 49 + }, + { + "kind": "extension-function", + "name": "sync", + "typeParams": "", + "receiver": "int", + "signature": "public function int.sync(player p, IntSyncListener listener)", + "doc": "Syncs an int from the given player.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 55 + }, + { + "kind": "extension-function", + "name": "sync", + "typeParams": "", + "receiver": "real", + "signature": "public function real.sync(player p, RealSyncListener listener)", + "doc": "Syncs a real from the given player.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "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", + "name": "sync", + "typeParams": "", + "receiver": "string", + "signature": "public function string.sync(player p, StringSyncListener listener)", + "doc": "Syncs a single string from the given player.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 76 + }, + { + "kind": "extension-function", + "name": "sync", + "typeParams": "", + "receiver": "ChunkedString", + "signature": "public function ChunkedString.sync(player p, BufferSyncListener listener)", + "doc": "Syncs a chunked string from the given player.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 83 + } + ] + }, + { + "package": "Board", + "category": "util", + "categoryLabel": "Utilities", + "sourcePath": "wurst/util/Board.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/Board.wurst", + "summary": "This Board library allows you to create a simple multi board with dynamic cell values.\n 1. Create a board\n `let board = new Board(\"myBoard\", 0.02)`\n\n 2. Define columns. The second parameter is width relative to board width.\n `board.columns(asList(new BoardColumn(\"Player\", 0.7), new BoardColumn(COLOR_GOLD.toColorString() + \"Kills\", 0.3)))`\n\n 3. Add rows and cells\n `let killcount = dynamicCell(0, i -> i.toString())\n board.addRow()\n ..addCell(\"My Name\")\n ..addDynamic(killcount)`\n\n 4. Show board\n `board.show()`\n\n 5. Update dynamic value\n `killcount.updateValue(killcount.value + 1)`", + "summaryFirstLine": "This Board library allows you to create a simple multi board with dynamic cell values.", + "tags": [ + "util" + ], + "imports": [], + "entities": [ + { + "kind": "function", + "name": "dynamicCellIcon", + "typeParams": "", + "receiver": null, + "signature": "public function dynamicCellIcon(string icon, DynamicCellValue observer) returns DynamicCellValue", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 25 + }, + { + "kind": "function", + "name": "dynamicCell", + "typeParams": "", + "receiver": null, + "signature": "public function dynamicCell(T defaultValue, DynamicCellValue observer) returns DynamicCellValue", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 29 + }, + { + "kind": "class", + "name": "DynamicCellValue", + "typeParams": "", + "receiver": null, + "signature": "public abstract class DynamicCellValue", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 33 + }, + { + "kind": "class", + "name": "BoardColumn", + "typeParams": "", + "receiver": null, + "signature": "public class BoardColumn", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 58 + }, + { + "kind": "class", + "name": "BoardCell", + "typeParams": "", + "receiver": null, + "signature": "public class BoardCell", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 74 + }, + { + "kind": "class", + "name": "BoardRow", + "typeParams": "", + "receiver": null, + "signature": "public class BoardRow", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 107 + }, + { + "kind": "class", + "name": "Board", + "typeParams": "", + "receiver": null, + "signature": "public class Board", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 144 + } + ] + }, + { + "package": "Cinematic", + "category": "util", + "categoryLabel": "Utilities", + "sourcePath": "wurst/util/Cinematic.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/Cinematic.wurst", + "summary": "Create a cinematic by composing cinematic sequences:\n\nlet cine = new Cinematic(\nasList(\n Cinematic.fadeOutSeq(0.5.seconds()),\n Cinematic.snapCameraPosSeq(ZERO2),\n Cinematic.fadeInSeq(1..seconds()),\n () -> begin\n print(\"Cinematic!\")\n return 5..seconds()\n end,\n Cinematic.fadeOutSeq(0.5.seconds())\n),\n// This final cinematic seq is always run, even if cinematic is skipped. Use this for cleanup.\n() -> begin\n FogEnable(true)\n SelectUnit(u, true)\n reurn 0..seconds()\nend,\n)\n\nA cinematic can be skipped, which signals the controller to halt processing sequences and play the closing sequence.\ncine.skip_()", + "summaryFirstLine": "Create a cinematic by composing cinematic sequences:", + "tags": [ + "util" + ], + "imports": [], + "entities": [ + { + "kind": "interface", + "name": "CineSeq", + "typeParams": "", + "receiver": null, + "signature": "public interface CineSeq", + "doc": "A cinematic sequence. Cinematic has built-in cinematic sequences:\n\n- Cinematic.fadeOutSeq(duration)\n- Cinematic.fadeInSeq(duration)\n- Cinematic.applyCameraSetupSeq(camerasetup)\n- Cinematic.snapCameraPosSeq(vec2)\n- Cinematic.doNothingSeq()", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 16 + }, + { + "kind": "class", + "name": "Cinematic", + "typeParams": "", + "receiver": null, "signature": "public class Cinematic", "doc": "", "deprecated": { @@ -129062,6 +130619,245 @@ } ] }, + { + "package": "DestructableSpatialIndex", + "category": "util", + "categoryLabel": "Utilities", + "sourcePath": "wurst/util/DestructableSpatialIndex.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/DestructableSpatialIndex.wurst", + "summary": "Static Lua spatial index for destructables.\n\nDestructables do not have an observable movement event, so this index only needs registration\nand removal hooks. Preplaced destructables are discovered once during initialization. Runtime\ndestructables created through CreateDestructable must call registerSpatialIndex() before they\ncan be queried.", + "summaryFirstLine": "Static Lua spatial index for destructables.", + "tags": [ + "util" + ], + "imports": [], + "entities": [ + { + "kind": "constant", + "name": "USE_DESTRUCTABLE_SPATIAL_INDEX", + "typeParams": "", + "receiver": null, + "signature": "public constant USE_DESTRUCTABLE_SPATIAL_INDEX = true", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 20 + }, + { + "kind": "constant", + "name": "DESTRUCTABLE_SPATIAL_INDEX_CELL_SIZE", + "typeParams": "", + "receiver": null, + "signature": "public constant DESTRUCTABLE_SPATIAL_INDEX_CELL_SIZE = 256.", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 22 + }, + { + "kind": "extension-function", + "name": "registerSpatialIndex", + "typeParams": "", + "receiver": "destructable", + "signature": "public function destructable.registerSpatialIndex()", + "doc": "Registers one destructable in the index.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 82 + }, + { + "kind": "extension-function", + "name": "unregisterSpatialIndex", + "typeParams": "", + "receiver": "destructable", + "signature": "public function destructable.unregisterSpatialIndex()", + "doc": "Removes one destructable from the index before RemoveDestructable is called.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 95 + }, + { + "kind": "function", + "name": "rebuildDestructableSpatialIndexGrid", + "typeParams": "", + "receiver": null, + "signature": "public function rebuildDestructableSpatialIndexGrid(vec2 worldMin, vec2 worldMax)", + "doc": "Rebuilds the grid around the current membership. Useful after changing the configured map bounds.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 113 + }, + { + "kind": "function", + "name": "destructableSpatialIndexBeginBoxQuery", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexBeginBoxQuery(vec2 boxMin, vec2 boxMax) returns int", + "doc": "Collects indexed destructables whose cached position is inside the axis-aligned box.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 129 + }, + { + "kind": "function", + "name": "destructableSpatialIndexBeginRangeQuery", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexBeginRangeQuery(vec2 center, real range) returns int", + "doc": "Collects indexed destructables in the square used by forDestructablesInRange.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 155 + }, + { + "kind": "function", + "name": "destructableSpatialIndexQuery", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexQuery(int i) returns destructable", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 159 + }, + { + "kind": "function", + "name": "destructableSpatialIndexEndQuery", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexEndQuery()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 163 + }, + { + "kind": "function", + "name": "destructableSpatialIndexHealthy", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexHealthy() returns boolean", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 170 + }, + { + "kind": "function", + "name": "destructableSpatialIndexTracked", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexTracked() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 173 + }, + { + "kind": "function", + "name": "destructableSpatialIndexCellOf", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexCellOf(vec2 pos) returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 176 + }, + { + "kind": "function", + "name": "destructableSpatialIndexGridWidth", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexGridWidth() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 179 + }, + { + "kind": "function", + "name": "destructableSpatialIndexGridHeight", + "typeParams": "", + "receiver": null, + "signature": "public function destructableSpatialIndexGridHeight() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 182 + } + ] + }, { "package": "DialogBox", "category": "util", @@ -129151,7 +130947,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 47 + "line": 46 }, { "kind": "function", @@ -129167,7 +130963,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 50 + "line": 49 }, { "kind": "function", @@ -129183,7 +130979,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 54 + "line": 53 }, { "kind": "function", @@ -129199,7 +130995,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 58 + "line": 57 }, { "kind": "function", @@ -129215,7 +131011,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 64 + "line": 63 }, { "kind": "function", @@ -129231,7 +131027,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 68 + "line": 67 }, { "kind": "function", @@ -129247,7 +131043,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 73 + "line": 72 }, { "kind": "function", @@ -129263,7 +131059,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 80 + "line": 79 }, { "kind": "function", @@ -129279,7 +131075,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 87 + "line": 86 }, { "kind": "function", @@ -129295,7 +131091,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 91 + "line": 90 }, { "kind": "function", @@ -129311,7 +131107,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 96 + "line": 95 } ], "enumMembers": [], @@ -129362,7 +131158,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 16 + "line": 15 }, { "kind": "extension-function", @@ -129378,7 +131174,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 24 + "line": 22 } ] }, @@ -130904,104 +132700,727 @@ } ], "enumMembers": [], - "line": 48 + "line": 48 + }, + { + "kind": "class", + "name": "DynamicSound", + "typeParams": "", + "receiver": null, + "signature": "public class DynamicSound", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "construct", + "typeParams": "", + "receiver": null, + "signature": "construct(SoundDefinition soundHandle)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 183 + }, + { + "kind": "function", + "name": "setTargetPitch", + "typeParams": "", + "receiver": null, + "signature": "function setTargetPitch(real pitch)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 187 + }, + { + "kind": "function", + "name": "play", + "typeParams": "", + "receiver": null, + "signature": "function play()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 190 + }, + { + "kind": "function", + "name": "setAbsolutePitch", + "typeParams": "", + "receiver": null, + "signature": "function setAbsolutePitch(real pitch)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 195 + }, + { + "kind": "function", + "name": "onTimedLoop", + "typeParams": "", + "receiver": null, + "signature": "override function onTimedLoop()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 208 + } + ], + "enumMembers": [], + "line": 173 + } + ] + }, + { + "package": "SpatialPartition", + "category": "util", + "categoryLabel": "Utilities", + "sourcePath": "wurst/util/SpatialPartition.wurst", + "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/SpatialPartition.wurst", + "summary": "Cell-head slots the given extent would need, so a caller can size cells and groups before committing\nto it - or -1 when that count is not representable, which is itself a reason to refuse the extent.\n\nComputed with divisions rather than by multiplying and inspecting the result: at a small cell size\nthe product overflows, and a wrapped negative reads as \"comfortably within budget\" to any comparison\nmade afterwards.", + "summaryFirstLine": "Cell-head slots the given extent would need, so a caller can size cells and groups before committing", + "tags": [ + "util" + ], + "imports": [], + "entities": [ + { + "kind": "constant", + "name": "SPATIAL_PARTITION_CELL_SIZE", + "typeParams": "", + "receiver": null, + "signature": "public constant SPATIAL_PARTITION_CELL_SIZE = 256.", + "doc": "Fine cell edge in world units. Smaller tightens windows but walks more cells.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 54 + }, + { + "kind": "constant", + "name": "SPATIAL_PARTITION_COARSE_FACTOR", + "typeParams": "", + "receiver": null, + "signature": "public constant SPATIAL_PARTITION_COARSE_FACTOR = 8", + "doc": "Fine cells per coarse block edge, so 8 means a block covers 8x8 cells. The coarse level exists so\na large query skips empty regions with one test per block instead of one per cell.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 58 + }, + { + "kind": "constant", + "name": "SPATIAL_PARTITION_MAX_GROUPS", + "typeParams": "", + "receiver": null, + "signature": "public constant SPATIAL_PARTITION_MAX_GROUPS = 8", + "doc": "Concurrently declared groups. Each costs one chain pointer per entry and one head per cell, so\nraise it only as far as a project uses.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 62 + }, + { + "kind": "constant", + "name": "SPATIAL_PARTITION_MAX_QUERY_DEPTH", + "typeParams": "", + "receiver": null, + "signature": "public constant SPATIAL_PARTITION_MAX_QUERY_DEPTH = 8", + "doc": "Deepest nesting of simultaneously open queries. Every open level keeps its own results in the shared\nsnapshot, so this multiplies snapshot storage and is part of the capacity budget below.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 66 + }, + { + "kind": "function", + "name": "spatialPartitionCellOf", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionCellOf(vec2 pos) returns int", + "doc": "Fine cell for a position, for tests and diagnostics.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 142 + }, + { + "kind": "function", + "name": "spatialPartitionGridWidth", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionGridWidth() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 145 + }, + { + "kind": "function", + "name": "spatialPartitionGridHeight", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionGridHeight() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 148 + }, + { + "kind": "function", + "name": "spatialPartitionCoarseWidth", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionCoarseWidth() returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 151 + }, + { + "kind": "function", + "name": "spatialPartitionCellSlotCount", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionCellSlotCount() returns int", + "doc": "Flattened cell-head slots the current grid occupies: one per cell per group. On Jass this must stay\nwithin `JASS_MAX_ARRAY_SIZE`; on Lua arrays grow and it is only a memory figure.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 156 + }, + { + "kind": "function", + "name": "spatialPartitionRequiredCellSlots", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionRequiredCellSlots(vec2 worldMin, vec2 worldMax) returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 174 + }, + { + "kind": "function", + "name": "spatialPartitionExtentFits", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionExtentFits(vec2 worldMin, vec2 worldMax) returns boolean", + "doc": "Whether an extent's cell storage is both representable and within this target's array limit.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 189 + }, + { + "kind": "function", + "name": "spatialPartitionLastQueryVisits", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionLastQueryVisits() returns int", + "doc": "Entries the last query walked, whether or not they matched.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 194 + }, + { + "kind": "function", + "name": "spatialPartitionLastQueryBlocksSkipped", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionLastQueryBlocksSkipped() returns int", + "doc": "Coarse blocks the last query rejected without descending into their cells.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 198 + }, + { + "kind": "function", + "name": "spatialPartitionMaxEntryId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionMaxEntryId() returns int", + "doc": "Largest usable entry id on this target. Whichever of the two ceilings binds first: the flattened\nper-entry links, or the snapshot with every query level open at once. Effectively unbounded on Lua.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 225 + }, + { + "kind": "function", + "name": "spatialPartitionIsValidEntryId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionIsValidEntryId(int id) returns boolean", + "doc": "Whether an id may be used as an entry. Ids are 1-based, because 0 is reserved as the chain\nsentinel, and bounded above on Jass by what the flattened entry slots can address.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 231 + }, + { + "kind": "function", + "name": "spatialPartitionIsValidGroupId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionIsValidGroupId(int groupId) returns boolean", + "doc": "Whether a group id addresses a real group.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 235 + }, + { + "kind": "function", + "name": "spatialPartitionAllocateEntryId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionAllocateEntryId() returns int", + "doc": "Reserves an entry id no other consumer will be handed. Release it with\n`spatialPartitionReleaseEntryId` after removing the entry, or ids are never reused. Answers 0 when\nthe target's id space is exhausted, which a caller must treat as \"cannot index this\".", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 257 + }, + { + "kind": "function", + "name": "spatialPartitionEntryIdIsReserved", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionEntryIdIsReserved(int id) returns boolean", + "doc": "Whether an id is currently handed out to some consumer.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 286 + }, + { + "kind": "function", + "name": "spatialPartitionReleaseEntryId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionReleaseEntryId(int id)", + "doc": "Returns an id to the pool. The entry must already be removed: recycling one that is still linked\nwould hand a live row to the next caller.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 291 + }, + { + "kind": "function", + "name": "spatialPartitionAllocatedEntryIds", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionAllocatedEntryIds() returns int", + "doc": "Highest id in use across every consumer, which is what the arrays keyed by an id are sized to.\nNot the fresh-allocation cursor: a high row taken directly and later recycled is handed out again\nfrom the free list without the cursor ever reaching it, so the cursor can read far below the rows\nthat are actually live.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 311 + }, + { + "kind": "function", + "name": "spatialPartitionAllocateGroup", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionAllocateGroup() returns int", + "doc": "Reserves a group no other consumer will be given, or -1 when none are left. Hold on to it: groups\nare long-lived, there is no release, and asking twice consumes two.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 321 + }, + { + "kind": "function", + "name": "spatialPartitionGroupIsReserved", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionGroupIsReserved(int groupId) returns boolean", + "doc": "Whether a group has been claimed, by the allocator or by being used directly.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 331 + }, + { + "kind": "function", + "name": "spatialPartitionIsReady", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionIsReady() returns boolean", + "doc": "Whether the grid has been given an extent yet. Nothing can be linked before it has.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 335 + }, + { + "kind": "function", + "name": "spatialPartitionIsValidExtent", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionIsValidExtent(vec2 worldMin, vec2 worldMax) returns boolean", + "doc": "Whether an extent describes a real area. An inverted axis yields a zero or negative dimension, and\nthe coarse block index divides by the grid width, so this has to be caught before any state moves.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 340 }, { - "kind": "class", - "name": "DynamicSound", + "kind": "function", + "name": "spatialPartitionSetPos", "typeParams": "", "receiver": null, - "signature": "public class DynamicSound", + "signature": "public function spatialPartitionSetPos(int id, real x, real y)", + "doc": "Records where an entry is, re-bucketing it in every group it belongs to. Call this before adding\nthe entry to any group, and again whenever it has moved.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 400 + }, + { + "kind": "function", + "name": "spatialPartitionSetGroup", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionSetGroup(int id, int groupId, boolean member)", + "doc": "Adds or removes an entry from one group. The caller owns the policy of when membership changes,\nwhich keeps predicate evaluation out of the walk entirely.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 423 + }, + { + "kind": "function", + "name": "spatialPartitionEntryX", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionEntryX(int id) returns real", + "doc": "Cached x of an entry, so a consumer can re-decide an uncertain result under its own staleness\n\tmodel before paying for a live position. Zero for an id the partition does not hold.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 438 + }, + { + "kind": "function", + "name": "spatialPartitionEntryY", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionEntryY(int id) returns real", + "doc": "Cached y of an entry. See `spatialPartitionEntryX`.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 442 + }, + { + "kind": "function", + "name": "spatialPartitionInGroup", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionInGroup(int id, int groupId) returns boolean", + "doc": "Whether an entry is currently in a group.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 451 + }, + { + "kind": "function", + "name": "spatialPartitionRemove", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionRemove(int id)", + "doc": "Drops an entry from every group. Call before recycling its id, or a later entry inherits it.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 459 + }, + { + "kind": "function", + "name": "spatialPartitionEntryCount", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionEntryCount() returns int", + "doc": "Live entries the partition holds.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 478 + }, + { + "kind": "function", + "name": "spatialPartitionClear", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionClear()", + "doc": "Drops every entry and every group link, across every consumer - the partition has one population,\nnot one per group. A layer that wants to drop only its own entries removes them by id; there is no\nway to ask for that here, because groups say what a query sees, not who owns a row. Ids are not\nreturned to the allocator either, so a consumer that clears must release the ones it held.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 485 + }, + { + "kind": "function", + "name": "rebuildSpatialPartition", + "typeParams": "", + "receiver": null, + "signature": "public function rebuildSpatialPartition(vec2 worldMin, vec2 worldMax)", + "doc": "Re-derives the extent and re-links every entry into the new grid, keeping the groups they were in.\n\nEvery cell index means something different afterwards, so this cannot just clear the heads: an\nentry still carrying its old link would be invisible to the new grid and would corrupt the chain it\nis eventually unlinked from.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 494 + }, + { + "kind": "function", + "name": "spatialPartitionBeginRangeQuery", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionBeginRangeQuery(vec2 center, real radius, real maxDisplacement, int groupId) returns int", + "doc": "Collects the members of `groupId` within `radius` of the point, allowing for entries whose cached\nposition may be up to `maxDisplacement` out of date.\n\nCertainly-in and certainly-out are settled from the cached position alone. Entries in the\n`maxDisplacement`-wide band around the boundary cannot be decided from stale data, so they come\nback flagged: check `spatialPartitionQueryUncertain(i)` and resolve those against a live position.\nPass a zero displacement and no result is ever flagged.\n\nMust be paired with `spatialPartitionEndQuery()`.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 554 + }, + { + "kind": "function", + "name": "spatialPartitionBeginBoxQuery", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionBeginBoxQuery(vec2 boxMin, vec2 boxMax, real maxDisplacement, int groupId) returns int", + "doc": "Collects the members of `groupId` inside the axis-aligned box, allowing for entries whose cached\nposition may be up to `maxDisplacement` out of date.\n\nSame three-way split as the range query, applied per axis: a cached position more than\n`maxDisplacement` outside the box cannot be inside it, one that far within cannot be outside, and\nthe band between is flagged for the caller to resolve. Pass a zero displacement and nothing is\nflagged.\n\nMust be paired with `spatialPartitionEndQuery()`.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 635 + }, + { + "kind": "function", + "name": "spatialPartitionQueryId", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionQueryId(int i) returns int", + "doc": "Entry id `i` of the innermost active query, or 0 if there is no such result.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 703 + }, + { + "kind": "function", + "name": "spatialPartitionQueryUncertain", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionQueryUncertain(int i) returns boolean", + "doc": "Whether entry `i` could not be decided from its cached position and needs a live check against the\nrequested radius. Always false when the query passed a zero displacement.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 713 + }, + { + "kind": "function", + "name": "spatialPartitionEndQuery", + "typeParams": "", + "receiver": null, + "signature": "public function spatialPartitionEndQuery()", "doc": "", "deprecated": { "flag": false, "message": null }, "configurable": false, - "members": [ - { - "kind": "function", - "name": "construct", - "typeParams": "", - "receiver": null, - "signature": "construct(SoundDefinition soundHandle)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 183 - }, - { - "kind": "function", - "name": "setTargetPitch", - "typeParams": "", - "receiver": null, - "signature": "function setTargetPitch(real pitch)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 187 - }, - { - "kind": "function", - "name": "play", - "typeParams": "", - "receiver": null, - "signature": "function play()", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 190 - }, - { - "kind": "function", - "name": "setAbsolutePitch", - "typeParams": "", - "receiver": null, - "signature": "function setAbsolutePitch(real pitch)", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 195 - }, - { - "kind": "function", - "name": "onTimedLoop", - "typeParams": "", - "receiver": null, - "signature": "override function onTimedLoop()", - "doc": "", - "deprecated": { - "flag": false, - "message": null - }, - "configurable": false, - "members": [], - "enumMembers": [], - "line": 208 - } - ], + "members": [], "enumMembers": [], - "line": 173 + "line": 718 } ] }, @@ -133241,8 +135660,8 @@ "categoryLabel": "Utilities", "sourcePath": "wurst/util/UnitSpatialIndex.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/UnitSpatialIndex.wurst", - "summary": "Registers or re-buckets one unit immediately. Ordinary movement does not need this - the sweep\ncovers it - but an engine-side teleport or a raw `SetUnitX` call does, because neither is\nobservable.", - "summaryFirstLine": "Registers or re-buckets one unit immediately. Ordinary movement does not need this - the sweep", + "summary": "Deprecated. Cell geometry belongs to the shared grid now, so `SPATIAL_PARTITION_CELL_SIZE` is the\nsetting; one grid cannot have a second cell size for units alone.\n\nKept exported so an existing `UnitSpatialIndex_config` still compiles, and defaulted to agree. It\nis checked at init rather than ignored: a map that had tuned this and upgrades gets told its\nvalue is no longer in effect, instead of quietly running on a different grid.", + "summaryFirstLine": "Deprecated. Cell geometry belongs to the shared grid now, so `SPATIAL_PARTITION_CELL_SIZE` is the", "tags": [ "util" ], @@ -133262,15 +135681,15 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 16 + "line": 35 }, { "kind": "constant", - "name": "SPATIAL_INDEX_CELL_SIZE", + "name": "SPATIAL_INDEX_UNITS_PER_TICK", "typeParams": "", "receiver": null, - "signature": "public constant SPATIAL_INDEX_CELL_SIZE = 256.", - "doc": "Grid cell edge in world units; smaller cells tighten windows but increase cells walked.", + "signature": "public constant SPATIAL_INDEX_UNITS_PER_TICK = 128", + "doc": "Units re-bucketed per tick; raising this shortens the cycle and query padding.", "deprecated": { "flag": false, "message": null @@ -133278,15 +135697,15 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 19 + "line": 38 }, { "kind": "constant", - "name": "SPATIAL_INDEX_UNITS_PER_TICK", + "name": "SPATIAL_INDEX_SWEEP_PERIOD", "typeParams": "", "receiver": null, - "signature": "public constant SPATIAL_INDEX_UNITS_PER_TICK = 128", - "doc": "Units re-bucketed per tick; raising this shortens the cycle and query padding.", + "signature": "public constant SPATIAL_INDEX_SWEEP_PERIOD = ANIMATION_PERIOD", + "doc": "Time between sweep steps. Raising this reduces timer and refresh work but increases query padding.", "deprecated": { "flag": false, "message": null @@ -133294,7 +135713,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 22 + "line": 41 }, { "kind": "constant", @@ -133310,7 +135729,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 25 + "line": 44 }, { "kind": "constant", @@ -133326,7 +135745,23 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 28 + "line": 47 + }, + { + "kind": "constant", + "name": "SPATIAL_INDEX_CELL_SIZE", + "typeParams": "", + "receiver": null, + "signature": "public constant SPATIAL_INDEX_CELL_SIZE = SPATIAL_PARTITION_CELL_SIZE", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 55 }, { "kind": "extension-function", @@ -133334,7 +135769,7 @@ "typeParams": "", "receiver": "unit", "signature": "public function unit.updateSpatialIndex()", - "doc": "", + "doc": "Registers or re-buckets one unit immediately. Ordinary movement does not need this - the sweep\ncovers it - but an engine-side teleport or a raw `SetUnitX` call does, because neither is\nobservable.", "deprecated": { "flag": false, "message": null @@ -133342,7 +135777,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 191 + "line": 197 }, { "kind": "function", @@ -133358,7 +135793,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 257 + "line": 256 }, { "kind": "function", @@ -133374,7 +135809,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 263 + "line": 262 }, { "kind": "function", @@ -133390,7 +135825,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 267 + "line": 266 }, { "kind": "function", @@ -133406,7 +135841,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 271 + "line": 270 }, { "kind": "function", @@ -133414,7 +135849,7 @@ "typeParams": "", "receiver": null, "signature": "public function spatialIndexAllocatedSlots() returns int", - "doc": "Allocated cache slots; ID reuse keeps this at peak concurrent population.", + "doc": "Allocated cache slots; ID reuse keeps this at peak concurrent population. Ids are shared across\npartition consumers now, so this counts every entry id handed out, not only this layer's - which\nis the right figure for the arrays here, since they are indexed by that same id.", "deprecated": { "flag": false, "message": null @@ -133422,7 +135857,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 275 + "line": 276 }, { "kind": "function", @@ -133438,7 +135873,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 279 + "line": 280 }, { "kind": "function", @@ -133446,7 +135881,7 @@ "typeParams": "", "receiver": null, "signature": "public function rebuildSpatialIndexGrid(vec2 worldMin, vec2 worldMax)", - "doc": "Rebuilds the extent and re-buckets all units. Unguarded so grid math remains testable on Jass.", + "doc": "Rebuilds the extent and re-buckets all units. Unguarded so grid math remains testable on Jass.\n\nThe grid is shared, so this re-derives it for every partition consumer, not only for units: there\nis one extent, and an entry linked under the old cell indices would be invisible to the new grid.\nThat is why the rebuild re-links everything rather than only this layer's entries.", "deprecated": { "flag": false, "message": null @@ -133454,7 +135889,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 283 + "line": 288 }, { "kind": "function", @@ -133470,7 +135905,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 301 + "line": 302 }, { "kind": "function", @@ -133486,7 +135921,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 305 + "line": 306 }, { "kind": "function", @@ -133502,7 +135937,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 308 + "line": 309 }, { "kind": "function", @@ -133518,7 +135953,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 327 + "line": 342 }, { "kind": "function", @@ -133534,7 +135969,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 386 + "line": 392 }, { "kind": "function", @@ -133550,7 +135985,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 439 + "line": 431 }, { "kind": "function", @@ -133566,7 +136001,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 449 + "line": 441 }, { "kind": "function", @@ -133582,7 +136017,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 453 + "line": 445 } ] }, @@ -155158,7 +157593,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 542 @@ -155206,7 +157641,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 553 @@ -155414,7 +157849,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 596 @@ -155430,7 +157865,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 601 @@ -155446,7 +157881,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 606 @@ -155462,7 +157897,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 611 @@ -155478,7 +157913,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 615 @@ -155494,7 +157929,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 620 @@ -157799,8 +160234,8 @@ "categoryLabel": "Core Language", "sourcePath": "wurst/_wurst/Annotations.wurst", "githubUrl": "https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_wurst/Annotations.wurst", - "summary": "", - "summaryFirstLine": "", + "summary": "Marks a documented declaration whose calls are expanded by the compiler.\n\nUnlike a normal fallback declaration, this does not suppress intrinsic lowering. The declaration\nexists so intrinsic APIs remain visible to completion, navigation, and documentation tools.", + "summaryFirstLine": "Marks a documented declaration whose calls are expanded by the compiler.", "tags": [ "wurst" ], @@ -157886,6 +160321,22 @@ "enumMembers": [], "line": 22 }, + { + "kind": "function", + "name": "compilerintrinsic", + "typeParams": "", + "receiver": null, + "signature": "public function compilerintrinsic()", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 30 + }, { "kind": "function", "name": "configurable", @@ -157900,7 +160351,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 25 + "line": 33 }, { "kind": "function", @@ -157916,7 +160367,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 28 + "line": 36 }, { "kind": "function", @@ -157932,7 +160383,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 31 + "line": 39 }, { "kind": "function", @@ -157948,7 +160399,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 34 + "line": 42 }, { "kind": "function", @@ -157964,7 +160415,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 37 + "line": 45 }, { "kind": "function", @@ -157980,7 +160431,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 40 + "line": 48 } ] }, @@ -158668,6 +161119,22 @@ "enumMembers": [], "line": 33 }, + { + "kind": "function", + "name": "preserveName", + "typeParams": "", + "receiver": null, + "signature": "public function preserveName()", + "doc": "Prevents -opt name minification for a top-level function whose name is used externally.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 36 + }, { "kind": "constant", "name": "compiletime", @@ -158682,7 +161149,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 38 + "line": 41 }, { "kind": "constant", @@ -158698,7 +161165,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 44 + "line": 47 }, { "kind": "function", @@ -158714,7 +161181,153 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 49 + "line": 52 + }, + { + "kind": "interface", + "name": "WurstFieldCallback", + "typeParams": "", + "receiver": null, + "signature": "public interface WurstFieldCallback", + "doc": "Tooling signature used by the field-iteration compiler intrinsics.\nThe compiler specializes `value` to the concrete type of each visited field.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "apply", + "typeParams": "", + "receiver": null, + "signature": "function apply(string fieldName, int value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 58 + } + ], + "enumMembers": [], + "line": 57 + }, + { + "kind": "interface", + "name": "WurstFieldMapper", + "typeParams": "", + "receiver": null, + "signature": "public interface WurstFieldMapper", + "doc": "Tooling signature used by the field-mapping compiler intrinsic.\nThe compiler specializes both the parameter and result to each concrete field type.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [ + { + "kind": "function", + "name": "apply", + "typeParams": "", + "receiver": null, + "signature": "function apply(string fieldName, int value) returns int", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 63 + } + ], + "enumMembers": [], + "line": 62 + }, + { + "kind": "function", + "name": "wurstForFields", + "typeParams": "", + "receiver": null, + "signature": "public function wurstForFields(WurstFieldCallback _callback)", + "doc": "Emits the callback once for every accessible non-static field of the enclosing class.\n\nThe callback receives the source field name and its concrete value. This is compile-time code\ngeneration: the generated Jass or Lua contains direct field accesses and no runtime reflection.\nUse the explicit-target form `wurstForFields(target, callback)` for classes and tuples.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 72 + }, + { + "kind": "function", + "name": "wurstForFields", + "typeParams": "", + "receiver": null, + "signature": "public function wurstForFields(T _target, WurstFieldCallback _callback)", + "doc": "Emits the callback once for every accessible non-static field of `target`.\n\nThis overload supports class instances and tuple values. The target expression is evaluated\nonce, and the compiler specializes the callback value to each field's concrete type.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 80 + }, + { + "kind": "function", + "name": "wurstMapFields", + "typeParams": "", + "receiver": null, + "signature": "public function wurstMapFields(WurstFieldMapper _callback)", + "doc": "Maps every accessible mutable non-static field of the enclosing class.\n\nEach callback result is assigned back to its field. Use the explicit-target form\n`wurstMapFields(target, callback)` for classes and tuple variables.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 88 + }, + { + "kind": "function", + "name": "wurstMapFields", + "typeParams": "", + "receiver": null, + "signature": "public function wurstMapFields(T _target, WurstFieldMapper _callback)", + "doc": "Maps every accessible mutable non-static field of `target`.\n\nThis overload supports class instances and tuple variables. The target expression is evaluated\nonce, and each specialized callback result is assigned directly back to its field.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 96 + }, + { + "kind": "function", + "name": "wurstNewInstance", + "typeParams": "", + "receiver": null, + "signature": "public function wurstNewInstance() returns T", + "doc": "Constructs the concrete class `T` through its accessible zero-argument constructor.\n\nThis is an intrinsic rather than runtime reflection. Consequently `T` must be known concretely\nat the call site and normal constructor visibility and abstract-class checks still apply.", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 104 } ] }, diff --git a/_doc/stdlib/ref/_handles/Unit.md b/_doc/stdlib/ref/_handles/Unit.md index 26ee122..3e1bed6 100644 --- a/_doc/stdlib/ref/_handles/Unit.md +++ b/_doc/stdlib/ref/_handles/Unit.md @@ -1028,6 +1028,8 @@ public function unit.setPathing(boolean value) public function unit.setPos(vec2 pos) ``` +> 🔧 **Configurable.** Override it in your map's config package. + ### unit.setPosFly ```wurst @@ -1046,6 +1048,8 @@ public function unit.setPosReal(vec3 pos) public function unit.setPos(real x, real y) ``` +> 🔧 **Configurable.** Override it in your map's config package. + ### unit.setPropWindow ```wurst @@ -1129,12 +1133,16 @@ public function unit.setVertexColor(int r, int g, int b, int a) public function unit.setX(real x) ``` +> 🔧 **Configurable.** Override it in your map's config package. + ### unit.setXY ```wurst public function unit.setXY(vec2 pos) ``` +> 🔧 **Configurable.** Override it in your map's config package. + Sets the coordinmates of the unit to the given position. Uses the SetUnitX/Y natives @@ -1144,6 +1152,8 @@ Sets the coordinmates of the unit to the given position. public function unit.setXY(vec3 pos) ``` +> 🔧 **Configurable.** Override it in your map's config package. + Sets the coordinmates of the unit to the given position. Uses the SetUnitX/Y natives @@ -1153,6 +1163,8 @@ Sets the coordinmates of the unit to the given position. public function unit.setXYZ(vec3 pos) ``` +> 🔧 **Configurable.** Override it in your map's config package. + Sets the coordinmates of the unit to the given position. Z is being set as flyheight. Uses the SetUnitX/Y natives @@ -1162,12 +1174,16 @@ Sets the coordinmates of the unit to the given position. public function unit.setXYZReal(vec3 pos) ``` +> 🔧 **Configurable.** Override it in your map's config package. + ### unit.setY ```wurst public function unit.setY(real y) ``` +> 🔧 **Configurable.** Override it in your map's config package. + ### unit.show ```wurst diff --git a/_doc/stdlib/ref/_wurst/Annotations.md b/_doc/stdlib/ref/_wurst/Annotations.md index 86f8aca..4c59d96 100644 --- a/_doc/stdlib/ref/_wurst/Annotations.md +++ b/_doc/stdlib/ref/_wurst/Annotations.md @@ -10,6 +10,11 @@ generated: true toc: sections --- +Marks a documented declaration whose calls are expanded by the compiler. + +Unlike a normal fallback declaration, this does not suppress intrinsic lowering. The declaration +exists so intrinsic APIs remain visible to completion, navigation, and documentation tools. + **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_wurst/Annotations.wurst)** ## Functions @@ -55,6 +60,12 @@ public function compiletimenative() Functions annotated with @compiletimenative are natives that are only available at compiletime, but not ingame. +### compilerintrinsic + +```wurst +public function compilerintrinsic() +``` + ### configurable ```wurst diff --git a/_doc/stdlib/ref/_wurst/MagicFunctions.md b/_doc/stdlib/ref/_wurst/MagicFunctions.md index 0c37fe9..a35216e 100644 --- a/_doc/stdlib/ref/_wurst/MagicFunctions.md +++ b/_doc/stdlib/ref/_wurst/MagicFunctions.md @@ -17,6 +17,34 @@ The called functions must not take any parameters. **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_wurst/MagicFunctions.wurst)** +## Interfaces + +### WurstFieldCallback + +```wurst +public interface WurstFieldCallback +``` + +Tooling signature used by the field-iteration compiler intrinsics. +The compiler specializes `value` to the concrete type of each visited field. + +**Members:** + +- `apply(string fieldName, int value)` + +### WurstFieldMapper + +```wurst +public interface WurstFieldMapper +``` + +Tooling signature used by the field-mapping compiler intrinsic. +The compiler specializes both the parameter and result to each concrete field type. + +**Members:** + +- `apply(string fieldName, int value) returns int` + ## Functions ### compileError @@ -66,6 +94,14 @@ If stack traces are disabled, this function returns the empty string. public function callFunctionsWithAnnotation(string _annotation) ``` +### preserveName + +```wurst +public function preserveName() +``` + +Prevents -opt name minification for a top-level function whose name is used externally. + ### compiletime ```wurst @@ -75,6 +111,62 @@ public function compiletime(T expr) returns T This is a builtin magic function. * It evaluates it's argument at compiletime and replaces the call with the result. +### wurstForFields + +```wurst +public function wurstForFields(WurstFieldCallback _callback) +``` + +Emits the callback once for every accessible non-static field of the enclosing class. + +The callback receives the source field name and its concrete value. This is compile-time code +generation: the generated Jass or Lua contains direct field accesses and no runtime reflection. +Use the explicit-target form `wurstForFields(target, callback)` for classes and tuples. + +### wurstForFields + +```wurst +public function wurstForFields(T _target, WurstFieldCallback _callback) +``` + +Emits the callback once for every accessible non-static field of `target`. + +This overload supports class instances and tuple values. The target expression is evaluated +once, and the compiler specializes the callback value to each field's concrete type. + +### wurstMapFields + +```wurst +public function wurstMapFields(WurstFieldMapper _callback) +``` + +Maps every accessible mutable non-static field of the enclosing class. + +Each callback result is assigned back to its field. Use the explicit-target form +`wurstMapFields(target, callback)` for classes and tuple variables. + +### wurstMapFields + +```wurst +public function wurstMapFields(T _target, WurstFieldMapper _callback) +``` + +Maps every accessible mutable non-static field of `target`. + +This overload supports class instances and tuple variables. The target expression is evaluated +once, and each specialized callback result is assigned directly back to its field. + +### wurstNewInstance + +```wurst +public function wurstNewInstance() returns T +``` + +Constructs the concrete class `T` through its accessible zero-argument constructor. + +This is an intrinsic rather than runtime reflection. Consequently `T` must be known concretely +at the call site and normal constructor visibility and abstract-class checks still apply. + ## Constants ### compiletime diff --git a/_doc/stdlib/ref/closures/ClosureTimers.md b/_doc/stdlib/ref/closures/ClosureTimers.md index 29a1b90..62f5408 100644 --- a/_doc/stdlib/ref/closures/ClosureTimers.md +++ b/_doc/stdlib/ref/closures/ClosureTimers.md @@ -141,9 +141,9 @@ Execute an action periodically. Example use: ```wurst - doPeriodically(0.5) cb -> + doPeriodically(0.5) (_) -> if i > 10 - destroy cb + destroy it ``` ### doPeriodicallyCounted @@ -157,7 +157,7 @@ execute an action periodically, with a limited amount of calls Example use: ```wurst - doPeriodicallyCounted(0.5, 100) cb -> + doPeriodicallyCounted(0.5, 100) (_) -> doSomething() ``` @@ -196,9 +196,9 @@ Execute an action periodically. Example use: ```wurst - someTimer.doPeriodically(0.5) cb -> + someTimer.doPeriodically(0.5) (_) -> if i > 10 - destroy cb + destroy it ``` ### timer.doPeriodicallyCounted @@ -213,7 +213,7 @@ execute an action periodically, with a limited amount of calls Example use: ```wurst - someTimer.doPeriodicallyCounted(0.5, 100) cb -> + someTimer.doPeriodicallyCounted(0.5, 100) (_) -> doSomething() ``` diff --git a/_doc/stdlib/ref/closures/SpatialIndexForDestructables.md b/_doc/stdlib/ref/closures/SpatialIndexForDestructables.md new file mode 100644 index 0000000..d0d2225 --- /dev/null +++ b/_doc/stdlib/ref/closures/SpatialIndexForDestructables.md @@ -0,0 +1,27 @@ +--- +title: SpatialIndexForDestructables +layout: stdlibref +category: closures +categoryLabel: Closures +tags: + - closures +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/SpatialIndexForDestructables.wurst' +generated: true +toc: sections +--- + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/SpatialIndexForDestructables.wurst)** + +## Functions + +### destructablesInRect + +```wurst +public function destructablesInRect(rect area) returns SparseSet +``` + +### destructablesInRange + +```wurst +public function destructablesInRange(vec2 center, real range) returns SparseSet +``` diff --git a/_doc/stdlib/ref/closures/SpatialIndexForUnits.md b/_doc/stdlib/ref/closures/SpatialIndexForUnits.md index 7ec797c..442ba75 100644 --- a/_doc/stdlib/ref/closures/SpatialIndexForUnits.md +++ b/_doc/stdlib/ref/closures/SpatialIndexForUnits.md @@ -38,10 +38,19 @@ public function unitsInBox(vec2 boxMin, vec2 boxMax) returns SparseSet Returns units whose origins are inside the axis-aligned box. +### unitsInRect + +```wurst +public function unitsInRect(rect area) returns SparseSet +``` + +Returns units matching GroupEnumUnitsInRect semantics for the given rect. + ### unitsOfPlayer ```wurst public function unitsOfPlayer(player owner) returns SparseSet ``` -Returns currently indexed units owned by owner. +Returns currently indexed units owned by owner. This is a linear registry scan; per-player + secondary sets are intentionally not maintained in this first iteration. diff --git a/_doc/stdlib/ref/data/IntMap.md b/_doc/stdlib/ref/data/IntMap.md new file mode 100644 index 0000000..54b053b --- /dev/null +++ b/_doc/stdlib/ref/data/IntMap.md @@ -0,0 +1,27 @@ +--- +title: IntMap +layout: stdlibref +category: data +categoryLabel: Data Structures +tags: + - data +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/IntMap.wurst' +generated: true +toc: sections +--- + +O(1) integer-keyed map with compiler-specialized value storage. + +JASS hashtables use integer child keys, so fixing the key type avoids an artificial generic +hash adapter while `V:` keeps strings, reals, booleans, handles, tuples, and class references +in typed arrays. Removal is unordered. The map does not own stored values. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/IntMap.wurst)** + +## Classes + +### IntMap + +```wurst +public class IntMap +``` diff --git a/_doc/stdlib/ref/data/SparseSet.md b/_doc/stdlib/ref/data/SparseSet.md index bff4e8b..f6a48ee 100644 --- a/_doc/stdlib/ref/data/SparseSet.md +++ b/_doc/stdlib/ref/data/SparseSet.md @@ -46,6 +46,14 @@ 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. +### DestructableSparseSetKey + +```wurst +public class DestructableSparseSetKey implements SparseSetKey +``` + +Key provider for destructable sets. + ## Interfaces ### SparseSetKey @@ -65,3 +73,11 @@ public constant SparseSetKey UNIT_SPARSE_SET_KEY = new UnitSparseSetKey() ``` Reusable key provider for SparseSet. + +### DESTRUCTABLE_SPARSE_SET_KEY + +```wurst +public constant SparseSetKey DESTRUCTABLE_SPARSE_SET_KEY = new DestructableSparseSetKey() +``` + +Reusable key provider for SparseSet. diff --git a/_doc/stdlib/ref/file/StructuredSerialization.md b/_doc/stdlib/ref/file/StructuredSerialization.md new file mode 100644 index 0000000..e81b76d --- /dev/null +++ b/_doc/stdlib/ref/file/StructuredSerialization.md @@ -0,0 +1,241 @@ +--- +title: StructuredSerialization +layout: stdlibref +category: file +categoryLabel: File & Network +tags: + - file +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerialization.wurst' +generated: true +toc: sections +--- + +Standard tuple codecs. + +Field names passed to these codecs are converted by `FieldSerializationWriter` to fixed-width +numeric IDs; names are not stored in the save string. Classes and tuples therefore use the same +wire representation and migration rules. The compiler does not derive persistence IDs from field +annotations; serialization metadata deliberately remains owned by this library. + +Custom tuples need three overloads because tuples cannot implement `FieldSerializable`. The field +intrinsics keep the codec concise and support mixed component types through overload resolution: + +``` +tuple InventorySlot(int itemId, int charges) + +public function FieldSerializationWriter.write(string name, InventorySlot value) +let child = new FieldSerializationWriter(1, this.getIntegrityKey()) +wurstForFields(value, (fieldName, fieldValue) -> child.write(fieldName, fieldValue)) +this.writeObject(name, child) + +public function FieldSerializationReader.read(string name, InventorySlot oldValue) returns InventorySlot +let child = this.readObject(name) +var result = oldValue +if child.isValid() + wurstMapFields(result, (fieldName, fieldValue) -> fieldValue.readSerializedField(child, fieldName)) +destroy child +return result + +public function InventorySlot.readSerializedField(FieldSerializationReader reader, string name) returns InventorySlot +return reader.read(name, this) + +class InventoryState implements FieldSerializable +use FieldSerializableLifecycle +InventorySlot slot = InventorySlot(0, 0) + +override function writeSerializedFields(FieldSerializationWriter writer) + wurstForFields((fieldName, fieldValue) -> writer.write(fieldName, fieldValue)) + +override function readSerializedFields(FieldSerializationReader reader) + wurstMapFields((fieldName, fieldValue) -> fieldValue.readSerializedField(reader, fieldName)) +``` + +`SerializableFields` can automatically use codecs declared by `StructuredSerialization`. For +package-local codecs, use `FieldSerializableLifecycle` and keep the two intrinsic mapping methods +in the same package as the overloads, as above. Nested custom tuples then compose once each tuple +type provides the three overloads. Keep component names stable. For tuple-specific schema changes, +increment the child writer's schema version and call `child.renameField(oldName, newName)` before +`wurstMapFields` when reading older versions. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerialization.wurst)** + +**Re-exports:** `StructuredSerializationCore` + +## Modules + +### FieldSerializableLifecycle + +```wurst +public module FieldSerializableLifecycle +``` + +Shared typed lifecycle for `FieldSerializable` classes that provide their own field mapping. + +Prefer `SerializableFields` when all field codecs come from `StructuredSerialization`. Use this +module when mapping fields in the class package is necessary, notably for package-local tuple +codecs. Implement `writeSerializedFields` and `readSerializedFields`; serialization, integrity, +migration, nested-object loading, and typed `load` remain provided here. + +**Members:** + +- `abstract function writeSerializedFields(FieldSerializationWriter writer)` +- `abstract function readSerializedFields(FieldSerializationReader reader)` +- `readSerializedField(FieldSerializationReader reader, string name) returns thistype` +- `serialize() returns ChunkedString` +- `serialize(int schemaVersion) returns ChunkedString` +- `serialize(int schemaVersion, int integrityKey) returns ChunkedString` +- `deserialize(ChunkedString input) returns boolean` +- `deserialize(ChunkedString input, int integrityKey) returns boolean` +- `deserialize(ChunkedString input, int integrityKey, SerializationMigration migration) returns boolean` +- `load(ChunkedString input) returns thistype` + Loads valid data into this instance and returns it for concise construction and chaining. + +### SerializableFieldMapping + +```wurst +public module SerializableFieldMapping +``` + +Automatic field mapping without adding a second `serialize`/`deserialize` lifecycle. + +Use this during a compatibility window when a data class still extends legacy `Serializable`, or +when another base class already owns lifecycle methods. The class must implement `FieldSerializable`. +All of its accessible mutable instance fields participate; keep runtime-only state in a separate +class because persisted-field annotation filtering is not available. + +**Members:** + +- `writeSerializedFields(FieldSerializationWriter writer)` +- `readSerializedFields(FieldSerializationReader reader)` +- `readSerializedField(FieldSerializationReader reader, string name) returns thistype` + +### SerializableFields + +```wurst +public module SerializableFields +``` + +Modern automatic serialization for dedicated state/DAO classes using built-in codecs. + +Add `implements FieldSerializable` and `use SerializableFields`. The compiler expands field +iteration to direct accesses. The tagged format tolerates field reordering, added/removed fields, +and unknown future wire types. Missing fields retain constructor defaults. Use a schema version and +`SerializationMigration` for semantic changes or `renameField` for renamed attributes. For custom +tuple codecs declared in the consuming package, use `FieldSerializableLifecycle` as documented +above so overload resolution occurs where those codecs are visible. Classes that must also retain +legacy `Serializable` should use `SerializableFieldMapping` to avoid conflicting lifecycle methods. + +**Members:** + +- `override function writeSerializedFields(FieldSerializationWriter writer)` +- `override function readSerializedFields(FieldSerializationReader reader)` + +## Extension Functions + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, vec2 value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, vec2 oldValue) returns vec2 +``` + +### vec2.readSerializedField + +```wurst +public function vec2.readSerializedField(FieldSerializationReader reader, string name) returns vec2 +``` + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, vec3 value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, vec3 oldValue) returns vec3 +``` + +### vec3.readSerializedField + +```wurst +public function vec3.readSerializedField(FieldSerializationReader reader, string name) returns vec3 +``` + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, angle value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, angle oldValue) returns angle +``` + +### angle.readSerializedField + +```wurst +public function angle.readSerializedField(FieldSerializationReader reader, string name) returns angle +``` + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, color value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, color oldValue) returns color +``` + +### color.readSerializedField + +```wurst +public function color.readSerializedField(FieldSerializationReader reader, string name) returns color +``` + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, colorA value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, colorA oldValue) returns colorA +``` + +### colorA.readSerializedField + +```wurst +public function colorA.readSerializedField(FieldSerializationReader reader, string name) returns colorA +``` + +### FieldSerializationWriter.write + +```wurst +public function FieldSerializationWriter.write(string name, colorHSV value) +``` + +### FieldSerializationReader.read + +```wurst +public function FieldSerializationReader.read(string name, colorHSV oldValue) returns colorHSV +``` + +### colorHSV.readSerializedField + +```wurst +public function colorHSV.readSerializedField(FieldSerializationReader reader, string name) returns colorHSV +``` diff --git a/_doc/stdlib/ref/file/StructuredSerializationCore.md b/_doc/stdlib/ref/file/StructuredSerializationCore.md new file mode 100644 index 0000000..4fe310e --- /dev/null +++ b/_doc/stdlib/ref/file/StructuredSerializationCore.md @@ -0,0 +1,182 @@ +--- +title: StructuredSerializationCore +layout: stdlibref +category: file +categoryLabel: File & Network +tags: + - file +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerializationCore.wurst' +generated: true +toc: sections +--- + +Default integrity key for structured saves. Override this in map configuration with a private, +map-specific value. It is intended to deter edited player save codes, not provide cryptographic +authentication against somebody who can inspect the map script. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/file/StructuredSerializationCore.wurst)** + +## Classes + +### FieldSerializationWriter + +```wurst +public class FieldSerializationWriter +``` + +Builds one compact, versioned structured-save envelope. + +**Members:** + +- `construct(int schemaVersion)` +- `construct(int schemaVersion, int integrityKey)` +- `writeRaw(string name, string token, string payload)` + Writes a future-compatible raw field. Custom token values should be one ASCII byte. +- `writeRaw(string name, string token, ChunkedString payload)` + Writes a raw field without flattening its chunked payload. The caller retains ownership. +- `write(string name, int value)` +- `write(string name, real value)` +- `write(string name, string value)` +- `write(string name, boolean value)` +- `getIntegrityKey() returns int` +- `write(string name, FieldSerializable value)` + Recursively writes an opted-in non-null class instance. +- `writeObject(string name, FieldSerializationWriter child)` + Writes and consumes a child writer as a nested class or tuple envelope. +- `finish() returns ChunkedString` + Completes the envelope. The returned value belongs to the caller. + +### FieldSerializationReader + +```wurst +public class FieldSerializationReader +``` + +Parsed field table. Unknown fields and wire tokens are retained and safely skippable. + +**Members:** + +- `construct()` +- `construct(ChunkedString input)` +- `construct(ChunkedString input, int integrityKey)` +- `isValid() returns boolean` +- `getSchemaVersion() returns int` +- `getIntegrityKey() returns int` +- `hasField(string name) returns boolean` +- `hasRaw(string name, string token) returns boolean` +- `readRaw(string name, string token, string oldValue) returns string` +- `readRawChunked(string name, string token) returns ChunkedString` + Returns an independent chunked copy of a raw payload, or `null` when the field/token is absent. + The caller owns and must destroy the returned value. +- `read(string name, int oldValue) returns int` +- `read(string name, real oldValue) returns real` +- `read(string name, string oldValue) returns string` +- `read(string name, boolean oldValue) returns boolean` +- `setRaw(string name, string token, string payload)` + Replaces or creates a decoded field during migration. +- `set(string name, int value)` +- `set(string name, real value)` +- `set(string name, string value)` +- `set(string name, boolean value)` +- `removeField(string name)` +- `readInto(string name, FieldSerializable oldValue) returns boolean` + Mutates an existing opted-in child object when a valid nested envelope is present. +- `readObject(string name) returns FieldSerializationReader` + Returns a nested reader borrowed from this reader, or an invalid reader when absent. +- `renameField(string oldName, string newName)` + Moves a persisted value from an old field name to a new one. Call this from a migration before + field mapping. Existing data under the new name wins, making repeated migrations idempotent. + +## Interfaces + +### SerializationMigration + +```wurst +public interface SerializationMigration +``` + +A parsed migration hook. Hooks are invoked but not destroyed by `deserialize`. + +**Members:** + +- `migrate(FieldSerializationReader reader)` + +### FieldSerializable + +```wurst +public interface FieldSerializable +``` + +Opt-in contract used for recursively serialized class fields. + +**Members:** + +- `writeSerializedFields(FieldSerializationWriter writer)` +- `readSerializedFields(FieldSerializationReader reader)` +- `readSerializedField(FieldSerializationReader reader, string name) returns thistype` + +## Functions + +### serializationFieldId + +```wurst +public function serializationFieldId(string name) returns int +``` + +Returns the stable, case-sensitive numeric ID used for a persisted field name. + +## Extension Functions + +### int.readSerializedField + +```wurst +public function int.readSerializedField(FieldSerializationReader reader, string name) returns int +``` + +Type-directed field readers used by the compiler-expanded mapper. + +### real.readSerializedField + +```wurst +public function real.readSerializedField(FieldSerializationReader reader, string name) returns real +``` + +### string.readSerializedField + +```wurst +public function string.readSerializedField(FieldSerializationReader reader, string name) returns string +``` + +### boolean.readSerializedField + +```wurst +public function boolean.readSerializedField(FieldSerializationReader reader, string name) returns boolean +``` + +## Constants + +### SERIALIZATION_FORMAT_VERSION + +```wurst +public constant SERIALIZATION_FORMAT_VERSION = 2 +``` + +Current tagged serialization wire format. + +### SERIALIZATION_INTEGRITY_KEY + +```wurst +public constant SERIALIZATION_INTEGRITY_KEY = 0x6D2B79F5 +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +### SERIALIZATION_REAL_DECIMALS + +```wurst +public constant SERIALIZATION_REAL_DECIMALS = 6 +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Decimal places retained for Jass `real` values. Trailing zeroes are removed on the wire. diff --git a/_doc/stdlib/ref/index.md b/_doc/stdlib/ref/index.md index 5cd061c..e9428d8 100644 --- a/_doc/stdlib/ref/index.md +++ b/_doc/stdlib/ref/index.md @@ -36,6 +36,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [HashList](/stdlib/ref/data/HashList.html): HashLists are used if you require quick contains operations - [HashMap](/stdlib/ref/data/HashMap.html): Generic Table Wrapper - [HashSet](/stdlib/ref/data/HashSet.html): Generic set implementation +- [IntMap](/stdlib/ref/data/IntMap.html): O(1) integer-keyed map with compiler-specialized value storage. - [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. @@ -52,6 +53,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [ClosureKeyPresses](/stdlib/ref/closures/ClosureKeyPresses.html) - [ClosureTimers](/stdlib/ref/closures/ClosureTimers.html): Execute an action after a certain time. - [Execute](/stdlib/ref/closures/Execute.html): This package exposes a single function execute(), +- [SpatialIndexForDestructables](/stdlib/ref/closures/SpatialIndexForDestructables.html) - [SpatialIndexForUnits](/stdlib/ref/closures/SpatialIndexForUnits.html) ## Events @@ -98,6 +100,8 @@ 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) +- [StructuredSerialization](/stdlib/ref/file/StructuredSerialization.html): Standard tuple codecs. +- [StructuredSerializationCore](/stdlib/ref/file/StructuredSerializationCore.html): Default integrity key for structured saves. - [SyncSimple](/stdlib/ref/file/SyncSimple.html): Generic sync listener for arbitrary types that can be cast to/from int. ## Utilities @@ -105,6 +109,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [Board](/stdlib/ref/util/Board.html): This Board library allows you to create a simple multi board with dynamic cell values. - [Cinematic](/stdlib/ref/util/Cinematic.html): Create a cinematic by composing cinematic sequences - [Colors](/stdlib/ref/util/Colors.html): Mixes two colors, s would be a number 0<=s<=1 that determines +- [DestructableSpatialIndex](/stdlib/ref/util/DestructableSpatialIndex.html): Static Lua spatial index for destructables. - [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): Seconds elapsed since map start. @@ -116,13 +121,14 @@ If you are choosing a capability, start with the [standard library overview](/st - [SafetyChecks](/stdlib/ref/util/SafetyChecks.html): Enables or disables various safety checks in miscellaneous libraries in Wurst. - [Simulate3dSound](/stdlib/ref/util/Simulate3dSound.html) - [SoundUtils](/stdlib/ref/util/SoundUtils.html) +- [SpatialPartition](/stdlib/ref/util/SpatialPartition.html): Cell-head slots the given extent would need, so a caller can size cells and groups before committing - [StandardTextTags](/stdlib/ref/util/StandardTextTags.html) - [StringUtils](/stdlib/ref/util/StringUtils.html): Returns the width of the string. - [TerrainUtils](/stdlib/ref/util/TerrainUtils.html) - [Time](/stdlib/ref/util/Time.html): Type-safe wrappers to distinguish durations (an amount of time) from instants (a point in time), and the valid ways - [TimerUtils](/stdlib/ref/util/TimerUtils.html): Get a new timer. - [UnitIndexer](/stdlib/ref/util/UnitIndexer.html): Returns the int index of this unit. -- [UnitSpatialIndex](/stdlib/ref/util/UnitSpatialIndex.html): Registers or re-buckets one unit immediately. +- [UnitSpatialIndex](/stdlib/ref/util/UnitSpatialIndex.html): Deprecated. - [UnitSpatialIndexRemoval](/stdlib/ref/util/UnitSpatialIndexRemoval.html) ## Handle Wrappers @@ -170,7 +176,7 @@ If you are choosing a capability, start with the [standard library overview](/st - [Abilities](/stdlib/ref/_wurst/Abilities.html) - [AbilityIds](/stdlib/ref/_wurst/AbilityIds.html) -- [Annotations](/stdlib/ref/_wurst/Annotations.html) +- [Annotations](/stdlib/ref/_wurst/Annotations.html): Marks a documented declaration whose calls are expanded by the compiler. - [Assets](/stdlib/ref/_wurst/Assets.html) - [AttachmentPoints](/stdlib/ref/_wurst/AttachmentPoints.html): Class that contains every known attachmentpoint in game - [Basics](/stdlib/ref/_wurst/Basics.html) diff --git a/_doc/stdlib/ref/util/DestructableSpatialIndex.md b/_doc/stdlib/ref/util/DestructableSpatialIndex.md new file mode 100644 index 0000000..ddf2c08 --- /dev/null +++ b/_doc/stdlib/ref/util/DestructableSpatialIndex.md @@ -0,0 +1,124 @@ +--- +title: DestructableSpatialIndex +layout: stdlibref +category: util +categoryLabel: Utilities +tags: + - util +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/DestructableSpatialIndex.wurst' +generated: true +toc: sections +--- + +Static Lua spatial index for destructables. + +Destructables do not have an observable movement event, so this index only needs registration +and removal hooks. Preplaced destructables are discovered once during initialization. Runtime +destructables created through CreateDestructable must call registerSpatialIndex() before they +can be queried. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/DestructableSpatialIndex.wurst)** + +## Functions + +### rebuildDestructableSpatialIndexGrid + +```wurst +public function rebuildDestructableSpatialIndexGrid(vec2 worldMin, vec2 worldMax) +``` + +Rebuilds the grid around the current membership. Useful after changing the configured map bounds. + +### destructableSpatialIndexBeginBoxQuery + +```wurst +public function destructableSpatialIndexBeginBoxQuery(vec2 boxMin, vec2 boxMax) returns int +``` + +Collects indexed destructables whose cached position is inside the axis-aligned box. + +### destructableSpatialIndexBeginRangeQuery + +```wurst +public function destructableSpatialIndexBeginRangeQuery(vec2 center, real range) returns int +``` + +Collects indexed destructables in the square used by forDestructablesInRange. + +### destructableSpatialIndexQuery + +```wurst +public function destructableSpatialIndexQuery(int i) returns destructable +``` + +### destructableSpatialIndexEndQuery + +```wurst +public function destructableSpatialIndexEndQuery() +``` + +### destructableSpatialIndexHealthy + +```wurst +public function destructableSpatialIndexHealthy() returns boolean +``` + +### destructableSpatialIndexTracked + +```wurst +public function destructableSpatialIndexTracked() returns int +``` + +### destructableSpatialIndexCellOf + +```wurst +public function destructableSpatialIndexCellOf(vec2 pos) returns int +``` + +### destructableSpatialIndexGridWidth + +```wurst +public function destructableSpatialIndexGridWidth() returns int +``` + +### destructableSpatialIndexGridHeight + +```wurst +public function destructableSpatialIndexGridHeight() returns int +``` + +## Extension Functions + +### destructable.registerSpatialIndex + +```wurst +public function destructable.registerSpatialIndex() +``` + +Registers one destructable in the index. + +### destructable.unregisterSpatialIndex + +```wurst +public function destructable.unregisterSpatialIndex() +``` + +Removes one destructable from the index before RemoveDestructable is called. + +## Constants + +### USE_DESTRUCTABLE_SPATIAL_INDEX + +```wurst +public constant USE_DESTRUCTABLE_SPATIAL_INDEX = true +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +### DESTRUCTABLE_SPATIAL_INDEX_CELL_SIZE + +```wurst +public constant DESTRUCTABLE_SPATIAL_INDEX_CELL_SIZE = 256. +``` + +> 🔧 **Configurable.** Override it in your map's config package. diff --git a/_doc/stdlib/ref/util/SpatialPartition.md b/_doc/stdlib/ref/util/SpatialPartition.md new file mode 100644 index 0000000..2092265 --- /dev/null +++ b/_doc/stdlib/ref/util/SpatialPartition.md @@ -0,0 +1,367 @@ +--- +title: SpatialPartition +layout: stdlibref +category: util +categoryLabel: Utilities +tags: + - util +source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/SpatialPartition.wurst' +generated: true +toc: sections +--- + +Cell-head slots the given extent would need, so a caller can size cells and groups before committing +to it - or -1 when that count is not representable, which is itself a reason to refuse the extent. + +Computed with divisions rather than by multiplying and inspecting the result: at a small cell size +the product overflows, and a wrapped negative reads as "comfortably within budget" to any comparison +made afterwards. + +**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/SpatialPartition.wurst)** + +## Functions + +### spatialPartitionCellOf + +```wurst +public function spatialPartitionCellOf(vec2 pos) returns int +``` + +Fine cell for a position, for tests and diagnostics. + +### spatialPartitionGridWidth + +```wurst +public function spatialPartitionGridWidth() returns int +``` + +### spatialPartitionGridHeight + +```wurst +public function spatialPartitionGridHeight() returns int +``` + +### spatialPartitionCoarseWidth + +```wurst +public function spatialPartitionCoarseWidth() returns int +``` + +### spatialPartitionCellSlotCount + +```wurst +public function spatialPartitionCellSlotCount() returns int +``` + +Flattened cell-head slots the current grid occupies: one per cell per group. On Jass this must stay +within `JASS_MAX_ARRAY_SIZE`; on Lua arrays grow and it is only a memory figure. + +### spatialPartitionRequiredCellSlots + +```wurst +public function spatialPartitionRequiredCellSlots(vec2 worldMin, vec2 worldMax) returns int +``` + +### spatialPartitionExtentFits + +```wurst +public function spatialPartitionExtentFits(vec2 worldMin, vec2 worldMax) returns boolean +``` + +Whether an extent's cell storage is both representable and within this target's array limit. + +### spatialPartitionLastQueryVisits + +```wurst +public function spatialPartitionLastQueryVisits() returns int +``` + +Entries the last query walked, whether or not they matched. + +### spatialPartitionLastQueryBlocksSkipped + +```wurst +public function spatialPartitionLastQueryBlocksSkipped() returns int +``` + +Coarse blocks the last query rejected without descending into their cells. + +### spatialPartitionMaxEntryId + +```wurst +public function spatialPartitionMaxEntryId() returns int +``` + +Largest usable entry id on this target. Whichever of the two ceilings binds first: the flattened +per-entry links, or the snapshot with every query level open at once. Effectively unbounded on Lua. + +### spatialPartitionIsValidEntryId + +```wurst +public function spatialPartitionIsValidEntryId(int id) returns boolean +``` + +Whether an id may be used as an entry. Ids are 1-based, because 0 is reserved as the chain +sentinel, and bounded above on Jass by what the flattened entry slots can address. + +### spatialPartitionIsValidGroupId + +```wurst +public function spatialPartitionIsValidGroupId(int groupId) returns boolean +``` + +Whether a group id addresses a real group. + +### spatialPartitionAllocateEntryId + +```wurst +public function spatialPartitionAllocateEntryId() returns int +``` + +Reserves an entry id no other consumer will be handed. Release it with +`spatialPartitionReleaseEntryId` after removing the entry, or ids are never reused. Answers 0 when +the target's id space is exhausted, which a caller must treat as "cannot index this". + +### spatialPartitionEntryIdIsReserved + +```wurst +public function spatialPartitionEntryIdIsReserved(int id) returns boolean +``` + +Whether an id is currently handed out to some consumer. + +### spatialPartitionReleaseEntryId + +```wurst +public function spatialPartitionReleaseEntryId(int id) +``` + +Returns an id to the pool. The entry must already be removed: recycling one that is still linked +would hand a live row to the next caller. + +### spatialPartitionAllocatedEntryIds + +```wurst +public function spatialPartitionAllocatedEntryIds() returns int +``` + +Highest id in use across every consumer, which is what the arrays keyed by an id are sized to. +Not the fresh-allocation cursor: a high row taken directly and later recycled is handed out again +from the free list without the cursor ever reaching it, so the cursor can read far below the rows +that are actually live. + +### spatialPartitionAllocateGroup + +```wurst +public function spatialPartitionAllocateGroup() returns int +``` + +Reserves a group no other consumer will be given, or -1 when none are left. Hold on to it: groups +are long-lived, there is no release, and asking twice consumes two. + +### spatialPartitionGroupIsReserved + +```wurst +public function spatialPartitionGroupIsReserved(int groupId) returns boolean +``` + +Whether a group has been claimed, by the allocator or by being used directly. + +### spatialPartitionIsReady + +```wurst +public function spatialPartitionIsReady() returns boolean +``` + +Whether the grid has been given an extent yet. Nothing can be linked before it has. + +### spatialPartitionIsValidExtent + +```wurst +public function spatialPartitionIsValidExtent(vec2 worldMin, vec2 worldMax) returns boolean +``` + +Whether an extent describes a real area. An inverted axis yields a zero or negative dimension, and +the coarse block index divides by the grid width, so this has to be caught before any state moves. + +### spatialPartitionSetPos + +```wurst +public function spatialPartitionSetPos(int id, real x, real y) +``` + +Records where an entry is, re-bucketing it in every group it belongs to. Call this before adding +the entry to any group, and again whenever it has moved. + +### spatialPartitionSetGroup + +```wurst +public function spatialPartitionSetGroup(int id, int groupId, boolean member) +``` + +Adds or removes an entry from one group. The caller owns the policy of when membership changes, +which keeps predicate evaluation out of the walk entirely. + +### spatialPartitionEntryX + +```wurst +public function spatialPartitionEntryX(int id) returns real +``` + +Cached x of an entry, so a consumer can re-decide an uncertain result under its own staleness + model before paying for a live position. Zero for an id the partition does not hold. + +### spatialPartitionEntryY + +```wurst +public function spatialPartitionEntryY(int id) returns real +``` + +Cached y of an entry. See `spatialPartitionEntryX`. + +### spatialPartitionInGroup + +```wurst +public function spatialPartitionInGroup(int id, int groupId) returns boolean +``` + +Whether an entry is currently in a group. + +### spatialPartitionRemove + +```wurst +public function spatialPartitionRemove(int id) +``` + +Drops an entry from every group. Call before recycling its id, or a later entry inherits it. + +### spatialPartitionEntryCount + +```wurst +public function spatialPartitionEntryCount() returns int +``` + +Live entries the partition holds. + +### spatialPartitionClear + +```wurst +public function spatialPartitionClear() +``` + +Drops every entry and every group link, across every consumer - the partition has one population, +not one per group. A layer that wants to drop only its own entries removes them by id; there is no +way to ask for that here, because groups say what a query sees, not who owns a row. Ids are not +returned to the allocator either, so a consumer that clears must release the ones it held. + +### rebuildSpatialPartition + +```wurst +public function rebuildSpatialPartition(vec2 worldMin, vec2 worldMax) +``` + +Re-derives the extent and re-links every entry into the new grid, keeping the groups they were in. + +Every cell index means something different afterwards, so this cannot just clear the heads: an +entry still carrying its old link would be invisible to the new grid and would corrupt the chain it +is eventually unlinked from. + +### spatialPartitionBeginRangeQuery + +```wurst +public function spatialPartitionBeginRangeQuery(vec2 center, real radius, real maxDisplacement, int groupId) returns int +``` + +Collects the members of `groupId` within `radius` of the point, allowing for entries whose cached +position may be up to `maxDisplacement` out of date. + +Certainly-in and certainly-out are settled from the cached position alone. Entries in the +`maxDisplacement`-wide band around the boundary cannot be decided from stale data, so they come +back flagged: check `spatialPartitionQueryUncertain(i)` and resolve those against a live position. +Pass a zero displacement and no result is ever flagged. + +Must be paired with `spatialPartitionEndQuery()`. + +### spatialPartitionBeginBoxQuery + +```wurst +public function spatialPartitionBeginBoxQuery(vec2 boxMin, vec2 boxMax, real maxDisplacement, int groupId) returns int +``` + +Collects the members of `groupId` inside the axis-aligned box, allowing for entries whose cached +position may be up to `maxDisplacement` out of date. + +Same three-way split as the range query, applied per axis: a cached position more than +`maxDisplacement` outside the box cannot be inside it, one that far within cannot be outside, and +the band between is flagged for the caller to resolve. Pass a zero displacement and nothing is +flagged. + +Must be paired with `spatialPartitionEndQuery()`. + +### spatialPartitionQueryId + +```wurst +public function spatialPartitionQueryId(int i) returns int +``` + +Entry id `i` of the innermost active query, or 0 if there is no such result. + +### spatialPartitionQueryUncertain + +```wurst +public function spatialPartitionQueryUncertain(int i) returns boolean +``` + +Whether entry `i` could not be decided from its cached position and needs a live check against the +requested radius. Always false when the query passed a zero displacement. + +### spatialPartitionEndQuery + +```wurst +public function spatialPartitionEndQuery() +``` + +## Constants + +### SPATIAL_PARTITION_CELL_SIZE + +```wurst +public constant SPATIAL_PARTITION_CELL_SIZE = 256. +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Fine cell edge in world units. Smaller tightens windows but walks more cells. + +### SPATIAL_PARTITION_COARSE_FACTOR + +```wurst +public constant SPATIAL_PARTITION_COARSE_FACTOR = 8 +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Fine cells per coarse block edge, so 8 means a block covers 8x8 cells. The coarse level exists so +a large query skips empty regions with one test per block instead of one per cell. + +### SPATIAL_PARTITION_MAX_GROUPS + +```wurst +public constant SPATIAL_PARTITION_MAX_GROUPS = 8 +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Concurrently declared groups. Each costs one chain pointer per entry and one head per cell, so +raise it only as far as a project uses. + +### SPATIAL_PARTITION_MAX_QUERY_DEPTH + +```wurst +public constant SPATIAL_PARTITION_MAX_QUERY_DEPTH = 8 +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Deepest nesting of simultaneously open queries. Every open level keeps its own results in the shared +snapshot, so this multiplies snapshot storage and is part of the capacity budget below. diff --git a/_doc/stdlib/ref/util/UnitSpatialIndex.md b/_doc/stdlib/ref/util/UnitSpatialIndex.md index 038aef1..3f99e14 100644 --- a/_doc/stdlib/ref/util/UnitSpatialIndex.md +++ b/_doc/stdlib/ref/util/UnitSpatialIndex.md @@ -10,9 +10,12 @@ generated: true toc: sections --- -Registers or re-buckets one unit immediately. Ordinary movement does not need this - the sweep -covers it - but an engine-side teleport or a raw `SetUnitX` call does, because neither is -observable. +Deprecated. Cell geometry belongs to the shared grid now, so `SPATIAL_PARTITION_CELL_SIZE` is the +setting; one grid cannot have a second cell size for units alone. + +Kept exported so an existing `UnitSpatialIndex_config` still compiles, and defaulted to agree. It +is checked at init rather than ignored: a map that had tuned this and upgrades gets told its +value is no longer in effect, instead of quietly running on a different grid. **[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/util/UnitSpatialIndex.wurst)** @@ -56,7 +59,9 @@ How many units the sweep currently cycles over. public function spatialIndexAllocatedSlots() returns int ``` -Allocated cache slots; ID reuse keeps this at peak concurrent population. +Allocated cache slots; ID reuse keeps this at peak concurrent population. Ids are shared across +partition consumers now, so this counts every entry id handed out, not only this layer's - which +is the right figure for the arrays here, since they are indexed by that same id. ### spatialIndexPadCells @@ -74,6 +79,10 @@ public function rebuildSpatialIndexGrid(vec2 worldMin, vec2 worldMax) Rebuilds the extent and re-buckets all units. Unguarded so grid math remains testable on Jass. +The grid is shared, so this re-derives it for every partition consumer, not only for units: there +is one extent, and an entry linked under the old cell indices would be invisible to the new grid. +That is why the rebuild re-links everything rather than only this layer's entries. + ### spatialIndexCellOf ```wurst @@ -151,6 +160,10 @@ Closes the innermost open query and releases its snapshot. public function unit.updateSpatialIndex() ``` +Registers or re-buckets one unit immediately. Ordinary movement does not need this - the sweep +covers it - but an engine-side teleport or a raw `SetUnitX` call does, because neither is +observable. + ## Constants ### USE_UNIT_SPATIAL_INDEX @@ -163,25 +176,25 @@ public constant USE_UNIT_SPATIAL_INDEX = true Master switch; override from `UnitSpatialIndex_config` to disable the native-less index. -### SPATIAL_INDEX_CELL_SIZE +### SPATIAL_INDEX_UNITS_PER_TICK ```wurst -public constant SPATIAL_INDEX_CELL_SIZE = 256. +public constant SPATIAL_INDEX_UNITS_PER_TICK = 128 ``` > 🔧 **Configurable.** Override it in your map's config package. -Grid cell edge in world units; smaller cells tighten windows but increase cells walked. +Units re-bucketed per tick; raising this shortens the cycle and query padding. -### SPATIAL_INDEX_UNITS_PER_TICK +### SPATIAL_INDEX_SWEEP_PERIOD ```wurst -public constant SPATIAL_INDEX_UNITS_PER_TICK = 128 +public constant SPATIAL_INDEX_SWEEP_PERIOD = ANIMATION_PERIOD ``` > 🔧 **Configurable.** Override it in your map's config package. -Units re-bucketed per tick; raising this shortens the cycle and query padding. +Time between sweep steps. Raising this reduces timer and refresh work but increases query padding. ### SPATIAL_INDEX_MAX_UNIT_SPEED @@ -202,3 +215,11 @@ public constant SPATIAL_INDEX_CHECK_HIDDEN = true > 🔧 **Configurable.** Override it in your map's config package. Disable when hidden units are never used to save one native per hit. + +### SPATIAL_INDEX_CELL_SIZE + +```wurst +public constant SPATIAL_INDEX_CELL_SIZE = SPATIAL_PARTITION_CELL_SIZE +``` + +> 🔧 **Configurable.** Override it in your map's config package.