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

Method constructor

js/ExitTab.js:8–58  ·  view source on GitHub ↗

* Creates a new ExitTab. * @param {string} number - Number to display on the exit tab. * @param {string} [position=null] - Position to display the exit tab relative to the sign. * @param {string} [width=null] - Width of the exit tab (narrow or wide).

({
		number = null,
		position = null,
		width = null,
		color = null,
		variant = "Default",
		icon = null,
		useTextBasedIcon = false,
		fullBorder = false,
		topOffset = true,
		showLeft = false,
		borderThickness = 0.2,
		minHeight = 2.25,
		nestedExitTabs = [],
		FHWAFont = false,
		fontSize = 18
		} = {}
	)

Source from the content-addressed store, hash-verified

6 * @param {string} [width=null] - Width of the exit tab (narrow or wide).
7 */
8 constructor ({
9 number = null,
10 position = null,
11 width = null,
12 color = null,
13 variant = "Default",
14 icon = null,
15 useTextBasedIcon = false,
16 fullBorder = false,
17 topOffset = true,
18 showLeft = false,
19 borderThickness = 0.2,
20 minHeight = 2.25,
21 nestedExitTabs = [],
22 FHWAFont = false,
23 fontSize = 18
24 } = {}
25 ) {
26 this.number = number;
27 if (this.positions.includes(position)) {
28 this.position = position;
29 } else {
30 this.position = this.positions[1];
31 }
32 if (this.widths.includes(width)) {
33 this.width = width;
34 } else {
35 this.width = this.widths[0];
36 }
37 if (this.colors.includes(color)) {
38 this.color = color;
39 } else {
40 this.color = this.colors[0];
41 }
42
43 if (this.variants.includes(variant)) {
44 this.variant = variant;
45 } else {
46 this.variant = this.variants[0];
47 }
48
49 this.fullBorder = fullBorder;
50 this.borderThickness = borderThickness;
51 this.topOffset = topOffset;
52 this.minHeight = minHeight;
53 this.nestedExitTabs = nestedExitTabs;
54 this.FHWAFont = FHWAFont;
55 this.icon = icon;
56 this.showLeft = showLeft;
57 this.fontSize = fontSize;
58 }
59
60 nestExitTab() {
61 const exitTab = new ExitTab();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected