diff --git a/_data/stdlib_index.json b/_data/stdlib_index.json index 8cb0fcc..ea57b68 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 } ] }, @@ -127828,6 +127954,1437 @@ } ] }, + { + "package": "StructuredSerialization", + "category": "file", + "categoryLabel": "File & Network", + "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": [ + "StructuredSerializationCore" + ], + "entities": [ + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, vec2 value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 59 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, vec2 oldValue) returns vec2", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 65 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "vec2", + "signature": "public function vec2.readSerializedField(FieldSerializationReader reader, string name) returns vec2", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 71 + }, + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, vec3 value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 74 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, vec3 oldValue) returns vec3", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 81 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "vec3", + "signature": "public function vec3.readSerializedField(FieldSerializationReader reader, string name) returns vec3", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 87 + }, + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, angle value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 90 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, angle oldValue) returns angle", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 95 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "angle", + "signature": "public function angle.readSerializedField(FieldSerializationReader reader, string name) returns angle", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 101 + }, + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, color value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 104 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, color oldValue) returns color", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 111 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "color", + "signature": "public function color.readSerializedField(FieldSerializationReader reader, string name) returns color", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 117 + }, + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, colorA value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 120 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, colorA oldValue) returns colorA", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 128 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "colorA", + "signature": "public function colorA.readSerializedField(FieldSerializationReader reader, string name) returns colorA", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 134 + }, + { + "kind": "extension-function", + "name": "write", + "typeParams": "", + "receiver": "FieldSerializationWriter", + "signature": "public function FieldSerializationWriter.write(string name, colorHSV value)", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 137 + }, + { + "kind": "extension-function", + "name": "read", + "typeParams": "", + "receiver": "FieldSerializationReader", + "signature": "public function FieldSerializationReader.read(string name, colorHSV oldValue) returns colorHSV", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 144 + }, + { + "kind": "extension-function", + "name": "readSerializedField", + "typeParams": "", + "receiver": "colorHSV", + "signature": "public function colorHSV.readSerializedField(FieldSerializationReader reader, string name) returns colorHSV", + "doc": "", + "deprecated": { + "flag": false, + "message": null + }, + "configurable": false, + "members": [], + "enumMembers": [], + "line": 150 + }, + { + "kind": "module", + "name": "FieldSerializableLifecycle", + "typeParams": "", + "receiver": null, + "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": [ + { + "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", @@ -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 } ] }, @@ -133296,6 +135092,22 @@ "enumMembers": [], "line": 22 }, + { + "kind": "constant", + "name": "SPATIAL_INDEX_SWEEP_PERIOD", + "typeParams": "", + "receiver": null, + "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 + }, + "configurable": true, + "members": [], + "enumMembers": [], + "line": 25 + }, { "kind": "constant", "name": "SPATIAL_INDEX_MAX_UNIT_SPEED", @@ -133310,7 +135122,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 25 + "line": 28 }, { "kind": "constant", @@ -133326,7 +135138,7 @@ "configurable": true, "members": [], "enumMembers": [], - "line": 28 + "line": 31 }, { "kind": "extension-function", @@ -133342,7 +135154,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 191 + "line": 194 }, { "kind": "function", @@ -133358,7 +135170,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 257 + "line": 260 }, { "kind": "function", @@ -133374,7 +135186,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 263 + "line": 266 }, { "kind": "function", @@ -133390,7 +135202,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 267 + "line": 270 }, { "kind": "function", @@ -133406,7 +135218,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 271 + "line": 274 }, { "kind": "function", @@ -133422,7 +135234,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 275 + "line": 278 }, { "kind": "function", @@ -133438,7 +135250,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 279 + "line": 282 }, { "kind": "function", @@ -133454,7 +135266,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 283 + "line": 286 }, { "kind": "function", @@ -133470,7 +135282,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 301 + "line": 304 }, { "kind": "function", @@ -133486,7 +135298,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 305 + "line": 308 }, { "kind": "function", @@ -133502,7 +135314,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 308 + "line": 311 }, { "kind": "function", @@ -133518,7 +135330,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 327 + "line": 330 }, { "kind": "function", @@ -133534,7 +135346,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 386 + "line": 389 }, { "kind": "function", @@ -133550,7 +135362,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 439 + "line": 442 }, { "kind": "function", @@ -133566,7 +135378,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 449 + "line": 452 }, { "kind": "function", @@ -133582,7 +135394,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 453 + "line": 456 } ] }, @@ -155158,7 +156970,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 542 @@ -155206,7 +157018,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 553 @@ -155414,7 +157226,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 596 @@ -155430,7 +157242,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 601 @@ -155446,7 +157258,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 606 @@ -155462,7 +157274,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 611 @@ -155478,7 +157290,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 615 @@ -155494,7 +157306,7 @@ "flag": false, "message": null }, - "configurable": false, + "configurable": true, "members": [], "enumMembers": [], "line": 620 @@ -157799,8 +159611,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 +159698,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 +159728,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 25 + "line": 33 }, { "kind": "function", @@ -157916,7 +159744,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 28 + "line": 36 }, { "kind": "function", @@ -157932,7 +159760,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 31 + "line": 39 }, { "kind": "function", @@ -157948,7 +159776,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 34 + "line": 42 }, { "kind": "function", @@ -157964,7 +159792,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 37 + "line": 45 }, { "kind": "function", @@ -157980,7 +159808,7 @@ "configurable": false, "members": [], "enumMembers": [], - "line": 40 + "line": 48 } ] }, @@ -158715,6 +160543,152 @@ "members": [], "enumMembers": [], "line": 49 + }, + { + "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": 55 + } + ], + "enumMembers": [], + "line": 54 + }, + { + "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": 60 + } + ], + "enumMembers": [], + "line": 59 + }, + { + "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": 69 + }, + { + "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": 77 + }, + { + "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": 85 + }, + { + "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": 93 + }, + { + "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": 101 } ] }, 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..8370d71 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 @@ -75,6 +103,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..213e037 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. @@ -170,7 +175,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/UnitSpatialIndex.md b/_doc/stdlib/ref/util/UnitSpatialIndex.md index 038aef1..c2dc280 100644 --- a/_doc/stdlib/ref/util/UnitSpatialIndex.md +++ b/_doc/stdlib/ref/util/UnitSpatialIndex.md @@ -183,6 +183,16 @@ public constant SPATIAL_INDEX_UNITS_PER_TICK = 128 Units re-bucketed per tick; raising this shortens the cycle and query padding. +### SPATIAL_INDEX_SWEEP_PERIOD + +```wurst +public constant SPATIAL_INDEX_SWEEP_PERIOD = ANIMATION_PERIOD +``` + +> 🔧 **Configurable.** Override it in your map's config package. + +Time between sweep steps. Raising this reduces timer and refresh work but increases query padding. + ### SPATIAL_INDEX_MAX_UNIT_SPEED ```wurst