Classes
Methods
addLayer(layer) → {Object}
Add a layer to the world metadata registry.
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layer | Object | Properties
|
Layer record
- Type:
- Object
addZone(zoneConfig) → {Object}
Register a semantic zone (e.g. safe area, dungeon entrance, hazard field).
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zoneConfig | Object | Properties
|
Registered zone
- Type:
- Object
getComposedMetadataAt(x, y) → {Object}
Resolve composite metadata at coordinate (x, y) across all layers with override conflict resolution. Higher zIndex layers override lower zIndex layers for collision/walkability and material. Explicit collision layer takes precedence over visual layer.
| Name | Type | Description |
|---|---|---|
x | number | Grid X |
y | number | Grid Y |
Composite tile metadata
- Type:
- Object
getLayer(layerId) → {Object}
Get a layer by ID. Throws if layer does not exist.
| Name | Type | Description |
|---|---|---|
layerId | string |
- Type:
- Object
getTile(tileId) → {Object}
Get tile metadata definition. Throws an Error if tileId is unknown.
| Name | Type | Description |
|---|---|---|
tileId | number | |
- Type:
- Object
getZonesAt(x, y, elevationopt) → {Array.<Object>}
Get all zones containing world position (x, y) with matching elevation interval.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
x | number | |||
y | number | |||
elevation | number | <optional> | 0 |
- Type:
- Array.<Object>
hasTile(tileId) → {boolean}
Check if a tile ID is registered.
| Name | Type | Description |
|---|---|---|
tileId | number | |
- Type:
- boolean
registerTile(tileId, metadata) → {Object}
Register semantic metadata for a tile type.
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tileId | number | | ||||||||||||||||||||||||||||||||||||||||||||||
metadata | Object | Properties
|
- Source
Registered definition
- Type:
- Object
setTileAt(layerId, x, y, tileId)
Set a tile in a layer at specific grid coordinate.
| Name | Type | Description |
|---|---|---|
layerId | string | |
x | number | Grid X |
y | number | Grid Y |
tileId | number | |