Side

Side

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 A, B, or C

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
Name Type Attributes Default Description
map Map <optional>
new Map()

The map for this side

data Object <optional>
{}

The metadata for the side

sideName String <optional>
'A'

The name of this side, either A, B, or C

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 .bin file to load

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