@codexo/exojs-tiled 0.13.0 → 0.15.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.
@@ -23,7 +23,7 @@ export declare abstract class TiledLayer {
23
23
  readonly offsetY: number;
24
24
  readonly parallaxX: number;
25
25
  readonly parallaxY: number;
26
- readonly tintColor?: string;
26
+ readonly tintColor?: string | undefined;
27
27
  readonly properties: readonly TiledPropertyData[];
28
28
  protected constructor(data: TiledLayerDataBase);
29
29
  /** Looks up a custom property by name. */
@@ -39,8 +39,8 @@ export declare class TiledTileLayer extends TiledLayer {
39
39
  readonly type: "tilelayer";
40
40
  readonly width: number;
41
41
  readonly height: number;
42
- readonly data?: readonly number[];
43
- readonly chunks?: readonly TiledChunkData[];
42
+ readonly data?: readonly number[] | undefined;
43
+ readonly chunks?: readonly TiledChunkData[] | undefined;
44
44
  constructor(data: TiledTileLayerData);
45
45
  }
46
46
  /** An object layer: a flat list of {@link TiledObject}s. */
@@ -1,3 +1,4 @@
1
+ import { type Texture } from '@codexo/exojs';
1
2
  import { TileMap } from '@codexo/exojs-tilemap';
2
3
  import type { TiledMapData, TiledOrientation, TiledPropertyData, TiledRenderOrder } from './data';
3
4
  import { type TiledLayer } from './TiledLayer';
@@ -21,7 +22,7 @@ export declare class TiledMap {
21
22
  /** The validated raw map data this instance was built from. */
22
23
  readonly data: TiledMapData;
23
24
  readonly orientation: TiledOrientation;
24
- readonly renderOrder?: TiledRenderOrder;
25
+ readonly renderOrder?: TiledRenderOrder | undefined;
25
26
  readonly class: string;
26
27
  /** Map width in tiles. */
27
28
  readonly width: number;
@@ -32,12 +33,13 @@ export declare class TiledMap {
32
33
  /** Tile grid cell height in pixels. */
33
34
  readonly tileHeight: number;
34
35
  readonly infinite: boolean;
35
- readonly backgroundColor?: string;
36
+ readonly backgroundColor?: string | undefined;
36
37
  readonly layers: readonly TiledLayer[];
37
38
  /** Tilesets used by this map, sorted by {@link TiledTileset.firstGid} ascending. */
38
39
  readonly tilesets: readonly TiledTileset[];
39
40
  readonly properties: readonly TiledPropertyData[];
40
- constructor(source: string, data: TiledMapData, tilesets: readonly TiledTileset[]);
41
+ private readonly _imageTextures;
42
+ constructor(source: string, data: TiledMapData, tilesets: readonly TiledTileset[], imageTextures?: ReadonlyMap<number, Texture>);
41
43
  /**
42
44
  * Returns the tileset that owns `gid`, or `undefined` if `gid` is `0`
43
45
  * (the empty-cell sentinel) or is not covered by any tileset.
@@ -56,9 +58,9 @@ export declare class TiledMap {
56
58
  * Only finite orthogonal maps with atlas tilesets are supported. A
57
59
  * non-orthogonal or infinite map, or a collection-of-images tileset, throws
58
60
  * {@link TiledFormatError} rather than silently producing wrong (misplaced)
59
- * or empty geometry. Object, image, and group layers are not yet converted
60
- * (Phase C2 scope: tile layers only; group layer children are flattened into
61
- * the result).
61
+ * or empty geometry. Tile layers become renderable `TileLayer`s, object
62
+ * groups become data-only `ObjectLayer`s, and image layers become data-only
63
+ * `ImageLayer`s; group layer children are flattened in document order.
62
64
  *
63
65
  * The returned `TileMap` does **not** own the tileset textures — they remain
64
66
  * in the Loader cache. Destroying the returned map does not unload textures.
@@ -1,7 +1,8 @@
1
1
  import { TextureRegion } from '@codexo/exojs';
2
- import { TileSet, TileMap, TileLayer } from '@codexo/exojs-tilemap';
2
+ import { TileSet, TileMap, TileLayer, ImageLayer, ObjectLayer, TilePropertyKind } from '@codexo/exojs-tilemap';
3
3
  import { maskTiledGid, TILED_FLIPPED_DIAGONALLY_FLAG, TILED_FLIPPED_VERTICALLY_FLAG, TILED_FLIPPED_HORIZONTALLY_FLAG } from './gid.js';
4
- import { createTiledLayer, TiledGroupLayer, TiledTileLayer, TiledObjectLayer } from './TiledLayer.js';
4
+ import { createTiledLayer, TiledGroupLayer, TiledTileLayer, TiledObjectLayer, TiledImageLayer } from './TiledLayer.js';
5
+ import { resolveTiledUrl } from './url.js';
5
6
  import { TiledFormatError } from './validate.js';
6
7
 
7
8
  /**
@@ -39,7 +40,8 @@ class TiledMap {
39
40
  /** Tilesets used by this map, sorted by {@link TiledTileset.firstGid} ascending. */
40
41
  tilesets;
41
42
  properties;
42
- constructor(source, data, tilesets) {
43
+ _imageTextures;
44
+ constructor(source, data, tilesets, imageTextures = new Map()) {
43
45
  this.source = source;
44
46
  this.data = data;
45
47
  this.orientation = data.orientation;
@@ -52,6 +54,7 @@ class TiledMap {
52
54
  this.infinite = data.infinite;
53
55
  this.backgroundColor = data.backgroundcolor;
54
56
  this.properties = data.properties ?? [];
57
+ this._imageTextures = imageTextures;
55
58
  this.layers = data.layers.map(createTiledLayer);
56
59
  this.tilesets = sortAndValidateTilesetRanges(tilesets, source);
57
60
  checkGidCoverage(this, source);
@@ -87,9 +90,9 @@ class TiledMap {
87
90
  * Only finite orthogonal maps with atlas tilesets are supported. A
88
91
  * non-orthogonal or infinite map, or a collection-of-images tileset, throws
89
92
  * {@link TiledFormatError} rather than silently producing wrong (misplaced)
90
- * or empty geometry. Object, image, and group layers are not yet converted
91
- * (Phase C2 scope: tile layers only; group layer children are flattened into
92
- * the result).
93
+ * or empty geometry. Tile layers become renderable `TileLayer`s, object
94
+ * groups become data-only `ObjectLayer`s, and image layers become data-only
95
+ * `ImageLayer`s; group layer children are flattened in document order.
93
96
  *
94
97
  * The returned `TileMap` does **not** own the tileset textures — they remain
95
98
  * in the Loader cache. Destroying the returned map does not unload textures.
@@ -113,6 +116,10 @@ class TiledMap {
113
116
  const indexToRuntime = [];
114
117
  for (let i = 0; i < this.tilesets.length; i++) {
115
118
  const tiledTs = this.tilesets[i];
119
+ if (!tiledTs) {
120
+ indexToRuntime.push(null);
121
+ continue;
122
+ }
116
123
  if (!tiledTs.texture) {
117
124
  if (tiledTs.tileTextures.size > 0) {
118
125
  throw new TiledFormatError(this.source, `tilesets/${tiledTs.name}`, `tileset "${tiledTs.name}" is a collection-of-images tileset; ` +
@@ -134,12 +141,24 @@ class TiledMap {
134
141
  columns: tiledTs.columns,
135
142
  spacing: tiledTs.spacing,
136
143
  margin: tiledTs.margin,
144
+ class: tiledTs.class,
145
+ offsetX: tiledTs.tileOffset.x,
146
+ offsetY: tiledTs.tileOffset.y,
137
147
  });
148
+ // Carry per-tile metadata (properties + animation frames) into the runtime
149
+ // tileset. Without this, Tiled tile animations and per-tile properties are
150
+ // lost at conversion. Out-of-range entries are skipped defensively.
151
+ const defs = buildTileDefinitions(tiledTs.tiles, tiledTs.tileCount);
152
+ if (defs.length > 0) {
153
+ rts._setDefinitions(defs);
154
+ }
138
155
  runtimeTilesets.push(rts);
139
156
  indexToRuntime.push(rts);
140
157
  }
141
- // Collect and convert tile layers, flattening group layers.
158
+ // Collect and convert tile + object + image layers, flattening group layers.
142
159
  const runtimeLayers = [];
160
+ const runtimeObjectLayers = [];
161
+ const runtimeImageLayers = [];
143
162
  const convertLayers = (layers) => {
144
163
  for (const layer of layers) {
145
164
  if (layer instanceof TiledGroupLayer) {
@@ -158,13 +177,38 @@ class TiledMap {
158
177
  opacity: layer.opacity,
159
178
  offsetX: layer.offsetX,
160
179
  offsetY: layer.offsetY,
180
+ parallaxX: layer.parallaxX,
181
+ parallaxY: layer.parallaxY,
182
+ class: layer.class,
183
+ tintColor: parseTiledColor(layer.tintColor),
161
184
  });
162
185
  if (layer.data) {
163
186
  populateTileLayer(rLayer, layer.data, this.tilesets, indexToRuntime);
164
187
  }
165
188
  runtimeLayers.push(rLayer);
166
189
  }
167
- // ObjectLayer, ImageLayer: not converted in Phase C2 (tile layers only).
190
+ else if (layer instanceof TiledObjectLayer) {
191
+ runtimeObjectLayers.push(convertObjectLayer(layer, this.tilesets, indexToRuntime));
192
+ }
193
+ else if (layer instanceof TiledImageLayer) {
194
+ runtimeImageLayers.push(new ImageLayer({
195
+ id: layer.id,
196
+ name: layer.name,
197
+ class: layer.class,
198
+ image: resolveTiledUrl(layer.image, this.source),
199
+ texture: this._imageTextures.get(layer.id) ?? null,
200
+ visible: layer.visible,
201
+ opacity: layer.opacity,
202
+ offsetX: layer.offsetX,
203
+ offsetY: layer.offsetY,
204
+ parallaxX: layer.parallaxX,
205
+ parallaxY: layer.parallaxY,
206
+ tintColor: parseTiledColor(layer.tintColor),
207
+ repeatX: layer.repeatX,
208
+ repeatY: layer.repeatY,
209
+ properties: convertProperties(layer.properties),
210
+ }));
211
+ }
168
212
  }
169
213
  };
170
214
  convertLayers(this.layers);
@@ -176,6 +220,12 @@ class TiledMap {
176
220
  tileHeight: this.tileHeight,
177
221
  tilesets: runtimeTilesets,
178
222
  layers: runtimeLayers,
223
+ objectLayers: runtimeObjectLayers,
224
+ imageLayers: runtimeImageLayers,
225
+ class: this.class,
226
+ backgroundColor: parseTiledColor(this.backgroundColor),
227
+ renderOrder: this.renderOrder ?? 'right-down',
228
+ properties: convertProperties(this.properties),
179
229
  });
180
230
  }
181
231
  /**
@@ -187,44 +237,305 @@ class TiledMap {
187
237
  // Intentionally empty: all sub-resources (textures) are Loader-owned.
188
238
  }
189
239
  }
240
+ /**
241
+ * Resolve a raw (flag-bearing) Tiled GID to a runtime {@link ResolvedTile}, or
242
+ * `null` for an empty cell or a GID whose tileset was skipped (no atlas image).
243
+ */
244
+ function resolveGid(rawGid, tiledTilesets, indexToRuntime) {
245
+ if (rawGid === 0)
246
+ return null;
247
+ const baseGid = maskTiledGid(rawGid);
248
+ const transform = {
249
+ flipX: (rawGid >>> 0 & TILED_FLIPPED_HORIZONTALLY_FLAG) !== 0,
250
+ flipY: (rawGid >>> 0 & TILED_FLIPPED_VERTICALLY_FLAG) !== 0,
251
+ diagonal: (rawGid >>> 0 & TILED_FLIPPED_DIAGONALLY_FLAG) !== 0,
252
+ };
253
+ // Find owning tileset: rightmost with firstGid <= baseGid (tilesets sorted asc).
254
+ let tsIdx = -1;
255
+ for (let t = tiledTilesets.length - 1; t >= 0; t--) {
256
+ const candidate = tiledTilesets[t];
257
+ if (candidate && baseGid >= candidate.firstGid) {
258
+ tsIdx = t;
259
+ break;
260
+ }
261
+ }
262
+ if (tsIdx === -1)
263
+ return null;
264
+ const owningTs = tiledTilesets[tsIdx];
265
+ const runtimeTs = indexToRuntime[tsIdx];
266
+ if (!owningTs || !runtimeTs)
267
+ return null; // tileset was skipped (no atlas image)
268
+ return {
269
+ tileset: runtimeTs,
270
+ localTileId: baseGid - owningTs.firstGid,
271
+ transform,
272
+ };
273
+ }
190
274
  /** Fill a `TileLayer` from a flat GID array decoded from a Tiled tile layer. */
191
275
  function populateTileLayer(layer, gids, tiledTilesets, indexToRuntime) {
192
276
  for (let i = 0; i < gids.length; i++) {
193
- const rawGid = gids[i];
194
- if (rawGid === 0)
277
+ const gid = gids[i];
278
+ if (gid === undefined)
195
279
  continue;
196
- const baseGid = maskTiledGid(rawGid);
197
- const transform = {
198
- flipX: (rawGid >>> 0 & TILED_FLIPPED_HORIZONTALLY_FLAG) !== 0,
199
- flipY: (rawGid >>> 0 & TILED_FLIPPED_VERTICALLY_FLAG) !== 0,
200
- diagonal: (rawGid >>> 0 & TILED_FLIPPED_DIAGONALLY_FLAG) !== 0,
280
+ const tile = resolveGid(gid, tiledTilesets, indexToRuntime);
281
+ if (!tile)
282
+ continue;
283
+ layer.setTileAt(i % layer.width, Math.floor(i / layer.width), tile);
284
+ }
285
+ }
286
+ /** Convert a parsed `TiledObjectLayer` into a runtime data-only `ObjectLayer`. */
287
+ function convertObjectLayer(layer, tiledTilesets, indexToRuntime) {
288
+ const objects = [];
289
+ for (const object of layer.objects) {
290
+ const converted = convertObject(object, tiledTilesets, indexToRuntime);
291
+ if (converted)
292
+ objects.push(converted);
293
+ }
294
+ return new ObjectLayer({
295
+ id: layer.id,
296
+ name: layer.name,
297
+ class: layer.class,
298
+ visible: layer.visible,
299
+ opacity: layer.opacity,
300
+ offsetX: layer.offsetX,
301
+ offsetY: layer.offsetY,
302
+ drawOrder: layer.drawOrder,
303
+ objects,
304
+ properties: convertProperties(layer.properties),
305
+ });
306
+ }
307
+ /**
308
+ * Convert one `TiledObject` to a `TileMapObject`. Tile objects whose tileset
309
+ * was skipped are dropped — returns `null`.
310
+ */
311
+ function convertObject(object, tiledTilesets, indexToRuntime) {
312
+ const base = {
313
+ id: object.id,
314
+ name: object.name,
315
+ type: object.type,
316
+ x: object.x,
317
+ y: object.y,
318
+ width: object.width,
319
+ height: object.height,
320
+ rotation: object.rotation,
321
+ visible: object.visible,
322
+ properties: convertProperties(object.properties),
323
+ };
324
+ if (object.text) {
325
+ const t = object.text;
326
+ const color = t.color !== undefined ? parseTiledColor(t.color) : undefined;
327
+ const textStyle = {
328
+ text: t.text,
329
+ ...(color !== undefined && { color }),
330
+ ...(t.fontfamily !== undefined && { fontFamily: t.fontfamily }),
331
+ ...(t.pixelsize !== undefined && { pixelSize: t.pixelsize }),
332
+ ...(t.bold !== undefined && { bold: t.bold }),
333
+ ...(t.italic !== undefined && { italic: t.italic }),
334
+ ...(t.underline !== undefined && { underline: t.underline }),
335
+ ...(t.strikeout !== undefined && { strikeout: t.strikeout }),
336
+ ...(t.wrap !== undefined && { wrap: t.wrap }),
337
+ ...(t.halign !== undefined && { halign: t.halign }),
338
+ ...(t.valign !== undefined && { valign: t.valign }),
201
339
  };
202
- // Find owning tileset: rightmost with firstGid <= baseGid (tilesets sorted asc).
203
- let tsIdx = -1;
204
- for (let t = tiledTilesets.length - 1; t >= 0; t--) {
205
- if (baseGid >= tiledTilesets[t].firstGid) {
206
- tsIdx = t;
207
- break;
208
- }
340
+ return { ...base, kind: 'text', text: textStyle };
341
+ }
342
+ if (object.gid !== undefined) {
343
+ const tile = resolveGid(object.gid, tiledTilesets, indexToRuntime);
344
+ if (!tile)
345
+ return null;
346
+ return { ...base, kind: 'tile', tile };
347
+ }
348
+ if (object.point) {
349
+ return { ...base, kind: 'point' };
350
+ }
351
+ if (object.ellipse) {
352
+ return { ...base, kind: 'ellipse' };
353
+ }
354
+ if (object.polygon) {
355
+ return { ...base, kind: 'polygon', points: toPoints(object.polygon) };
356
+ }
357
+ if (object.polyline) {
358
+ return { ...base, kind: 'polyline', points: toPoints(object.polyline) };
359
+ }
360
+ return { ...base, kind: 'rectangle' };
361
+ }
362
+ const toPoints = (points) => points.map(p => ({ x: p.x, y: p.y }));
363
+ /**
364
+ * Parse a Tiled colour string (`#RRGGBB` or `#AARRGGBB`) into a `0xRRGGBB`
365
+ * integer, dropping any alpha. Returns `null` for an absent or malformed value.
366
+ */
367
+ function parseTiledColor(value) {
368
+ if (value === undefined || value === '')
369
+ return null;
370
+ const hex = value.startsWith('#') ? value.slice(1) : value;
371
+ let rrggbb;
372
+ if (hex.length === 8) {
373
+ rrggbb = hex.slice(2); // drop leading alpha
374
+ }
375
+ else if (hex.length === 6) {
376
+ rrggbb = hex;
377
+ }
378
+ else {
379
+ return null;
380
+ }
381
+ const parsed = Number.parseInt(rrggbb, 16);
382
+ return Number.isNaN(parsed) ? null : parsed;
383
+ }
384
+ /**
385
+ * Build runtime {@link TileDefinition}s from a Tiled tileset's per-tile data,
386
+ * carrying over per-tile properties, animation frames, and collision shapes
387
+ * (the tile's `objectgroup`). Tiles whose `id` is out of range, and animation
388
+ * frames referencing out-of-range local ids, are skipped so the runtime tileset
389
+ * never receives malformed definitions.
390
+ */
391
+ function buildTileDefinitions(tiles, tileCount) {
392
+ const defs = [];
393
+ for (const tile of tiles) {
394
+ if (tile.id < 0 || tile.id >= tileCount)
395
+ continue;
396
+ const properties = tile.properties ? convertProperties(tile.properties) : undefined;
397
+ const hasProps = properties !== undefined && Object.keys(properties).length > 0;
398
+ let animation;
399
+ if (tile.animation && tile.animation.length > 0) {
400
+ const frames = tile.animation
401
+ .filter(frame => frame.tileid >= 0 && frame.tileid < tileCount)
402
+ .map(frame => ({ localTileId: frame.tileid, duration: frame.duration }));
403
+ if (frames.length > 0)
404
+ animation = frames;
209
405
  }
210
- if (tsIdx === -1)
406
+ let collision;
407
+ if (tile.objectgroup && tile.objectgroup.objects.length > 0) {
408
+ const shapes = tile.objectgroup.objects
409
+ .map(obj => convertCollisionObject(obj))
410
+ .filter((obj) => obj !== null);
411
+ if (shapes.length > 0)
412
+ collision = shapes;
413
+ }
414
+ if (!hasProps && animation === undefined && collision === undefined)
211
415
  continue;
212
- const runtimeTs = indexToRuntime[tsIdx];
213
- if (!runtimeTs)
214
- continue; // tileset was skipped (no atlas image)
215
- const tile = {
216
- tileset: runtimeTs,
217
- localTileId: baseGid - tiledTilesets[tsIdx].firstGid,
218
- transform,
219
- };
220
- layer.setTileAt(i % layer.width, Math.floor(i / layer.width), tile);
416
+ defs.push({
417
+ localTileId: tile.id,
418
+ ...(hasProps && { properties }),
419
+ ...(animation !== undefined && { animation }),
420
+ ...(collision !== undefined && { collision }),
421
+ });
422
+ }
423
+ return defs;
424
+ }
425
+ /**
426
+ * Convert a raw `TiledObjectData` to a runtime `TileMapObject` for use as a
427
+ * per-tile collision shape. Text objects and tile-object (gid) references are
428
+ * dropped — returns `null`. Does not perform GID resolution; collision shapes
429
+ * in tile objectgroups are almost exclusively plain geometry.
430
+ */
431
+ function convertCollisionObject(obj) {
432
+ if (obj.text)
433
+ return null; // text not representable as a collision shape
434
+ if (obj.gid !== undefined)
435
+ return null; // tile objects require GID resolution not available here
436
+ const base = {
437
+ id: obj.id,
438
+ name: obj.name,
439
+ type: obj.type,
440
+ x: obj.x,
441
+ y: obj.y,
442
+ width: obj.width,
443
+ height: obj.height,
444
+ rotation: obj.rotation,
445
+ visible: obj.visible,
446
+ properties: convertProperties(obj.properties ?? []),
447
+ };
448
+ if (obj.point === true)
449
+ return { ...base, kind: 'point' };
450
+ if (obj.ellipse === true)
451
+ return { ...base, kind: 'ellipse' };
452
+ if (obj.polygon)
453
+ return { ...base, kind: 'polygon', points: toPoints(obj.polygon) };
454
+ if (obj.polyline)
455
+ return { ...base, kind: 'polyline', points: toPoints(obj.polyline) };
456
+ return { ...base, kind: 'rectangle' };
457
+ }
458
+ /**
459
+ * Project Tiled custom properties to the generic flat property bag.
460
+ * `object`-typed properties become a {@link TilePropertyKind.ObjectRef}
461
+ * (the wire value is already the referenced object's numeric id — Tiled has
462
+ * no LDtk-style navigation fields, so those stay `undefined`). `class`-typed
463
+ * properties recursively convert their nested member bag into a
464
+ * {@link TileProperties}.
465
+ */
466
+ function convertProperties(properties) {
467
+ if (properties.length === 0)
468
+ return Object.freeze({});
469
+ const out = {};
470
+ for (const property of properties) {
471
+ const value = convertPropertyValue(property);
472
+ if (value !== undefined) {
473
+ out[property.name] = value;
474
+ }
221
475
  }
476
+ return Object.freeze(out);
477
+ }
478
+ /** Convert one {@link TiledPropertyData} to its canonical {@link TilePropertyValue}. */
479
+ function convertPropertyValue(property) {
480
+ switch (property.type) {
481
+ case 'string':
482
+ case 'int':
483
+ case 'float':
484
+ case 'bool':
485
+ case 'color':
486
+ case 'file':
487
+ return property.value;
488
+ case 'object':
489
+ return { kind: TilePropertyKind.ObjectRef, id: property.value };
490
+ case 'class':
491
+ return convertClassPropertyValue(property.value, property.propertytype);
492
+ default: {
493
+ // Exhaustiveness check: if a new TiledPropertyType is ever added,
494
+ // `property.type` will fail to narrow to `never` here and tsc will error.
495
+ property.type;
496
+ throw new Error(`convertProperties: unrecognised Tiled property type "${property.type}".`);
497
+ }
498
+ }
499
+ }
500
+ /**
501
+ * Reserved key under which a `class`-typed property's Tiled custom-class name
502
+ * ({@link TiledPropertyData.propertytype}, e.g. `"Stats"`) is stored inside the
503
+ * converted nested {@link TileProperties} bag, mirroring the `ldtkUid`/
504
+ * `ldtkWorldIid`-style reserved-metadata-key convention used by the LDtk
505
+ * adapter (`packages/exojs-ldtk/src/ldtkToTileMap.ts`). Only set on the
506
+ * top-level converted bag for a class-typed property that has a
507
+ * `propertytype` — nested-class members carry no `propertytype` of their own
508
+ * in Tiled's data model, so recursive calls never set it.
509
+ */
510
+ const tiledClassNameProperty = 'tiledClassName';
511
+ /**
512
+ * Recursively convert a `class`-typed property's nested member bag into a
513
+ * {@link TileProperties}. Scalar members pass through; nested-class members
514
+ * recurse (Tiled classes may nest arbitrarily deep). When `propertytype` is
515
+ * given (the Tiled custom-class name), it is tagged onto the bag under the
516
+ * reserved {@link tiledClassNameProperty} key, applied last so it can never
517
+ * be clobbered by a same-named member.
518
+ */
519
+ function convertClassPropertyValue(value, propertytype) {
520
+ const out = {};
521
+ for (const [name, member] of Object.entries(value)) {
522
+ out[name] =
523
+ typeof member === 'string' || typeof member === 'number' || typeof member === 'boolean'
524
+ ? member
525
+ : convertClassPropertyValue(member);
526
+ }
527
+ if (propertytype !== undefined) {
528
+ out[tiledClassNameProperty] = propertytype;
529
+ }
530
+ return Object.freeze(out);
222
531
  }
223
532
  function sortAndValidateTilesetRanges(tilesets, source) {
224
533
  const sorted = [...tilesets].sort((a, b) => a.firstGid - b.firstGid);
225
534
  for (let i = 1; i < sorted.length; i++) {
226
535
  const previous = sorted[i - 1];
227
536
  const current = sorted[i];
537
+ if (previous === undefined || current === undefined)
538
+ continue;
228
539
  if (current.firstGid === previous.firstGid) {
229
540
  throw new TiledFormatError(source, 'tilesets', `duplicate firstgid ${current.firstGid} (tilesets "${previous.name}" and "${current.name}")`);
230
541
  }
@@ -237,6 +548,8 @@ function sortAndValidateTilesetRanges(tilesets, source) {
237
548
  function walkLayers(layers, path, visit) {
238
549
  for (let i = 0; i < layers.length; i++) {
239
550
  const layer = layers[i];
551
+ if (layer === undefined)
552
+ continue;
240
553
  const layerPath = `${path}[${i}]`;
241
554
  visit(layer, layerPath);
242
555
  if (layer instanceof TiledGroupLayer) {
@@ -247,6 +560,8 @@ function walkLayers(layers, path, visit) {
247
560
  function checkGidArray(gids, map, source, path) {
248
561
  for (let i = 0; i < gids.length; i++) {
249
562
  const gid = gids[i];
563
+ if (gid === undefined)
564
+ continue;
250
565
  if (gid !== 0 && map.findTilesetForGid(gid) === undefined) {
251
566
  throw new TiledFormatError(source, `${path}[${i}]`, `gid ${gid} (masked: ${maskTiledGid(gid)}) is not covered by any tileset`);
252
567
  }
@@ -260,13 +575,19 @@ function checkGidCoverage(map, source) {
260
575
  }
261
576
  if (layer.chunks !== undefined) {
262
577
  for (let c = 0; c < layer.chunks.length; c++) {
263
- checkGidArray(layer.chunks[c].data, map, source, `${layerPath}.chunks[${c}].data`);
578
+ const chunk = layer.chunks[c];
579
+ if (chunk === undefined)
580
+ continue;
581
+ checkGidArray(chunk.data, map, source, `${layerPath}.chunks[${c}].data`);
264
582
  }
265
583
  }
266
584
  }
267
585
  else if (layer instanceof TiledObjectLayer) {
268
586
  for (let o = 0; o < layer.objects.length; o++) {
269
- const gid = layer.objects[o].gid;
587
+ const object = layer.objects[o];
588
+ if (object === undefined)
589
+ continue;
590
+ const gid = object.gid;
270
591
  if (gid !== undefined && map.findTilesetForGid(gid) === undefined) {
271
592
  throw new TiledFormatError(source, `${layerPath}.objects[${o}].gid`, `gid ${gid} (masked: ${maskTiledGid(gid)}) is not covered by any tileset`);
272
593
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TiledMap.js","sources":["../../../src/TiledMap.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAeA;;;;;;;;;;;;AAYG;MACU,QAAQ,CAAA;;AAEH,IAAA,MAAM;;AAEN,IAAA,IAAI;AAEJ,IAAA,WAAW;AACX,IAAA,WAAW;AACX,IAAA,KAAK;;AAEL,IAAA,KAAK;;AAEL,IAAA,MAAM;;AAEN,IAAA,SAAS;;AAET,IAAA,UAAU;AACV,IAAA,QAAQ;AACR,IAAA,eAAe;AACf,IAAA,MAAM;;AAEN,IAAA,QAAQ;AACR,IAAA,UAAU;AAE1B,IAAA,WAAA,CAAmB,MAAc,EAAE,IAAkB,EAAE,QAAiC,EAAA;AACtF,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AACpB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW;AACnC,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;AAC7B,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;AACvB,QAAA,I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I,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC/B,IAAI,MAAM,KAAK,SAAS;oBAAE;AAC1B,gBAAA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG;AAEtB,gBAAA,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;oBACjE,MAAM,IAAI,gBAAgB,CAAC,MAAM,EAAE,CAAA,EAAG,SAAS,YAAY,CAAC,CAAA,KAAA,CAAO,EAAE,CAAA,IAAA,EAAO,GAAG,aAAa,YAAY,CAAC,GAAG,CAAC,CAAA,+BAAA,CAAiC,CAAC;gBACjJ;YACF;QACF;AACF,IAAA,CAAC,CAAC;AACJ;;;;"}
@@ -18,13 +18,13 @@ export declare class TiledObject {
18
18
  readonly height: number;
19
19
  readonly rotation: number;
20
20
  readonly visible: boolean;
21
- readonly gid?: number;
21
+ readonly gid?: number | undefined;
22
22
  readonly point: boolean;
23
23
  readonly ellipse: boolean;
24
- readonly polygon?: readonly TiledPointData[];
25
- readonly polyline?: readonly TiledPointData[];
26
- readonly text?: TiledTextData;
27
- readonly template?: string;
24
+ readonly polygon?: readonly TiledPointData[] | undefined;
25
+ readonly polyline?: readonly TiledPointData[] | undefined;
26
+ readonly text?: TiledTextData | undefined;
27
+ readonly template?: string | undefined;
28
28
  readonly properties: readonly TiledPropertyData[];
29
29
  constructor(data: TiledObjectData);
30
30
  /** Looks up a custom property by name. */