@neocompose/cli 0.79.1 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/neo.mjs +2790 -544
- package/dist/test-worker.mjs +1363 -281
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/animation-and-world-authoring.md +3 -1
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/neoscript.md +25 -0
- package/skills/neocompose-cli/references/values-identities-and-references.md +5 -0
package/package.json
CHANGED
|
@@ -57,7 +57,9 @@ On a placed `NeoObject`, `this.Cell` returns its grid cell.
|
|
|
57
57
|
same grid, filtered to `Plant` and subclasses. `this.GetTile(neighbors)`
|
|
58
58
|
returns the first tile found in pattern order, or null.
|
|
59
59
|
`this.GetTiles(neighbors)` returns the tile at each occupied cell in pattern
|
|
60
|
-
order and skips empty cells.
|
|
60
|
+
order and skips empty cells. A type argument filters each cell's top tile:
|
|
61
|
+
`this.GetTiles<DirtDryTile>(neighbors)` returns `List<DirtDryTile>` and skips
|
|
62
|
+
a cell whose top tile is something else, even when a dry tile sits under it. Each query takes an optional `offset` that shifts
|
|
61
63
|
the whole pattern, so `this.GetTiles(neighbors, new(0, 2))` queries around the
|
|
62
64
|
cell two rows up without building a translated pattern. These queries track
|
|
63
65
|
empty cells as well as hits, so a getter updates when a new neighbor appears.
|
|
@@ -129,7 +129,7 @@ wrappers.
|
|
|
129
129
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
130
130
|
|
|
131
131
|
```html
|
|
132
|
-
<!-- reviewed-through-cli: 0.
|
|
132
|
+
<!-- reviewed-through-cli: 0.80.0 -->
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
The quoted version above is checked too, so this instruction cannot go stale
|
|
@@ -102,6 +102,23 @@ A generic receiver may call methods from its class or interface constraint,
|
|
|
102
102
|
including void calls used as statements. Generic arguments substitute through
|
|
103
103
|
the constraint; nullable receivers still require narrowing or null handling.
|
|
104
104
|
|
|
105
|
+
Functions, natives and interface functions can declare their own type
|
|
106
|
+
parameters after the name, each with an optional constraint and default:
|
|
107
|
+
|
|
108
|
+
```neo
|
|
109
|
+
public static T? FirstOf<T extends Item = Item>(List<Item> items) {
|
|
110
|
+
foreach (Item item in items) {
|
|
111
|
+
if (item is T match) return match;
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
A call writes every type argument or omits the defaulted tail
|
|
118
|
+
(`FirstOf<Seed>(items)`, `FirstOf(items)`); nothing is inferred. Function type
|
|
119
|
+
parameters take no `@id`, and an override declares the same count, constraints
|
|
120
|
+
and defaults, though it may rename them.
|
|
121
|
+
|
|
105
122
|
Prefer `--json` for automation.
|
|
106
123
|
|
|
107
124
|
`neo script check --all` reconstructs the prospective project entirely from
|
|
@@ -157,6 +174,12 @@ Explicit lambda parameter annotations accept the same type grammar as
|
|
|
157
174
|
declarations, including `decimal`, generic parameters, collections, arrays, and
|
|
158
175
|
nullable types.
|
|
159
176
|
|
|
177
|
+
Instance reads in collection-entry initializers must be deferred. A default such
|
|
178
|
+
as `List<int> Values = [this.Number + 1]` (or `[Number + 1]`) is a compile error:
|
|
179
|
+
the instance does not exist while the entry initializer runs. Delegate lambdas
|
|
180
|
+
such as `() => this.Number` and method groups such as `Read` or `this.Read`
|
|
181
|
+
remain valid, including inside `new Callback { Read = Read }` entries.
|
|
182
|
+
|
|
160
183
|
A lambda may use an expression body too: `(x) => x * 2` is the block body
|
|
161
184
|
`(x) => { return x * 2; }`. In a void delegate the expression is a statement,
|
|
162
185
|
so it must call or assign. A dictionary-literal body needs parentheses,
|
|
@@ -330,6 +353,8 @@ return this.Beds
|
|
|
330
353
|
Use `items.IndexOf(value)` to return the zero-based index of the first equal
|
|
331
354
|
list entry, or `-1` when the value is absent. `IndexOf` is list-only and uses
|
|
332
355
|
the same equality as `Contains`.
|
|
356
|
+
`Remove(value)` removes the first equal entry using that same equality, including
|
|
357
|
+
scalar entries supplied by instance field defaults. Removing a missing value is a no-op.
|
|
333
358
|
|
|
334
359
|
Use `items.Insert(index, value)` to insert an entry into a writable ordered
|
|
335
360
|
list. The index may range from zero through `items.Count`; the count appends
|
|
@@ -300,6 +300,11 @@ linked source record.
|
|
|
300
300
|
|
|
301
301
|
## Managed files
|
|
302
302
|
|
|
303
|
+
Managed images support PNG, JPEG, GIF, and SVG. SVG files use `image/svg+xml`
|
|
304
|
+
and retain their original bytes through pull, push, and Unity export; the CLI
|
|
305
|
+
does not rasterize them. The same byte-length, MIME-type, and SHA-256 checks
|
|
306
|
+
apply to SVG transfers as to other managed files.
|
|
307
|
+
|
|
303
308
|
Declare files in typed registries:
|
|
304
309
|
|
|
305
310
|
```neo
|