| 1 | class Sign { |
| 2 | |
| 3 | /** |
| 4 | * Cretes a new sign. |
| 5 | * @param {Object} [opt] - Optional parameters. |
| 6 | * @param {string} [opt.controlText="New Sign"] - Control cities to display on the sign. |
| 7 | * @param {string} [opt.shieldPosition] - Where the shields should be displayed relative to the control cities. |
| 8 | * @param {boolean} [opt.shieldBacks=false] - Whether or not shields should be displayed with backings. |
| 9 | * @param {string} [opt.guideArrow] - Which guide arrow to display on the sign, if any. |
| 10 | * @param {number} [opt.guideArrowLanes=1] - Number of lanes actoss to display guide arrows. |
| 11 | * @param {string} [opt.otherSymbols] - Other symbols on the bottom of signs (like Quebec style exit markers) |
| 12 | * @param {string} [opt.oSNum=""] - Number to place on otherSymbol |
| 13 | * @param {string} [opt.actionMessage=""] - Custom subtext to display on the sign. |
| 14 | * @param {Shield[]} [opt.shields] - Array of shields to include on sign. |
| 15 | */ |
| 16 | constructor({ |
| 17 | // shield |
| 18 | shieldPosition, |
| 19 | shieldBacks = false, |
| 20 | |
| 21 | // arrow |
| 22 | arrowMode = "Standard", |
| 23 | arrows = [], |
| 24 | guideArrow, |
| 25 | guideArrowLanes = 1, |
| 26 | exitguideArrows = "Down Arrow", |
| 27 | exitOnlyPadding = 0, |
| 28 | |
| 29 | // other |
| 30 | otherSymbol, |
| 31 | oSNum = "", |
| 32 | |
| 33 | // subpanel |
| 34 | subPanels = [], |
| 35 | |
| 36 | // global settings |
| 37 | |
| 38 | // shields |
| 39 | shields = [], |
| 40 | shieldDistance = 0.8, |
| 41 | |
| 42 | // main info |
| 43 | controlText = "", |
| 44 | |
| 45 | // settings |
| 46 | globalPositioning = "Top", |
| 47 | |
| 48 | // action message |
| 49 | actionMessage = "", |
| 50 | advisoryMessage = true, |
| 51 | advisoryText = "", |
| 52 | |
| 53 | // panel |
| 54 | padding = "0.5rem 0.75rem 0.5rem 0.75rem", |
| 55 | arrowPosition = "Middle" |
| 56 | } = {} |
| 57 | ) { |
| 58 | if (this.shieldPositions.includes(shieldPosition)) { |
| 59 | this.shieldPosition = shieldPosition; |
| 60 | } else { |
nothing calls this directly
no outgoing calls
no test coverage detected