MCPcopy Create free account
hub / github.com/JKPotato-Computer/SignMaker / constructor

Method constructor

js/Post.js:7–19  ·  view source on GitHub ↗

* Post that contains the panels. * @param {string} polePosition - Position of the poles on which to display the panels. * @param {number} [lanesWide=1] - How many lanes wide the post should appear to be.

(polePosition, lanesWide = 1)

Source from the content-addressed store, hash-verified

5 * @param {number} [lanesWide=1] - How many lanes wide the post should appear to be.
6 */
7 constructor(polePosition, lanesWide = 1) {
8 if (this.polePositions.includes(polePosition)) {
9 this.polePosition = polePosition;
10 } else {
11 this.polePosition = this.polePositions[0];
12 }
13 if (lanesWide >= 1 && lanesWide <= 6) {
14 this.lanesWide = lanesWide;
15 } else {
16 this.lanesWide = 1;
17 }
18 this.panels = [];
19 }
20
21 /**
22 * Create a new panel for the post. Add it to the end of the list of existing panels.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected