new Chapter(dataopt, sidesopt)
- Source:
Example
// Create a chapter with an empty A, B, and C side
const { Chapter, Side } = require('lucid-dream');
const chapter = new Chapter({
name: 'Chapter 1'
sides: {
A: new Side(),
B: new Side(),
C: new Side()
}
});
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object |
<optional> |
{}
|
An object containing the attributes of the chapter to be created Properties
|
||||||||||
sides |
Object |
<optional> |
{ A: new Side() }
|
An object containing key/value pairs. The key indicates the name of the side (i.e., |
Methods
(async) package(mapDir) → {null}
- Source:
Encode the chapter. This is usually done as part of Mod#package, but can also be directly to
encode the .bin
file(s) of the sides for an individual chapter.
Example
// Encode a chapter and its sides to the `outputDir` directory
const { Chapter } = require('lucid-dream');
const chapter = new Chapter({ name: 'My Chapter' });
// make an additions to your chapter and sides
await chapter.encode('outputDir');
Parameters:
Name | Type | Description |
---|---|---|
mapDir |
String | The directory in which to encode the chapter and its sides |
Returns:
- Type
- null