@lagless/2d-map-generator 0.0.48

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.
Files changed (124) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +373 -0
  3. package/dist/index.d.ts +31 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +27 -0
  6. package/dist/lib/collision/rapier-provider.d.ts +54 -0
  7. package/dist/lib/collision/rapier-provider.d.ts.map +1 -0
  8. package/dist/lib/collision/rapier-provider.js +67 -0
  9. package/dist/lib/collision/spatial-grid-provider.d.ts +19 -0
  10. package/dist/lib/collision/spatial-grid-provider.d.ts.map +1 -0
  11. package/dist/lib/collision/spatial-grid-provider.js +127 -0
  12. package/dist/lib/core/generated-map.d.ts +14 -0
  13. package/dist/lib/core/generated-map.d.ts.map +1 -0
  14. package/dist/lib/core/generated-map.js +17 -0
  15. package/dist/lib/core/map-dimensions.d.ts +8 -0
  16. package/dist/lib/core/map-dimensions.d.ts.map +1 -0
  17. package/dist/lib/core/map-dimensions.js +7 -0
  18. package/dist/lib/core/map-generator.d.ts +14 -0
  19. package/dist/lib/core/map-generator.d.ts.map +1 -0
  20. package/dist/lib/core/map-generator.js +124 -0
  21. package/dist/lib/core/terrain-query.d.ts +17 -0
  22. package/dist/lib/core/terrain-query.d.ts.map +1 -0
  23. package/dist/lib/core/terrain-query.js +54 -0
  24. package/dist/lib/features/biome-feature.d.ts +10 -0
  25. package/dist/lib/features/biome-feature.d.ts.map +1 -0
  26. package/dist/lib/features/biome-feature.js +9 -0
  27. package/dist/lib/features/bridge-feature.d.ts +10 -0
  28. package/dist/lib/features/bridge-feature.d.ts.map +1 -0
  29. package/dist/lib/features/bridge-feature.js +55 -0
  30. package/dist/lib/features/grass-feature.d.ts +10 -0
  31. package/dist/lib/features/grass-feature.d.ts.map +1 -0
  32. package/dist/lib/features/grass-feature.js +36 -0
  33. package/dist/lib/features/ground-patch-feature.d.ts +10 -0
  34. package/dist/lib/features/ground-patch-feature.d.ts.map +1 -0
  35. package/dist/lib/features/ground-patch-feature.js +57 -0
  36. package/dist/lib/features/lake-feature.d.ts +10 -0
  37. package/dist/lib/features/lake-feature.d.ts.map +1 -0
  38. package/dist/lib/features/lake-feature.js +65 -0
  39. package/dist/lib/features/object-placement-feature.d.ts +18 -0
  40. package/dist/lib/features/object-placement-feature.d.ts.map +1 -0
  41. package/dist/lib/features/object-placement-feature.js +229 -0
  42. package/dist/lib/features/places-feature.d.ts +10 -0
  43. package/dist/lib/features/places-feature.d.ts.map +1 -0
  44. package/dist/lib/features/places-feature.js +14 -0
  45. package/dist/lib/features/river-feature.d.ts +10 -0
  46. package/dist/lib/features/river-feature.d.ts.map +1 -0
  47. package/dist/lib/features/river-feature.js +122 -0
  48. package/dist/lib/features/shore-feature.d.ts +10 -0
  49. package/dist/lib/features/shore-feature.d.ts.map +1 -0
  50. package/dist/lib/features/shore-feature.js +20 -0
  51. package/dist/lib/math/catmull-rom.d.ts +12 -0
  52. package/dist/lib/math/catmull-rom.d.ts.map +1 -0
  53. package/dist/lib/math/catmull-rom.js +42 -0
  54. package/dist/lib/math/collision-test.d.ts +14 -0
  55. package/dist/lib/math/collision-test.d.ts.map +1 -0
  56. package/dist/lib/math/collision-test.js +29 -0
  57. package/dist/lib/math/jagged-aabb.d.ts +12 -0
  58. package/dist/lib/math/jagged-aabb.d.ts.map +1 -0
  59. package/dist/lib/math/jagged-aabb.js +47 -0
  60. package/dist/lib/math/polygon-utils.d.ts +19 -0
  61. package/dist/lib/math/polygon-utils.d.ts.map +1 -0
  62. package/dist/lib/math/polygon-utils.js +79 -0
  63. package/dist/lib/math/river-polygon.d.ts +12 -0
  64. package/dist/lib/math/river-polygon.d.ts.map +1 -0
  65. package/dist/lib/math/river-polygon.js +84 -0
  66. package/dist/lib/math/spline.d.ts +15 -0
  67. package/dist/lib/math/spline.d.ts.map +1 -0
  68. package/dist/lib/math/spline.js +127 -0
  69. package/dist/lib/physics/canopy-sensor-tag.d.ts +2 -0
  70. package/dist/lib/physics/canopy-sensor-tag.d.ts.map +1 -0
  71. package/dist/lib/physics/canopy-sensor-tag.js +1 -0
  72. package/dist/lib/physics/create-map-colliders.d.ts +12 -0
  73. package/dist/lib/physics/create-map-colliders.d.ts.map +1 -0
  74. package/dist/lib/physics/create-map-colliders.js +29 -0
  75. package/dist/lib/presets/standard-biome.d.ts +3 -0
  76. package/dist/lib/presets/standard-biome.d.ts.map +1 -0
  77. package/dist/lib/presets/standard-biome.js +9 -0
  78. package/dist/lib/presets/standard-map.d.ts +6 -0
  79. package/dist/lib/presets/standard-map.d.ts.map +1 -0
  80. package/dist/lib/presets/standard-map.js +61 -0
  81. package/dist/lib/presets/standard-objects.d.ts +6 -0
  82. package/dist/lib/presets/standard-objects.d.ts.map +1 -0
  83. package/dist/lib/presets/standard-objects.js +25 -0
  84. package/dist/lib/types/collision-provider.d.ts +8 -0
  85. package/dist/lib/types/collision-provider.d.ts.map +1 -0
  86. package/dist/lib/types/collision-provider.js +1 -0
  87. package/dist/lib/types/feature-configs.d.ts +139 -0
  88. package/dist/lib/types/feature-configs.d.ts.map +1 -0
  89. package/dist/lib/types/feature-configs.js +8 -0
  90. package/dist/lib/types/feature.d.ts +31 -0
  91. package/dist/lib/types/feature.d.ts.map +1 -0
  92. package/dist/lib/types/feature.js +12 -0
  93. package/dist/lib/types/generated-map.d.ts +10 -0
  94. package/dist/lib/types/generated-map.d.ts.map +1 -0
  95. package/dist/lib/types/generated-map.js +1 -0
  96. package/dist/lib/types/generated-river.d.ts +23 -0
  97. package/dist/lib/types/generated-river.d.ts.map +1 -0
  98. package/dist/lib/types/generated-river.js +1 -0
  99. package/dist/lib/types/geometry.d.ts +30 -0
  100. package/dist/lib/types/geometry.d.ts.map +1 -0
  101. package/dist/lib/types/geometry.js +5 -0
  102. package/dist/lib/types/index.d.ts +16 -0
  103. package/dist/lib/types/index.d.ts.map +1 -0
  104. package/dist/lib/types/index.js +5 -0
  105. package/dist/lib/types/map-generator-config.d.ts +8 -0
  106. package/dist/lib/types/map-generator-config.d.ts.map +1 -0
  107. package/dist/lib/types/map-generator-config.js +1 -0
  108. package/dist/lib/types/object-def.d.ts +58 -0
  109. package/dist/lib/types/object-def.d.ts.map +1 -0
  110. package/dist/lib/types/object-def.js +5 -0
  111. package/dist/lib/types/placed-object.d.ts +19 -0
  112. package/dist/lib/types/placed-object.d.ts.map +1 -0
  113. package/dist/lib/types/placed-object.js +10 -0
  114. package/dist/lib/types/prng-interface.d.ts +14 -0
  115. package/dist/lib/types/prng-interface.d.ts.map +1 -0
  116. package/dist/lib/types/prng-interface.js +1 -0
  117. package/dist/lib/utils/extract-canopy-zones.d.ts +22 -0
  118. package/dist/lib/utils/extract-canopy-zones.d.ts.map +1 -0
  119. package/dist/lib/utils/extract-canopy-zones.js +34 -0
  120. package/dist/lib/utils/sort-placed-objects.d.ts +3 -0
  121. package/dist/lib/utils/sort-placed-objects.d.ts.map +1 -0
  122. package/dist/lib/utils/sort-placed-objects.js +3 -0
  123. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  124. package/package.json +42 -0
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Creative Commons Attribution-NonCommercial 4.0 International
2
+
3
+ Copyright (c) 2025 Lagless
4
+
5
+ This work is licensed under the Creative Commons
6
+ Attribution-NonCommercial 4.0 International License.
7
+
8
+ You are free to:
9
+
10
+ Share — copy and redistribute the material in any medium or format
11
+ Adapt — remix, transform, and build upon the material
12
+
13
+ Under the following terms:
14
+
15
+ Attribution — You must give appropriate credit, provide a link to
16
+ the license, and indicate if changes were made. You may do so in
17
+ any reasonable manner, but not in any way that suggests the licensor
18
+ endorses you or your use.
19
+
20
+ NonCommercial — You may not use the material for commercial purposes.
21
+
22
+ No additional restrictions — You may not apply legal terms or
23
+ technological measures that legally restrict others from doing
24
+ anything the license permits.
25
+
26
+ Full license text: https://creativecommons.org/licenses/by-nc/4.0/legalcode
package/README.md ADDED
@@ -0,0 +1,373 @@
1
+ # @lagless/2d-map-generator
2
+
3
+ Deterministic 2D map generator with feature-based architecture. Produces terrain, rivers, lakes, object placements, and ground patches from a single seed.
4
+
5
+ ## Quick Start
6
+
7
+ ```typescript
8
+ import {
9
+ MapGenerator, BiomeFeature, ShoreFeature, GrassFeature,
10
+ SpatialGridCollisionProvider, ObjectPlacementFeature,
11
+ STANDARD_BIOME, PlacementKind, TerrainZone,
12
+ createMapColliders, CANOPY_SENSOR_TAG,
13
+ } from '@lagless/2d-map-generator';
14
+ import type { ObjectPlacementOutput } from '@lagless/2d-map-generator';
15
+
16
+ // 1. Configure generator with your game's features
17
+ const generator = new MapGenerator({ baseWidth: 720, baseHeight: 720, scale: 1, extension: 80, gridSize: 16 });
18
+ generator
19
+ .addFeature(new BiomeFeature(), STANDARD_BIOME)
20
+ .addFeature(new ShoreFeature(), { inset: 48, divisions: 12, variation: 4 })
21
+ .addFeature(new GrassFeature(), { inset: 18, variation: 3 })
22
+ .addFeature(new ObjectPlacementFeature(), {
23
+ registry: myObjectRegistry, // your game's object definitions
24
+ stages: [{ kind: PlacementKind.Density, typeId: 0, density: 100, terrainZone: TerrainZone.Grass }],
25
+ });
26
+
27
+ // 2. Generate map (deterministic — same seed = same map)
28
+ const collision = new SpatialGridCollisionProvider(1024, 1024, 64);
29
+ const map = generator.generate(prng, collision);
30
+
31
+ // 3. Access feature outputs (type-safe)
32
+ const placement = map.get<ObjectPlacementOutput>(ObjectPlacementFeature);
33
+
34
+ // 4. Create physics colliders from placed objects
35
+ // skipTags prevents creating physics bodies for sensor colliders (e.g. canopy zones)
36
+ if (placement) {
37
+ createMapColliders(physicsAdapter, placement.objects, myObjectRegistry, {
38
+ skipTags: [CANOPY_SENSOR_TAG],
39
+ });
40
+ }
41
+ ```
42
+
43
+ > **Note:** Object definitions and generator presets are game-specific — define them in your game project, not in this library. See the [Object Definitions](#object-definitions) section for the `MapObjectDef` format.
44
+
45
+ ## Architecture
46
+
47
+ ```
48
+ MapGenerator
49
+ ├── addFeature(feature, config) // register features
50
+ └── generate(random, collision) // run all features in dependency order
51
+
52
+ ├── BiomeFeature → BiomeOutput (colors)
53
+ ├── ShoreFeature → ShoreOutput (shore polygon)
54
+ ├── GrassFeature → GrassOutput (grass polygon)
55
+ ├── RiverFeature → RiverOutput (river polygons)
56
+ ├── LakeFeature → LakeOutput (lake polygons)
57
+ ├── BridgeFeature → BridgeOutput (bridge placements)
58
+ ├── ObjectPlacementFeature → ObjectPlacementOutput (placed objects)
59
+ ├── GroundPatchFeature → GroundPatchOutput (ground patches)
60
+ └── PlacesFeature → PlacesOutput (named positions)
61
+ ```
62
+
63
+ Features declare dependencies via `requires`. The generator resolves them with topological sort — no manual ordering needed.
64
+
65
+ ## Custom Generator
66
+
67
+ ```typescript
68
+ import {
69
+ MapGenerator, BiomeFeature, ShoreFeature, GrassFeature,
70
+ RiverFeature, ObjectPlacementFeature,
71
+ PlacementKind, TerrainZone,
72
+ } from '@lagless/2d-map-generator';
73
+
74
+ const generator = new MapGenerator({
75
+ baseWidth: 720,
76
+ baseHeight: 720,
77
+ scale: 1.0,
78
+ extension: 80,
79
+ gridSize: 16,
80
+ });
81
+
82
+ generator
83
+ .addFeature(new BiomeFeature(), {
84
+ background: 0x80af49,
85
+ water: 0x3d85c6,
86
+ waterRipple: 0x3478b2,
87
+ beach: 0xcdb35b,
88
+ riverbank: 0x905e24,
89
+ grass: 0x80af49,
90
+ underground: 0x1b0d00,
91
+ })
92
+ .addFeature(new ShoreFeature(), { inset: 48, divisions: 12, variation: 4 })
93
+ .addFeature(new GrassFeature(), { inset: 18, variation: 3 })
94
+ .addFeature(new RiverFeature(), {
95
+ weights: [
96
+ { weight: 0.25, widths: [8, 4] },
97
+ { weight: 0.75, widths: [4] },
98
+ ],
99
+ subdivisionPasses: 5,
100
+ masks: [],
101
+ })
102
+ .addFeature(new ObjectPlacementFeature(), {
103
+ registry: myObjectRegistry,
104
+ stages: [
105
+ { kind: PlacementKind.Density, typeId: 0, density: 100, terrainZone: TerrainZone.Grass },
106
+ { kind: PlacementKind.Fixed, typeId: 1, count: 10 },
107
+ { kind: PlacementKind.Location, typeId: 2, pos: { x: 100, y: 100 }, rad: 20, optional: true },
108
+ ],
109
+ });
110
+
111
+ const map = generator.generate(random, collision);
112
+ ```
113
+
114
+ ## Object Definitions
115
+
116
+ Objects are defined via `MapObjectDef` with separate collider and visual arrays:
117
+
118
+ ```typescript
119
+ import { ShapeType, RenderLayer } from '@lagless/2d-map-generator';
120
+ import type { MapObjectDef, MapObjectRegistry } from '@lagless/2d-map-generator';
121
+
122
+ import { CANOPY_SENSOR_TAG } from '@lagless/2d-map-generator';
123
+
124
+ const TREE: MapObjectDef = {
125
+ typeId: 0,
126
+ colliders: [
127
+ { shape: { type: ShapeType.Circle, radius: 3 } },
128
+ // Sensor collider for canopy transparency zone (view-only, skipped by createMapColliders via skipTags)
129
+ { shape: { type: ShapeType.Circle, radius: 128 }, isSensor: true, tag: CANOPY_SENSOR_TAG },
130
+ ],
131
+ visuals: [
132
+ { texture: 'tree-trunk', layer: RenderLayer.Ground },
133
+ { texture: 'tree-foliage', layer: RenderLayer.Canopy },
134
+ ],
135
+ scaleRange: [0.1, 0.2],
136
+ };
137
+
138
+ const BUILDING: MapObjectDef = {
139
+ typeId: 1,
140
+ colliders: [
141
+ { shape: { type: ShapeType.Cuboid, halfWidth: 10, halfHeight: 8 } },
142
+ { shape: { type: ShapeType.Circle, radius: 15 }, isSensor: true, tag: 1 },
143
+ ],
144
+ visuals: [
145
+ { texture: 'building-floor', layer: RenderLayer.Ground },
146
+ { texture: 'building-roof', layer: RenderLayer.Canopy },
147
+ ],
148
+ scaleRange: [1, 1],
149
+ groundPatches: [
150
+ {
151
+ offset: { x: 0, y: 0 },
152
+ halfExtents: { x: 12, y: 10 },
153
+ color: 0x8b4513,
154
+ roughness: 0.5,
155
+ offsetDist: 2,
156
+ order: 0,
157
+ useAsMapShape: false,
158
+ },
159
+ ],
160
+ };
161
+
162
+ const registry: MapObjectRegistry = new Map([
163
+ [0, TREE],
164
+ [1, BUILDING],
165
+ ]);
166
+ ```
167
+
168
+ ## Placement Stages
169
+
170
+ | Kind | Description | Key Fields |
171
+ |------|-------------|------------|
172
+ | `PlacementKind.Location` | Place at specific position | `typeId`, `pos`, `rad`, `optional` |
173
+ | `PlacementKind.Fixed` | Place exact count | `typeId`, `count`, `important?` |
174
+ | `PlacementKind.Random` | Choose N from a list | `spawns: number[]`, `choose` |
175
+ | `PlacementKind.Density` | Count proportional to map area | `typeId`, `density` |
176
+
177
+ All stages support optional `terrainZone` to restrict placement to a terrain type.
178
+
179
+ ## Accessing Feature Outputs
180
+
181
+ ```typescript
182
+ import {
183
+ BiomeFeature, ShoreFeature, GrassFeature,
184
+ RiverFeature, ObjectPlacementFeature,
185
+ } from '@lagless/2d-map-generator';
186
+ import type { BiomeOutput, ShoreOutput, ObjectPlacementOutput } from '@lagless/2d-map-generator';
187
+
188
+ const map = generator.generate(random, collision);
189
+
190
+ // Type-safe access via feature class:
191
+ const biome = map.get<BiomeOutput>(BiomeFeature);
192
+ const shore = map.get<ShoreOutput>(ShoreFeature);
193
+ const placement = map.get<ObjectPlacementOutput>(ObjectPlacementFeature);
194
+ ```
195
+
196
+ ## Collision Providers
197
+
198
+ Generation-time collision providers prevent object overlap during placement:
199
+
200
+ ```typescript
201
+ import { SpatialGridCollisionProvider } from '@lagless/2d-map-generator';
202
+
203
+ // Fast grid-based provider (recommended)
204
+ const collision = new SpatialGridCollisionProvider(mapWidth, mapHeight, cellSize);
205
+ const map = generator.generate(random, collision);
206
+ ```
207
+
208
+ `RapierCollisionProvider` is also available for Rapier-based overlap testing.
209
+
210
+ ## Physics Integration
211
+
212
+ `createMapColliders` converts placed objects into physics bodies via a `MapPhysicsProvider` adapter:
213
+
214
+ ```typescript
215
+ import { createMapColliders, CANOPY_SENSOR_TAG } from '@lagless/2d-map-generator';
216
+ import type { MapPhysicsProvider, CreateMapCollidersOptions } from '@lagless/2d-map-generator';
217
+
218
+ // Implement the adapter for your physics engine:
219
+ const physics: MapPhysicsProvider = {
220
+ createFixedBody(x, y, rotation) {
221
+ const desc = rapier.RigidBodyDesc.fixed().setTranslation(x, y).setRotation(rotation);
222
+ return worldManager.createBodyFromDesc(desc);
223
+ },
224
+ createCircleCollider(body, radius, ox, oy, isSensor, tag, collisionGroup) {
225
+ let desc = rapier.ColliderDesc.ball(radius).setTranslation(ox, oy).setSensor(isSensor);
226
+ if (collisionGroup != null) desc = desc.setCollisionGroups(collisionGroup);
227
+ worldManager.createColliderFromDesc(desc, body);
228
+ },
229
+ createCuboidCollider(body, hw, hh, ox, oy, isSensor, tag, collisionGroup) {
230
+ let desc = rapier.ColliderDesc.cuboid(hw, hh).setTranslation(ox, oy).setSensor(isSensor);
231
+ if (collisionGroup != null) desc = desc.setCollisionGroups(collisionGroup);
232
+ worldManager.createColliderFromDesc(desc, body);
233
+ },
234
+ };
235
+
236
+ // skipTags: skip colliders with matching tags (e.g. canopy sensors — view-only, no physics needed)
237
+ createMapColliders(physics, placement.objects, registry, {
238
+ skipTags: [CANOPY_SENSOR_TAG],
239
+ });
240
+ ```
241
+
242
+ Handles circle/cuboid shapes, offset, scale, rotation, sensors, tags, collision groups, and recursive children.
243
+
244
+ ### Options
245
+
246
+ | Option | Type | Description |
247
+ |--------|------|-------------|
248
+ | `skipTags` | `readonly number[]` | Skip colliders whose `tag` is in this list. Use to prevent creating physics bodies for view-only sensors (e.g. `CANOPY_SENSOR_TAG`). |
249
+
250
+ ## Terrain Query
251
+
252
+ Classify world positions into terrain zones:
253
+
254
+ ```typescript
255
+ import { TerrainQuery, TerrainZone } from '@lagless/2d-map-generator';
256
+
257
+ const terrain = new TerrainQuery({
258
+ shore: map.get<ShoreOutput>(ShoreFeature),
259
+ grass: map.get<GrassOutput>(GrassFeature),
260
+ river: map.get<RiverOutput>(RiverFeature),
261
+ lake: map.get<LakeOutput>(LakeFeature),
262
+ });
263
+
264
+ const zone = terrain.classify(x, y); // TerrainZone.Grass, .Beach, .River, etc.
265
+ ```
266
+
267
+ ## Utilities
268
+
269
+ ### sortPlacedObjects
270
+
271
+ Sorts placed objects by position (Y then X). Used internally by both `MapObjectRenderer.build()` and `extractCanopyZones()` to guarantee consistent object indices.
272
+
273
+ ```typescript
274
+ import { sortPlacedObjects } from '@lagless/2d-map-generator';
275
+
276
+ const sorted = sortPlacedObjects(placement.objects);
277
+ // sorted[i] index matches MapObjectRenderer particle index and CanopyZone.objectIndex
278
+ ```
279
+
280
+ ### extractCanopyZones
281
+
282
+ Extracts canopy zone data from placed objects for view-layer distance checks. Returns pre-computed zones with squared radii for fast per-frame comparisons.
283
+
284
+ ```typescript
285
+ import { extractCanopyZones, isInsideCanopyZone, CANOPY_SENSOR_TAG } from '@lagless/2d-map-generator';
286
+ import type { CanopyZone } from '@lagless/2d-map-generator';
287
+
288
+ const zones: CanopyZone[] = extractCanopyZones(placement.objects, registry);
289
+ // Default tag = CANOPY_SENSOR_TAG. Custom: extractCanopyZones(objects, registry, myTag)
290
+
291
+ // Two zone variants:
292
+ // CanopyZoneCircle: { type: 'circle', x, y, radiusSq, objectIndex }
293
+ // CanopyZoneCuboid: { type: 'cuboid', x, y, halfWidth, halfHeight, objectIndex }
294
+ ```
295
+
296
+ **How it works:** Calls `sortPlacedObjects()` internally, iterates sorted objects, finds sensor colliders with matching `tag` and `isSensor: true`, extracts position + scaled dimensions. Supports both `ShapeType.Circle` and `ShapeType.Cuboid` sensors.
297
+
298
+ ### isInsideCanopyZone
299
+
300
+ Checks whether a point is inside a canopy zone. Handles both circle and cuboid zone types:
301
+
302
+ ```typescript
303
+ import { isInsideCanopyZone } from '@lagless/2d-map-generator';
304
+
305
+ const inside = isInsideCanopyZone(zone, playerX, playerY); // true if inside
306
+ ```
307
+
308
+ ### CANOPY_SENSOR_TAG
309
+
310
+ Constant (`= 1`) used as a tag on sensor colliders in object definitions to mark canopy transparency zones. Used by:
311
+ - `extractCanopyZones()` — default tag parameter
312
+ - `createMapColliders()` with `skipTags` — prevents creating physics bodies for canopy sensors
313
+
314
+ ## Rendering
315
+
316
+ Use `@lagless/2d-map-renderer` for Pixi.js rendering:
317
+
318
+ ```typescript
319
+ import { MapTerrainRenderer, MapObjectRenderer } from '@lagless/2d-map-renderer';
320
+
321
+ // Terrain (shore, grass, rivers, lakes)
322
+ const terrain = new MapTerrainRenderer();
323
+ viewport.addChild(terrain.buildTerrain(map));
324
+
325
+ // Objects (two ParticleContainers: ground + canopy)
326
+ const objects = new MapObjectRenderer({ dynamicCanopyAlpha: true });
327
+ objects.build(placement.objects, registry, (key) => Assets.get(key) ?? Texture.EMPTY);
328
+ viewport.addChild(objects.ground); // under entities
329
+ viewport.addChild(objects.canopy); // over entities
330
+
331
+ // Canopy transparency — set alpha for a specific object by sorted index:
332
+ objects.setCanopyAlpha(objectIndex, 0.3); // transparent
333
+ objects.setCanopyAlpha(objectIndex, 1.0); // opaque
334
+ ```
335
+
336
+ ### Canopy Transparency (View-Layer Distance Checks)
337
+
338
+ Canopy transparency is a **view-only** concern — it must NOT live in ECS or affect determinism. Use `extractCanopyZones()` to pre-compute zones once, then check distances per frame:
339
+
340
+ ```typescript
341
+ import { extractCanopyZones, isInsideCanopyZone } from '@lagless/2d-map-generator';
342
+ import type { ObjectPlacementOutput } from '@lagless/2d-map-generator';
343
+
344
+ // Pre-compute once (e.g. in useMemo):
345
+ const placement = map.get<ObjectPlacementOutput>(ObjectPlacementFeature);
346
+ const canopyZones = placement ? extractCanopyZones(placement.objects, registry) : [];
347
+
348
+ // Per frame (e.g. in useTick):
349
+ const px = playerX, py = playerY;
350
+ for (const zone of canopyZones) {
351
+ const inside = isInsideCanopyZone(zone, px, py);
352
+ objectRenderer.setCanopyAlpha(zone.objectIndex, inside ? 0.3 : 1.0);
353
+ }
354
+ ```
355
+
356
+ **Performance:** O(N) per frame with N ≈ 100-200 objects — just multiply + compare per object, negligible cost.
357
+
358
+ ## Determinism
359
+
360
+ All generation is deterministic. Requirements:
361
+ - Use `ISeededRandom` (ECS `PRNG` satisfies this structurally)
362
+ - Trigonometry uses `MathOps` (WASM-backed, cross-platform identical)
363
+ - Same seed + same config = identical map on every client
364
+
365
+ ## Enums
366
+
367
+ | Enum | Values |
368
+ |------|--------|
369
+ | `ShapeType` | `Circle = 0`, `Cuboid = 1` |
370
+ | `FeatureId` | `Biome = 0` through `Places = 8` |
371
+ | `PlacementKind` | `Location = 0`, `Fixed = 1`, `Random = 2`, `Density = 3` |
372
+ | `RenderLayer` | `Ground = 0`, `Canopy = 1` |
373
+ | `TerrainZone` | `Grass = 0`, `Beach = 1`, `RiverShore = 2`, `River = 3`, `Lake = 4`, `Bridge = 5`, `WaterEdge = 6` |
@@ -0,0 +1,31 @@
1
+ export * from './lib/types/index.js';
2
+ export { GeneratedMap } from './lib/core/generated-map.js';
3
+ export { MapGenerator } from './lib/core/map-generator.js';
4
+ export { computeDimensions } from './lib/core/map-dimensions.js';
5
+ export { generateJaggedAabbPoints } from './lib/math/jagged-aabb.js';
6
+ export { pointInPolygon, polygonArea, distToSegmentSq, computePolygonBounds } from './lib/math/polygon-utils.js';
7
+ export { testCircleCircle, testCircleAabb, testAabbAabb } from './lib/math/collision-test.js';
8
+ export { BiomeFeature } from './lib/features/biome-feature.js';
9
+ export { ShoreFeature } from './lib/features/shore-feature.js';
10
+ export { GrassFeature } from './lib/features/grass-feature.js';
11
+ export { SpatialGridCollisionProvider } from './lib/collision/spatial-grid-provider.js';
12
+ export { catmullRom, catmullRomDerivative, getControlPoints } from './lib/math/catmull-rom.js';
13
+ export { Spline } from './lib/math/spline.js';
14
+ export { generateRiverPolygon } from './lib/math/river-polygon.js';
15
+ export { RiverFeature } from './lib/features/river-feature.js';
16
+ export { LakeFeature } from './lib/features/lake-feature.js';
17
+ export { TerrainQuery } from './lib/core/terrain-query.js';
18
+ export type { TerrainQueryInputs } from './lib/core/terrain-query.js';
19
+ export { ObjectPlacementFeature } from './lib/features/object-placement-feature.js';
20
+ export { GroundPatchFeature } from './lib/features/ground-patch-feature.js';
21
+ export { BridgeFeature } from './lib/features/bridge-feature.js';
22
+ export { RapierCollisionProvider } from './lib/collision/rapier-provider.js';
23
+ export { PlacesFeature } from './lib/features/places-feature.js';
24
+ export { STANDARD_BIOME } from './lib/presets/standard-biome.js';
25
+ export { createMapColliders } from './lib/physics/create-map-colliders.js';
26
+ export type { MapPhysicsProvider, CreateMapCollidersOptions } from './lib/physics/create-map-colliders.js';
27
+ export { CANOPY_SENSOR_TAG } from './lib/physics/canopy-sensor-tag.js';
28
+ export { sortPlacedObjects } from './lib/utils/sort-placed-objects.js';
29
+ export { extractCanopyZones, isInsideCanopyZone } from './lib/utils/extract-canopy-zones.js';
30
+ export type { CanopyZone, CanopyZoneCircle, CanopyZoneCuboid } from './lib/utils/extract-canopy-zones.js';
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACjH,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC7F,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ export * from './lib/types/index.js';
2
+ export { GeneratedMap } from './lib/core/generated-map.js';
3
+ export { MapGenerator } from './lib/core/map-generator.js';
4
+ export { computeDimensions } from './lib/core/map-dimensions.js';
5
+ export { generateJaggedAabbPoints } from './lib/math/jagged-aabb.js';
6
+ export { pointInPolygon, polygonArea, distToSegmentSq, computePolygonBounds } from './lib/math/polygon-utils.js';
7
+ export { testCircleCircle, testCircleAabb, testAabbAabb } from './lib/math/collision-test.js';
8
+ export { BiomeFeature } from './lib/features/biome-feature.js';
9
+ export { ShoreFeature } from './lib/features/shore-feature.js';
10
+ export { GrassFeature } from './lib/features/grass-feature.js';
11
+ export { SpatialGridCollisionProvider } from './lib/collision/spatial-grid-provider.js';
12
+ export { catmullRom, catmullRomDerivative, getControlPoints } from './lib/math/catmull-rom.js';
13
+ export { Spline } from './lib/math/spline.js';
14
+ export { generateRiverPolygon } from './lib/math/river-polygon.js';
15
+ export { RiverFeature } from './lib/features/river-feature.js';
16
+ export { LakeFeature } from './lib/features/lake-feature.js';
17
+ export { TerrainQuery } from './lib/core/terrain-query.js';
18
+ export { ObjectPlacementFeature } from './lib/features/object-placement-feature.js';
19
+ export { GroundPatchFeature } from './lib/features/ground-patch-feature.js';
20
+ export { BridgeFeature } from './lib/features/bridge-feature.js';
21
+ export { RapierCollisionProvider } from './lib/collision/rapier-provider.js';
22
+ export { PlacesFeature } from './lib/features/places-feature.js';
23
+ export { STANDARD_BIOME } from './lib/presets/standard-biome.js';
24
+ export { createMapColliders } from './lib/physics/create-map-colliders.js';
25
+ export { CANOPY_SENSOR_TAG } from './lib/physics/canopy-sensor-tag.js';
26
+ export { sortPlacedObjects } from './lib/utils/sort-placed-objects.js';
27
+ export { extractCanopyZones, isInsideCanopyZone } from './lib/utils/extract-canopy-zones.js';
@@ -0,0 +1,54 @@
1
+ import type { ICollisionProvider } from '../types/collision-provider.js';
2
+ import type { MapCollisionShape } from '../types/geometry.js';
3
+ interface RapierVector2 {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ interface RapierRigidBodyDesc {
8
+ setTranslation(x: number, y: number): RapierRigidBodyDesc;
9
+ setRotation(rotation: number): RapierRigidBodyDesc;
10
+ }
11
+ interface RapierRigidBody {
12
+ handle: number;
13
+ }
14
+ interface RapierWorld {
15
+ createRigidBody(desc: RapierRigidBodyDesc): RapierRigidBody;
16
+ createCollider(desc: RapierColliderDesc, body: RapierRigidBody): unknown;
17
+ removeRigidBody(body: RapierRigidBody): void;
18
+ getRigidBody(handle: number): RapierRigidBody | null;
19
+ intersectionsWithShape(pos: RapierVector2, rotation: number, shape: RapierShape, callback: (handle: number) => boolean): void;
20
+ step(): void;
21
+ }
22
+ interface RapierShape {
23
+ readonly __rapierShape?: unknown;
24
+ }
25
+ interface RapierColliderDesc {
26
+ readonly __rapierColliderDesc?: unknown;
27
+ }
28
+ export interface RapierModule2dLike {
29
+ Vector2: new (x: number, y: number) => RapierVector2;
30
+ World: new (gravity: RapierVector2) => RapierWorld;
31
+ RigidBodyDesc: {
32
+ fixed(): RapierRigidBodyDesc;
33
+ };
34
+ ColliderDesc: {
35
+ ball(radius: number): RapierColliderDesc;
36
+ cuboid(halfWidth: number, halfHeight: number): RapierColliderDesc;
37
+ };
38
+ Ball: new (radius: number) => RapierShape;
39
+ Cuboid: new (halfWidth: number, halfHeight: number) => RapierShape;
40
+ }
41
+ export declare class RapierCollisionProvider implements ICollisionProvider {
42
+ private readonly _rapier;
43
+ private _world;
44
+ private readonly _bodies;
45
+ constructor(rapier: RapierModule2dLike);
46
+ addShape(id: number, shape: MapCollisionShape, posX: number, posY: number, rotation: number, scale: number): void;
47
+ testShape(shape: MapCollisionShape, posX: number, posY: number, rotation: number, scale: number): boolean;
48
+ removeShape(id: number): void;
49
+ clear(): void;
50
+ private _createShape;
51
+ private _createColliderDesc;
52
+ }
53
+ export {};
54
+ //# sourceMappingURL=rapier-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rapier-provider.d.ts","sourceRoot":"","sources":["../../../src/lib/collision/rapier-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,UAAU,aAAa;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,UAAU,mBAAmB;IAC3B,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC1D,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpD;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,WAAW;IACnB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CAAC;IAC5D,cAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC;IACzE,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;IACrD,sBAAsB,CACpB,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EACxD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GACpC,IAAI,CAAC;IACR,IAAI,IAAI,IAAI,CAAC;CACd;AAED,UAAU,WAAW;IACnB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;IACrD,KAAK,EAAE,KAAK,OAAO,EAAE,aAAa,KAAK,WAAW,CAAC;IACnD,aAAa,EAAE;QAAE,KAAK,IAAI,mBAAmB,CAAA;KAAE,CAAC;IAChD,YAAY,EAAE;QACZ,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,CAAC;QACzC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAAC;KACnE,CAAC;IACF,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,KAAK,WAAW,CAAC;IAC1C,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,WAAW,CAAC;CACpE;AAED,qBAAa,uBAAwB,YAAW,kBAAkB;IAChE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;gBAE9C,MAAM,EAAE,kBAAkB;IAMtC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAajH,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAiBzG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAW7B,KAAK,IAAI,IAAI;IAMb,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,mBAAmB;CAM5B"}
@@ -0,0 +1,67 @@
1
+ import { ShapeType } from '../types/geometry.js';
2
+ export class RapierCollisionProvider {
3
+ _rapier;
4
+ _world;
5
+ _bodies = new Map();
6
+ constructor(rapier) {
7
+ this._rapier = rapier;
8
+ const gravity = new rapier.Vector2(0, 0);
9
+ this._world = new rapier.World(gravity);
10
+ }
11
+ addShape(id, shape, posX, posY, rotation, scale) {
12
+ const colliderDesc = this._createColliderDesc(shape, scale);
13
+ if (!colliderDesc)
14
+ return;
15
+ const R = this._rapier;
16
+ const bodyDesc = R.RigidBodyDesc.fixed()
17
+ .setTranslation(posX, posY)
18
+ .setRotation(rotation);
19
+ const body = this._world.createRigidBody(bodyDesc);
20
+ this._world.createCollider(colliderDesc, body);
21
+ this._bodies.set(id, body.handle);
22
+ }
23
+ testShape(shape, posX, posY, rotation, scale) {
24
+ const rapierShape = this._createShape(shape, scale);
25
+ if (!rapierShape)
26
+ return false;
27
+ const position = new this._rapier.Vector2(posX, posY);
28
+ this._world.step();
29
+ let hasOverlap = false;
30
+ this._world.intersectionsWithShape(position, rotation, rapierShape, () => {
31
+ hasOverlap = true;
32
+ return false;
33
+ });
34
+ return hasOverlap;
35
+ }
36
+ removeShape(id) {
37
+ const handle = this._bodies.get(id);
38
+ if (handle === undefined)
39
+ return;
40
+ const body = this._world.getRigidBody(handle);
41
+ if (body) {
42
+ this._world.removeRigidBody(body);
43
+ }
44
+ this._bodies.delete(id);
45
+ }
46
+ clear() {
47
+ const gravity = new this._rapier.Vector2(0, 0);
48
+ this._world = new this._rapier.World(gravity);
49
+ this._bodies.clear();
50
+ }
51
+ _createShape(shape, scale) {
52
+ const R = this._rapier;
53
+ if (shape.type === ShapeType.Circle)
54
+ return new R.Ball(shape.radius * scale);
55
+ if (shape.type === ShapeType.Cuboid)
56
+ return new R.Cuboid(shape.halfWidth * scale, shape.halfHeight * scale);
57
+ return null;
58
+ }
59
+ _createColliderDesc(shape, scale) {
60
+ const R = this._rapier;
61
+ if (shape.type === ShapeType.Circle)
62
+ return R.ColliderDesc.ball(shape.radius * scale);
63
+ if (shape.type === ShapeType.Cuboid)
64
+ return R.ColliderDesc.cuboid(shape.halfWidth * scale, shape.halfHeight * scale);
65
+ return null;
66
+ }
67
+ }
@@ -0,0 +1,19 @@
1
+ import type { ICollisionProvider } from '../types/collision-provider.js';
2
+ import type { MapCollisionShape } from '../types/geometry.js';
3
+ export declare class SpatialGridCollisionProvider implements ICollisionProvider {
4
+ private readonly _cellSize;
5
+ private readonly _gridW;
6
+ private readonly _gridH;
7
+ private readonly _cells;
8
+ private readonly _shapes;
9
+ private _queryId;
10
+ private readonly _lastQueried;
11
+ constructor(width: number, height: number, cellSize?: number);
12
+ addShape(id: number, shape: MapCollisionShape, posX: number, posY: number, rotation: number, scale: number): void;
13
+ testShape(shape: MapCollisionShape, posX: number, posY: number, rotation: number, scale: number): boolean;
14
+ removeShape(id: number): void;
15
+ clear(): void;
16
+ private _createStoredShape;
17
+ private _testOverlap;
18
+ }
19
+ //# sourceMappingURL=spatial-grid-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-grid-provider.d.ts","sourceRoot":"","sources":["../../../src/lib/collision/spatial-grid-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiB9D,qBAAa,4BAA6B,YAAW,kBAAkB;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;gBAE9C,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAK;IAOxD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAiBjH,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IA4BzG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAwB7B,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,YAAY;CAkCrB"}