Skip to content

Commit 4f170c2

Browse files
Frottygithub-actions[bot]
authored andcommitted
docs(stdlib): regenerate API reference
1 parent fa4647a commit 4f170c2

14 files changed

Lines changed: 2807 additions & 81 deletions

_data/stdlib_index.json

Lines changed: 2047 additions & 73 deletions
Large diffs are not rendered by default.

_doc/stdlib/ref/_handles/Unit.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,8 @@ public function unit.setPathing(boolean value)
10281028
public function unit.setPos(vec2 pos)
10291029
```
10301030

1031+
> 🔧 **Configurable.** Override it in your map's config package.
1032+
10311033
### unit.setPosFly
10321034

10331035
```wurst
@@ -1046,6 +1048,8 @@ public function unit.setPosReal(vec3 pos)
10461048
public function unit.setPos(real x, real y)
10471049
```
10481050

1051+
> 🔧 **Configurable.** Override it in your map's config package.
1052+
10491053
### unit.setPropWindow
10501054

10511055
```wurst
@@ -1129,12 +1133,16 @@ public function unit.setVertexColor(int r, int g, int b, int a)
11291133
public function unit.setX(real x)
11301134
```
11311135

1136+
> 🔧 **Configurable.** Override it in your map's config package.
1137+
11321138
### unit.setXY
11331139

11341140
```wurst
11351141
public function unit.setXY(vec2 pos)
11361142
```
11371143

1144+
> 🔧 **Configurable.** Override it in your map's config package.
1145+
11381146
Sets the coordinmates of the unit to the given position.
11391147
Uses the SetUnitX/Y natives
11401148

@@ -1144,6 +1152,8 @@ Sets the coordinmates of the unit to the given position.
11441152
public function unit.setXY(vec3 pos)
11451153
```
11461154

1155+
> 🔧 **Configurable.** Override it in your map's config package.
1156+
11471157
Sets the coordinmates of the unit to the given position.
11481158
Uses the SetUnitX/Y natives
11491159

@@ -1153,6 +1163,8 @@ Sets the coordinmates of the unit to the given position.
11531163
public function unit.setXYZ(vec3 pos)
11541164
```
11551165

1166+
> 🔧 **Configurable.** Override it in your map's config package.
1167+
11561168
Sets the coordinmates of the unit to the given position.
11571169
Z is being set as flyheight. Uses the SetUnitX/Y natives
11581170

@@ -1162,12 +1174,16 @@ Sets the coordinmates of the unit to the given position.
11621174
public function unit.setXYZReal(vec3 pos)
11631175
```
11641176

1177+
> 🔧 **Configurable.** Override it in your map's config package.
1178+
11651179
### unit.setY
11661180

11671181
```wurst
11681182
public function unit.setY(real y)
11691183
```
11701184

1185+
> 🔧 **Configurable.** Override it in your map's config package.
1186+
11711187
### unit.show
11721188

11731189
```wurst

_doc/stdlib/ref/_wurst/Annotations.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ generated: true
1010
toc: sections
1111
---
1212

13+
Marks a documented declaration whose calls are expanded by the compiler.
14+
15+
Unlike a normal fallback declaration, this does not suppress intrinsic lowering. The declaration
16+
exists so intrinsic APIs remain visible to completion, navigation, and documentation tools.
17+
1318
**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_wurst/Annotations.wurst)**
1419

1520
## Functions
@@ -55,6 +60,12 @@ public function compiletimenative()
5560

5661
Functions annotated with @compiletimenative are natives that are only available at compiletime, but not ingame.
5762

63+
### compilerintrinsic
64+
65+
```wurst
66+
public function compilerintrinsic()
67+
```
68+
5869
### configurable
5970

6071
```wurst

_doc/stdlib/ref/_wurst/MagicFunctions.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@ The called functions must not take any parameters.
1717

1818
**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/_wurst/MagicFunctions.wurst)**
1919

20+
## Interfaces
21+
22+
### WurstFieldCallback
23+
24+
```wurst
25+
public interface WurstFieldCallback
26+
```
27+
28+
Tooling signature used by the field-iteration compiler intrinsics.
29+
The compiler specializes `value` to the concrete type of each visited field.
30+
31+
**Members:**
32+
33+
- `apply(string fieldName, int value)`
34+
35+
### WurstFieldMapper
36+
37+
```wurst
38+
public interface WurstFieldMapper
39+
```
40+
41+
Tooling signature used by the field-mapping compiler intrinsic.
42+
The compiler specializes both the parameter and result to each concrete field type.
43+
44+
**Members:**
45+
46+
- `apply(string fieldName, int value) returns int`
47+
2048
## Functions
2149

2250
### compileError
@@ -75,6 +103,62 @@ public function compiletime<T:>(T expr) returns T
75103
This is a builtin magic function.
76104
* It evaluates it's argument at compiletime and replaces the call with the result.
77105

106+
### wurstForFields
107+
108+
```wurst
109+
public function wurstForFields(WurstFieldCallback _callback)
110+
```
111+
112+
Emits the callback once for every accessible non-static field of the enclosing class.
113+
114+
The callback receives the source field name and its concrete value. This is compile-time code
115+
generation: the generated Jass or Lua contains direct field accesses and no runtime reflection.
116+
Use the explicit-target form `wurstForFields(target, callback)` for classes and tuples.
117+
118+
### wurstForFields
119+
120+
```wurst
121+
public function wurstForFields<T:>(T _target, WurstFieldCallback _callback)
122+
```
123+
124+
Emits the callback once for every accessible non-static field of `target`.
125+
126+
This overload supports class instances and tuple values. The target expression is evaluated
127+
once, and the compiler specializes the callback value to each field's concrete type.
128+
129+
### wurstMapFields
130+
131+
```wurst
132+
public function wurstMapFields(WurstFieldMapper _callback)
133+
```
134+
135+
Maps every accessible mutable non-static field of the enclosing class.
136+
137+
Each callback result is assigned back to its field. Use the explicit-target form
138+
`wurstMapFields(target, callback)` for classes and tuple variables.
139+
140+
### wurstMapFields
141+
142+
```wurst
143+
public function wurstMapFields<T:>(T _target, WurstFieldMapper _callback)
144+
```
145+
146+
Maps every accessible mutable non-static field of `target`.
147+
148+
This overload supports class instances and tuple variables. The target expression is evaluated
149+
once, and each specialized callback result is assigned directly back to its field.
150+
151+
### wurstNewInstance
152+
153+
```wurst
154+
public function wurstNewInstance<T:>() returns T
155+
```
156+
157+
Constructs the concrete class `T` through its accessible zero-argument constructor.
158+
159+
This is an intrinsic rather than runtime reflection. Consequently `T` must be known concretely
160+
at the call site and normal constructor visibility and abstract-class checks still apply.
161+
78162
## Constants
79163

80164
### compiletime

_doc/stdlib/ref/closures/ClosureTimers.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ Execute an action periodically.
141141

142142
Example use:
143143
```wurst
144-
doPeriodically(0.5) cb ->
144+
doPeriodically(0.5) (_) ->
145145
if i > 10
146-
destroy cb
146+
destroy it
147147
```
148148

149149
### doPeriodicallyCounted
@@ -157,7 +157,7 @@ execute an action periodically, with a limited amount of calls
157157

158158
Example use:
159159
```wurst
160-
doPeriodicallyCounted(0.5, 100) cb ->
160+
doPeriodicallyCounted(0.5, 100) (_) ->
161161
doSomething()
162162
```
163163

@@ -196,9 +196,9 @@ Execute an action periodically.
196196

197197
Example use:
198198
```wurst
199-
someTimer.doPeriodically(0.5) cb ->
199+
someTimer.doPeriodically(0.5) (_) ->
200200
if i > 10
201-
destroy cb
201+
destroy it
202202
```
203203

204204
### timer.doPeriodicallyCounted
@@ -213,7 +213,7 @@ execute an action periodically, with a limited amount of calls
213213

214214
Example use:
215215
```wurst
216-
someTimer.doPeriodicallyCounted(0.5, 100) cb ->
216+
someTimer.doPeriodicallyCounted(0.5, 100) (_) ->
217217
doSomething()
218218
```
219219

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: SpatialIndexForDestructables
3+
layout: stdlibref
4+
category: closures
5+
categoryLabel: Closures
6+
tags:
7+
- closures
8+
source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/SpatialIndexForDestructables.wurst'
9+
generated: true
10+
toc: sections
11+
---
12+
13+
**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/closures/SpatialIndexForDestructables.wurst)**
14+
15+
## Functions
16+
17+
### destructablesInRect
18+
19+
```wurst
20+
public function destructablesInRect(rect area) returns SparseSet<destructable>
21+
```
22+
23+
### destructablesInRange
24+
25+
```wurst
26+
public function destructablesInRange(vec2 center, real range) returns SparseSet<destructable>
27+
```

_doc/stdlib/ref/closures/SpatialIndexForUnits.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,19 @@ public function unitsInBox(vec2 boxMin, vec2 boxMax) returns SparseSet<unit>
3838

3939
Returns units whose origins are inside the axis-aligned box.
4040

41+
### unitsInRect
42+
43+
```wurst
44+
public function unitsInRect(rect area) returns SparseSet<unit>
45+
```
46+
47+
Returns units matching GroupEnumUnitsInRect semantics for the given rect.
48+
4149
### unitsOfPlayer
4250

4351
```wurst
4452
public function unitsOfPlayer(player owner) returns SparseSet<unit>
4553
```
4654

47-
Returns currently indexed units owned by owner.
55+
Returns currently indexed units owned by owner. This is a linear registry scan; per-player
56+
secondary sets are intentionally not maintained in this first iteration.

_doc/stdlib/ref/data/IntMap.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: IntMap
3+
layout: stdlibref
4+
category: data
5+
categoryLabel: Data Structures
6+
tags:
7+
- data
8+
source: 'https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/IntMap.wurst'
9+
generated: true
10+
toc: sections
11+
---
12+
13+
O(1) integer-keyed map with compiler-specialized value storage.
14+
15+
JASS hashtables use integer child keys, so fixing the key type avoids an artificial generic
16+
hash adapter while `V:` keeps strings, reals, booleans, handles, tuples, and class references
17+
in typed arrays. Removal is unordered. The map does not own stored values.
18+
19+
**[Source on GitHub](https://github.com/wurstscript/WurstStdlib2/blob/master/wurst/data/IntMap.wurst)**
20+
21+
## Classes
22+
23+
### IntMap
24+
25+
```wurst
26+
public class IntMap<V:>
27+
```

_doc/stdlib/ref/data/SparseSet.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ IDs. That matches native groups: membership is not automatically removed
4646
when a unit is deindexed. SparseSet validates the stored unit when a key is
4747
reused, so a new unit cannot silently inherit stale membership.
4848

49+
### DestructableSparseSetKey
50+
51+
```wurst
52+
public class DestructableSparseSetKey implements SparseSetKey<destructable>
53+
```
54+
55+
Key provider for destructable sets.
56+
4957
## Interfaces
5058

5159
### SparseSetKey
@@ -65,3 +73,11 @@ public constant SparseSetKey<unit> UNIT_SPARSE_SET_KEY = new UnitSparseSetKey()
6573
```
6674

6775
Reusable key provider for SparseSet<unit>.
76+
77+
### DESTRUCTABLE_SPARSE_SET_KEY
78+
79+
```wurst
80+
public constant SparseSetKey<destructable> DESTRUCTABLE_SPARSE_SET_KEY = new DestructableSparseSetKey()
81+
```
82+
83+
Reusable key provider for SparseSet<destructable>.

0 commit comments

Comments
 (0)