Methods
create(args) → {Piece}
- Description:
Reconstruct a piece from its resolved args array. String args are plain values; Piece args are already-resolved nested registry lookups (the Registry resolves "^"-escaped sub-keys before calling create, exactly as it does today).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
args |
Array.<(string|Piece)> |
Returns:
- Type
- Piece
example() → {Piece}
- Description:
Return a representative instance of this type for display in the map editor.
- Source:
Returns:
- Type
- Piece
store(piece) → {string}
- Description:
Return the canonical serialized key for this piece, e.g. "Door|Blue|off". The key must be parseable back via create().
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
piece |
Piece |
Returns:
- Type
- string
tag() → {string}
- Description:
Return the editor category for this type, e.g. "Terrain", "Room Features".
- Source:
Returns:
- Type
- string
template(typeId) → {string}
- Description:
Given the typeId, return a human-readable template showing the key format, e.g. "Door|{color}|{state}". Used by the editor to guide authoring.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
typeId |
string |
Returns:
- Type
- string