new Side(dataopt)
- Source:
Properties:
Name | Type | Description |
---|---|---|
map |
Map | The map for this side |
data |
Object | The metadata for the side |
sideName |
String | The name of this side, either |
Creates a Side instance
Example
// returns a Side
const { Side } = require('lucid-dream');
const side = new Side();
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object |
<optional> |
{}
|
Optional object that contains properties for the constructor Properties
|
Methods
(async) decode(file) → {null}
- Source:
Load the map data and metadata for a side from a .bin
file
Example
const { Side } = require('lucid-dream');
const side = new Side();
await side.decode('/path/to/my-map.bin');
Parameters:
Name | Type | Description |
---|---|---|
file |
String | The path to the |
Returns:
- Type
- null
(async) encode(file)
- Source:
Encodes a side to a file
Example
const { Side } = require('lucid-dream');
const side = new Side();
await side.decode('/path/to/my-map.bin');
// make changes to side/map/meta data
await side.encode('/path/to/my-new-map.bin');
Parameters:
Name | Type | Description |
---|---|---|
file |
String | The file to which to write the encoded side |