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

Method duplicateShield

js/Sign.js:134–151  ·  view source on GitHub ↗
(shieldIndex,number)

Source from the content-addressed store, hash-verified

132 }
133
134 duplicateShield(shieldIndex,number) {
135 const existingShield = this.subPanels[number].shields[shieldIndex];
136 const newShield = new Shield({
137 type: existingShield.type,
138 routeNumber: existingShield.routeNumber,
139 to: existingShield.to,
140 specialBannerType: existingShield.specialBannerType,
141 bannerType: existingShield.bannerType,
142 bannerType2: existingShield.bannerType2,
143 bannerPosition: existingShield.bannerPosition
144 })
145 if (number != -1) {
146 this.subPanels[number].shields.splice(++shieldIndex,0,newShield);
147 } else {
148 this.shields.splice(++shieldIndex,0,newShield)
149 }
150
151 }
152
153 /**
154 * Delete an existing shield at the requested index.

Callers 2

duplicateShieldFunction · 0.80
duplicateShieldFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected