@verticopolis/components 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (791) hide show
  1. package/ASSETS-LICENSE.md +49 -0
  2. package/LICENSE +21 -0
  3. package/README.md +121 -2
  4. package/lib/audio/Audio.d.ts +110 -0
  5. package/lib/audio/Audio.js +199 -0
  6. package/lib/audio/Audio.js.map +1 -0
  7. package/lib/audio/ToneAudioEngine.d.ts +125 -0
  8. package/lib/audio/ToneAudioEngine.js +452 -0
  9. package/lib/audio/ToneAudioEngine.js.map +1 -0
  10. package/lib/audio/audioAssets.d.ts +25 -0
  11. package/lib/audio/audioAssets.js +28 -0
  12. package/lib/audio/audioAssets.js.map +1 -0
  13. package/lib/audio/awayWatch.d.ts +17 -0
  14. package/lib/audio/awayWatch.js +33 -0
  15. package/lib/audio/awayWatch.js.map +1 -0
  16. package/lib/audio/firstCueLatch.d.ts +18 -0
  17. package/lib/audio/firstCueLatch.js +34 -0
  18. package/lib/audio/firstCueLatch.js.map +1 -0
  19. package/lib/audio/lightEnvelope.d.ts +64 -0
  20. package/lib/audio/lightEnvelope.js +124 -0
  21. package/lib/audio/lightEnvelope.js.map +1 -0
  22. package/lib/audio/lightSynth.d.ts +125 -0
  23. package/lib/audio/lightSynth.js +203 -0
  24. package/lib/audio/lightSynth.js.map +1 -0
  25. package/lib/audio/toneContext.d.ts +30 -0
  26. package/lib/audio/toneContext.js +79 -0
  27. package/lib/audio/toneContext.js.map +1 -0
  28. package/lib/audio/toneCrowd.d.ts +62 -0
  29. package/lib/audio/toneCrowd.js +429 -0
  30. package/lib/audio/toneCrowd.js.map +1 -0
  31. package/lib/audio/toneCrowdData.d.ts +144 -0
  32. package/lib/audio/toneCrowdData.js +317 -0
  33. package/lib/audio/toneCrowdData.js.map +1 -0
  34. package/lib/audio/toneCrowdPrograms.d.ts +71 -0
  35. package/lib/audio/toneCrowdPrograms.js +273 -0
  36. package/lib/audio/toneCrowdPrograms.js.map +1 -0
  37. package/lib/audio/toneCrowdVoices.d.ts +49 -0
  38. package/lib/audio/toneCrowdVoices.js +212 -0
  39. package/lib/audio/toneCrowdVoices.js.map +1 -0
  40. package/lib/audio/toneMusicVoices.d.ts +11 -0
  41. package/lib/audio/toneMusicVoices.js +31 -0
  42. package/lib/audio/toneMusicVoices.js.map +1 -0
  43. package/lib/audio/tonePercussion.d.ts +45 -0
  44. package/lib/audio/tonePercussion.js +97 -0
  45. package/lib/audio/tonePercussion.js.map +1 -0
  46. package/lib/audio/toneRain.d.ts +23 -0
  47. package/lib/audio/toneRain.js +39 -0
  48. package/lib/audio/toneRain.js.map +1 -0
  49. package/lib/audio/toneRecordingMock.d.ts +89 -0
  50. package/lib/audio/toneRecordingMock.js +145 -0
  51. package/lib/audio/toneRecordingMock.js.map +1 -0
  52. package/lib/audio/toneRoomTone.d.ts +11 -0
  53. package/lib/audio/toneRoomTone.js +27 -0
  54. package/lib/audio/toneRoomTone.js.map +1 -0
  55. package/lib/audio/toneScenes.d.ts +57 -0
  56. package/lib/audio/toneScenes.js +208 -0
  57. package/lib/audio/toneScenes.js.map +1 -0
  58. package/lib/audio/toneTracks.d.ts +50 -0
  59. package/lib/audio/toneTracks.js +356 -0
  60. package/lib/audio/toneTracks.js.map +1 -0
  61. package/lib/audio/toneVoices.d.ts +57 -0
  62. package/lib/audio/toneVoices.js +208 -0
  63. package/lib/audio/toneVoices.js.map +1 -0
  64. package/lib/catalog/catalogTypes.d.ts +428 -0
  65. package/lib/catalog/catalogTypes.js +102 -0
  66. package/lib/catalog/catalogTypes.js.map +1 -0
  67. package/lib/catalog/skyBridgeTypes.d.ts +25 -0
  68. package/lib/catalog/skyBridgeTypes.js +7 -0
  69. package/lib/catalog/skyBridgeTypes.js.map +1 -0
  70. package/lib/catalog/starDutyTypes.d.ts +22 -0
  71. package/lib/catalog/starDutyTypes.js +7 -0
  72. package/lib/catalog/starDutyTypes.js.map +1 -0
  73. package/lib/catalog/towerCatalog.d.ts +32 -0
  74. package/lib/catalog/towerCatalog.js +44 -0
  75. package/lib/catalog/towerCatalog.js.map +1 -0
  76. package/lib/engineBinding/binding.d.ts +36 -0
  77. package/lib/engineBinding/binding.js +90 -0
  78. package/lib/engineBinding/binding.js.map +1 -0
  79. package/lib/engineBinding/catalog.d.ts +24 -0
  80. package/lib/engineBinding/catalog.js +267 -0
  81. package/lib/engineBinding/catalog.js.map +1 -0
  82. package/lib/engineBinding/engine.d.ts +866 -0
  83. package/lib/engineBinding/exportTiers.d.ts +289 -0
  84. package/lib/engineBinding/exportTiers.js +283 -0
  85. package/lib/engineBinding/exportTiers.js.map +1 -0
  86. package/lib/engineBinding/toolingMethods.d.ts +12 -0
  87. package/lib/engineBinding/toolingMethods.js +20 -0
  88. package/lib/engineBinding/toolingMethods.js.map +1 -0
  89. package/lib/events/gameplayCatalog.d.ts +57 -0
  90. package/lib/events/gameplayCatalog.js +214 -0
  91. package/lib/events/gameplayCatalog.js.map +1 -0
  92. package/lib/events/gameplayEventRules.d.ts +4 -0
  93. package/lib/events/gameplayEventRules.js +32 -0
  94. package/lib/events/gameplayEventRules.js.map +1 -0
  95. package/lib/events/gameplayEvents.d.ts +284 -0
  96. package/lib/presentation/clockText.d.ts +28 -0
  97. package/lib/presentation/clockText.js +38 -0
  98. package/lib/presentation/clockText.js.map +1 -0
  99. package/lib/presentation/facilityPresentation.d.ts +20 -0
  100. package/lib/presentation/facilityPresentation.js +164 -0
  101. package/lib/presentation/facilityPresentation.js.map +1 -0
  102. package/lib/presentation/statsCopy.d.ts +20 -0
  103. package/lib/presentation/statsCopy.js +37 -0
  104. package/lib/presentation/statsCopy.js.map +1 -0
  105. package/lib/presentation/traffic.d.ts +75 -0
  106. package/lib/presentation/traffic.js +79 -0
  107. package/lib/presentation/traffic.js.map +1 -0
  108. package/lib/presentation/viewKinds.d.ts +33 -0
  109. package/lib/presentation/viewKinds.js +88 -0
  110. package/lib/presentation/viewKinds.js.map +1 -0
  111. package/lib/presentation/viewWorld.d.ts +29 -0
  112. package/lib/presentation/viewWorld.js +31 -0
  113. package/lib/presentation/viewWorld.js.map +1 -0
  114. package/lib/render/atlas/archive.d.ts +78 -0
  115. package/lib/render/atlas/archive.js +427 -0
  116. package/lib/render/atlas/archive.js.map +1 -0
  117. package/lib/render/atlas/bake.d.ts +132 -0
  118. package/lib/render/atlas/bake.js +331 -0
  119. package/lib/render/atlas/bake.js.map +1 -0
  120. package/lib/render/atlas/bakeAdditions.d.ts +24 -0
  121. package/lib/render/atlas/bakeAdditions.js +46 -0
  122. package/lib/render/atlas/bakeAdditions.js.map +1 -0
  123. package/lib/render/atlas/browserEntry.d.ts +12 -0
  124. package/lib/render/atlas/browserEntry.js +222 -0
  125. package/lib/render/atlas/browserEntry.js.map +1 -0
  126. package/lib/render/atlas/catalog.d.ts +118 -0
  127. package/lib/render/atlas/catalog.js +253 -0
  128. package/lib/render/atlas/catalog.js.map +1 -0
  129. package/lib/render/atlas/catalogExtras.d.ts +45 -0
  130. package/lib/render/atlas/catalogExtras.js +217 -0
  131. package/lib/render/atlas/catalogExtras.js.map +1 -0
  132. package/lib/render/atlas/compose.d.ts +30 -0
  133. package/lib/render/atlas/compose.js +125 -0
  134. package/lib/render/atlas/compose.js.map +1 -0
  135. package/lib/render/atlas/cycles.d.ts +25 -0
  136. package/lib/render/atlas/cycles.js +41 -0
  137. package/lib/render/atlas/cycles.js.map +1 -0
  138. package/lib/render/atlas/lookup.d.ts +65 -0
  139. package/lib/render/atlas/lookup.js +83 -0
  140. package/lib/render/atlas/lookup.js.map +1 -0
  141. package/lib/render/atlas/pack.d.ts +23 -0
  142. package/lib/render/atlas/pack.js +50 -0
  143. package/lib/render/atlas/pack.js.map +1 -0
  144. package/lib/render/atlas/paint.d.ts +120 -0
  145. package/lib/render/atlas/paint.js +154 -0
  146. package/lib/render/atlas/paint.js.map +1 -0
  147. package/lib/render/atlas/pixels.d.ts +46 -0
  148. package/lib/render/atlas/pixels.js +158 -0
  149. package/lib/render/atlas/pixels.js.map +1 -0
  150. package/lib/render/atlas/png.d.ts +3 -0
  151. package/lib/render/atlas/png.js +102 -0
  152. package/lib/render/atlas/png.js.map +1 -0
  153. package/lib/render/atlas/raster.d.ts +34 -0
  154. package/lib/render/atlas/raster.js +114 -0
  155. package/lib/render/atlas/raster.js.map +1 -0
  156. package/lib/render/atlas/recyclingFill.d.ts +5 -0
  157. package/lib/render/atlas/recyclingFill.js +65 -0
  158. package/lib/render/atlas/recyclingFill.js.map +1 -0
  159. package/lib/render/atlas/samples.d.ts +24 -0
  160. package/lib/render/atlas/samples.js +75 -0
  161. package/lib/render/atlas/samples.js.map +1 -0
  162. package/lib/render/atlas/scenery.d.ts +230 -0
  163. package/lib/render/atlas/scenery.js +242 -0
  164. package/lib/render/atlas/scenery.js.map +1 -0
  165. package/lib/render/atlas/schema.d.ts +189 -0
  166. package/lib/render/atlas/schema.js +31 -0
  167. package/lib/render/atlas/schema.js.map +1 -0
  168. package/lib/render/atlas/shellMarks.d.ts +16 -0
  169. package/lib/render/atlas/shellMarks.js +72 -0
  170. package/lib/render/atlas/shellMarks.js.map +1 -0
  171. package/lib/render/atlas/store.d.ts +75 -0
  172. package/lib/render/atlas/store.js +127 -0
  173. package/lib/render/atlas/store.js.map +1 -0
  174. package/lib/render/atlas/verify.d.ts +43 -0
  175. package/lib/render/atlas/verify.js +87 -0
  176. package/lib/render/atlas/verify.js.map +1 -0
  177. package/lib/render/atlas/verifyExtras.d.ts +19 -0
  178. package/lib/render/atlas/verifyExtras.js +310 -0
  179. package/lib/render/atlas/verifyExtras.js.map +1 -0
  180. package/lib/render/cameraBounds.d.ts +71 -0
  181. package/lib/render/cameraBounds.js +107 -0
  182. package/lib/render/cameraBounds.js.map +1 -0
  183. package/lib/render/carIndicator.d.ts +41 -0
  184. package/lib/render/carIndicator.js +45 -0
  185. package/lib/render/carIndicator.js.map +1 -0
  186. package/lib/render/carMotion.d.ts +33 -0
  187. package/lib/render/carMotion.js +42 -0
  188. package/lib/render/carMotion.js.map +1 -0
  189. package/lib/render/catalogScale.d.ts +40 -0
  190. package/lib/render/catalogScale.js +33 -0
  191. package/lib/render/catalogScale.js.map +1 -0
  192. package/lib/render/climbPath.d.ts +59 -0
  193. package/lib/render/climbPath.js +115 -0
  194. package/lib/render/climbPath.js.map +1 -0
  195. package/lib/render/depthPlanes.d.ts +55 -0
  196. package/lib/render/depthPlanes.js +58 -0
  197. package/lib/render/depthPlanes.js.map +1 -0
  198. package/lib/render/excalibur/TowerEngine.d.ts +348 -0
  199. package/lib/render/excalibur/TowerEngine.js +415 -0
  200. package/lib/render/excalibur/TowerEngine.js.map +1 -0
  201. package/lib/render/excalibur/cabGraphics.d.ts +75 -0
  202. package/lib/render/excalibur/cabGraphics.js +108 -0
  203. package/lib/render/excalibur/cabGraphics.js.map +1 -0
  204. package/lib/render/excalibur/cabParts.d.ts +32 -0
  205. package/lib/render/excalibur/cabParts.js +79 -0
  206. package/lib/render/excalibur/cabParts.js.map +1 -0
  207. package/lib/render/excalibur/cabRiders.d.ts +72 -0
  208. package/lib/render/excalibur/cabRiders.js +176 -0
  209. package/lib/render/excalibur/cabRiders.js.map +1 -0
  210. package/lib/render/excalibur/crowdCull.d.ts +34 -0
  211. package/lib/render/excalibur/crowdCull.js +72 -0
  212. package/lib/render/excalibur/crowdCull.js.map +1 -0
  213. package/lib/render/excalibur/crowdFigure.d.ts +42 -0
  214. package/lib/render/excalibur/crowdFigure.js +99 -0
  215. package/lib/render/excalibur/crowdFigure.js.map +1 -0
  216. package/lib/render/excalibur/crowdLook.d.ts +137 -0
  217. package/lib/render/excalibur/crowdLook.js +186 -0
  218. package/lib/render/excalibur/crowdLook.js.map +1 -0
  219. package/lib/render/excalibur/frameHold.d.ts +23 -0
  220. package/lib/render/excalibur/frameHold.js +30 -0
  221. package/lib/render/excalibur/frameHold.js.map +1 -0
  222. package/lib/render/excalibur/guardPosition.d.ts +17 -0
  223. package/lib/render/excalibur/guardPosition.js +37 -0
  224. package/lib/render/excalibur/guardPosition.js.map +1 -0
  225. package/lib/render/excalibur/keyboardHost.d.ts +15 -0
  226. package/lib/render/excalibur/keyboardHost.js +22 -0
  227. package/lib/render/excalibur/keyboardHost.js.map +1 -0
  228. package/lib/render/excalibur/longPress.d.ts +16 -0
  229. package/lib/render/excalibur/longPress.js +71 -0
  230. package/lib/render/excalibur/longPress.js.map +1 -0
  231. package/lib/render/excalibur/peopleGfx.d.ts +16 -0
  232. package/lib/render/excalibur/peopleGfx.js +46 -0
  233. package/lib/render/excalibur/peopleGfx.js.map +1 -0
  234. package/lib/render/excalibur/peopleWindow.d.ts +35 -0
  235. package/lib/render/excalibur/peopleWindow.js +38 -0
  236. package/lib/render/excalibur/peopleWindow.js.map +1 -0
  237. package/lib/render/excalibur/personFocus.d.ts +36 -0
  238. package/lib/render/excalibur/personFocus.js +169 -0
  239. package/lib/render/excalibur/personFocus.js.map +1 -0
  240. package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
  241. package/lib/render/excalibur/pointerButtonGuard.js +86 -0
  242. package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
  243. package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
  244. package/lib/render/excalibur/pressLifecycle.js +66 -0
  245. package/lib/render/excalibur/pressLifecycle.js.map +1 -0
  246. package/lib/render/excalibur/rainShelter.d.ts +16 -0
  247. package/lib/render/excalibur/rainShelter.js +94 -0
  248. package/lib/render/excalibur/rainShelter.js.map +1 -0
  249. package/lib/render/excalibur/roomSignature.d.ts +30 -0
  250. package/lib/render/excalibur/roomSignature.js +49 -0
  251. package/lib/render/excalibur/roomSignature.js.map +1 -0
  252. package/lib/render/excalibur/sceneBake.d.ts +9 -0
  253. package/lib/render/excalibur/sceneBake.js +12 -0
  254. package/lib/render/excalibur/sceneBake.js.map +1 -0
  255. package/lib/render/excalibur/thiefSpan.d.ts +18 -0
  256. package/lib/render/excalibur/thiefSpan.js +51 -0
  257. package/lib/render/excalibur/thiefSpan.js.map +1 -0
  258. package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
  259. package/lib/render/excalibur/towerBridgeTiles.js +43 -0
  260. package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
  261. package/lib/render/excalibur/towerCrowd.d.ts +73 -0
  262. package/lib/render/excalibur/towerCrowd.js +464 -0
  263. package/lib/render/excalibur/towerCrowd.js.map +1 -0
  264. package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
  265. package/lib/render/excalibur/towerCrowdLayout.js +77 -0
  266. package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
  267. package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
  268. package/lib/render/excalibur/towerFireResponse.js +89 -0
  269. package/lib/render/excalibur/towerFireResponse.js.map +1 -0
  270. package/lib/render/excalibur/towerFrame.d.ts +8 -0
  271. package/lib/render/excalibur/towerFrame.js +57 -0
  272. package/lib/render/excalibur/towerFrame.js.map +1 -0
  273. package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
  274. package/lib/render/excalibur/towerGhostLabel.js +37 -0
  275. package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
  276. package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
  277. package/lib/render/excalibur/towerHallDoors.js +129 -0
  278. package/lib/render/excalibur/towerHallDoors.js.map +1 -0
  279. package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
  280. package/lib/render/excalibur/towerHaloRings.js +45 -0
  281. package/lib/render/excalibur/towerHaloRings.js.map +1 -0
  282. package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
  283. package/lib/render/excalibur/towerInputCamera.js +480 -0
  284. package/lib/render/excalibur/towerInputCamera.js.map +1 -0
  285. package/lib/render/excalibur/towerMetro.d.ts +31 -0
  286. package/lib/render/excalibur/towerMetro.js +115 -0
  287. package/lib/render/excalibur/towerMetro.js.map +1 -0
  288. package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
  289. package/lib/render/excalibur/towerNoiseReach.js +75 -0
  290. package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
  291. package/lib/render/excalibur/towerOverlay.d.ts +59 -0
  292. package/lib/render/excalibur/towerOverlay.js +453 -0
  293. package/lib/render/excalibur/towerOverlay.js.map +1 -0
  294. package/lib/render/excalibur/towerReconcile.d.ts +17 -0
  295. package/lib/render/excalibur/towerReconcile.js +404 -0
  296. package/lib/render/excalibur/towerReconcile.js.map +1 -0
  297. package/lib/render/excalibur/towerRegions.d.ts +61 -0
  298. package/lib/render/excalibur/towerRegions.js +193 -0
  299. package/lib/render/excalibur/towerRegions.js.map +1 -0
  300. package/lib/render/excalibur/towerScene.d.ts +66 -0
  301. package/lib/render/excalibur/towerScene.js +443 -0
  302. package/lib/render/excalibur/towerScene.js.map +1 -0
  303. package/lib/render/excalibur/towerScenery.d.ts +12 -0
  304. package/lib/render/excalibur/towerScenery.js +299 -0
  305. package/lib/render/excalibur/towerScenery.js.map +1 -0
  306. package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
  307. package/lib/render/excalibur/towerSceneryDraw.js +288 -0
  308. package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
  309. package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
  310. package/lib/render/excalibur/towerShaftNumbers.js +90 -0
  311. package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
  312. package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
  313. package/lib/render/excalibur/towerStructTiles.js +238 -0
  314. package/lib/render/excalibur/towerStructTiles.js.map +1 -0
  315. package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
  316. package/lib/render/excalibur/towerSyncSchedule.js +137 -0
  317. package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
  318. package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
  319. package/lib/render/excalibur/towerWalkerBuild.js +126 -0
  320. package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
  321. package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
  322. package/lib/render/excalibur/trafficSpotlight.js +64 -0
  323. package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
  324. package/lib/render/facadeGeometry.d.ts +50 -0
  325. package/lib/render/facadeGeometry.js +79 -0
  326. package/lib/render/facadeGeometry.js.map +1 -0
  327. package/lib/render/groundEntrances.d.ts +44 -0
  328. package/lib/render/groundEntrances.js +118 -0
  329. package/lib/render/groundEntrances.js.map +1 -0
  330. package/lib/render/lateNight.d.ts +14 -0
  331. package/lib/render/lateNight.js +18 -0
  332. package/lib/render/lateNight.js.map +1 -0
  333. package/lib/render/lobbyHalls.d.ts +44 -0
  334. package/lib/render/lobbyHalls.js +63 -0
  335. package/lib/render/lobbyHalls.js.map +1 -0
  336. package/lib/render/metroTrainSchedule.d.ts +20 -0
  337. package/lib/render/metroTrainSchedule.js +65 -0
  338. package/lib/render/metroTrainSchedule.js.map +1 -0
  339. package/lib/render/overviewMap/drawList.d.ts +67 -0
  340. package/lib/render/overviewMap/drawList.js +103 -0
  341. package/lib/render/overviewMap/drawList.js.map +1 -0
  342. package/lib/render/overviewMap/extent.d.ts +70 -0
  343. package/lib/render/overviewMap/extent.js +155 -0
  344. package/lib/render/overviewMap/extent.js.map +1 -0
  345. package/lib/render/overviewMap/floorSpans.d.ts +27 -0
  346. package/lib/render/overviewMap/floorSpans.js +32 -0
  347. package/lib/render/overviewMap/floorSpans.js.map +1 -0
  348. package/lib/render/overviewMap/gaps.d.ts +48 -0
  349. package/lib/render/overviewMap/gaps.js +148 -0
  350. package/lib/render/overviewMap/gaps.js.map +1 -0
  351. package/lib/render/overviewMap/geometry.d.ts +139 -0
  352. package/lib/render/overviewMap/geometry.js +245 -0
  353. package/lib/render/overviewMap/geometry.js.map +1 -0
  354. package/lib/render/overviewMap/heatView.d.ts +91 -0
  355. package/lib/render/overviewMap/heatView.js +143 -0
  356. package/lib/render/overviewMap/heatView.js.map +1 -0
  357. package/lib/render/overviewMap/hotelView.d.ts +82 -0
  358. package/lib/render/overviewMap/hotelView.js +136 -0
  359. package/lib/render/overviewMap/hotelView.js.map +1 -0
  360. package/lib/render/overviewMap/model.d.ts +97 -0
  361. package/lib/render/overviewMap/model.js +116 -0
  362. package/lib/render/overviewMap/model.js.map +1 -0
  363. package/lib/render/overviewMap/paint.d.ts +63 -0
  364. package/lib/render/overviewMap/paint.js +168 -0
  365. package/lib/render/overviewMap/paint.js.map +1 -0
  366. package/lib/render/overviewMap/style.d.ts +46 -0
  367. package/lib/render/overviewMap/style.js +117 -0
  368. package/lib/render/overviewMap/style.js.map +1 -0
  369. package/lib/render/overviewMap/tierView.d.ts +103 -0
  370. package/lib/render/overviewMap/tierView.js +209 -0
  371. package/lib/render/overviewMap/tierView.js.map +1 -0
  372. package/lib/render/overviewMap/viewMark.d.ts +69 -0
  373. package/lib/render/overviewMap/viewMark.js +103 -0
  374. package/lib/render/overviewMap/viewMark.js.map +1 -0
  375. package/lib/render/overviewMap/views.d.ts +24 -0
  376. package/lib/render/overviewMap/views.js +29 -0
  377. package/lib/render/overviewMap/views.js.map +1 -0
  378. package/lib/render/pinchTracker.d.ts +91 -0
  379. package/lib/render/pinchTracker.js +145 -0
  380. package/lib/render/pinchTracker.js.map +1 -0
  381. package/lib/render/pixelSprites/amusements.d.ts +32 -0
  382. package/lib/render/pixelSprites/amusements.js +243 -0
  383. package/lib/render/pixelSprites/amusements.js.map +1 -0
  384. package/lib/render/pixelSprites/artScale.d.ts +97 -0
  385. package/lib/render/pixelSprites/artScale.js +151 -0
  386. package/lib/render/pixelSprites/artScale.js.map +1 -0
  387. package/lib/render/pixelSprites/boutique.d.ts +30 -0
  388. package/lib/render/pixelSprites/boutique.js +244 -0
  389. package/lib/render/pixelSprites/boutique.js.map +1 -0
  390. package/lib/render/pixelSprites/clinic.d.ts +30 -0
  391. package/lib/render/pixelSprites/clinic.js +184 -0
  392. package/lib/render/pixelSprites/clinic.js.map +1 -0
  393. package/lib/render/pixelSprites/common.d.ts +185 -0
  394. package/lib/render/pixelSprites/common.js +449 -0
  395. package/lib/render/pixelSprites/common.js.map +1 -0
  396. package/lib/render/pixelSprites/daycare.d.ts +3 -0
  397. package/lib/render/pixelSprites/daycare.js +99 -0
  398. package/lib/render/pixelSprites/daycare.js.map +1 -0
  399. package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
  400. package/lib/render/pixelSprites/dollhouse.js +110 -0
  401. package/lib/render/pixelSprites/dollhouse.js.map +1 -0
  402. package/lib/render/pixelSprites/fitness.d.ts +30 -0
  403. package/lib/render/pixelSprites/fitness.js +176 -0
  404. package/lib/render/pixelSprites/fitness.js.map +1 -0
  405. package/lib/render/pixelSprites/food.d.ts +27 -0
  406. package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
  407. package/lib/render/pixelSprites/food.interiors.js +516 -0
  408. package/lib/render/pixelSprites/food.interiors.js.map +1 -0
  409. package/lib/render/pixelSprites/food.js +36 -0
  410. package/lib/render/pixelSprites/food.js.map +1 -0
  411. package/lib/render/pixelSprites/food.kit.d.ts +50 -0
  412. package/lib/render/pixelSprites/food.kit.js +140 -0
  413. package/lib/render/pixelSprites/food.kit.js.map +1 -0
  414. package/lib/render/pixelSprites/food.looks.d.ts +45 -0
  415. package/lib/render/pixelSprites/food.looks.js +56 -0
  416. package/lib/render/pixelSprites/food.looks.js.map +1 -0
  417. package/lib/render/pixelSprites/layers.d.ts +49 -0
  418. package/lib/render/pixelSprites/layers.js +61 -0
  419. package/lib/render/pixelSprites/layers.js.map +1 -0
  420. package/lib/render/pixelSprites/nightclub.d.ts +3 -0
  421. package/lib/render/pixelSprites/nightclub.js +108 -0
  422. package/lib/render/pixelSprites/nightclub.js.map +1 -0
  423. package/lib/render/pixelSprites/people.d.ts +168 -0
  424. package/lib/render/pixelSprites/people.js +431 -0
  425. package/lib/render/pixelSprites/people.js.map +1 -0
  426. package/lib/render/pixelSprites/residential.d.ts +5 -0
  427. package/lib/render/pixelSprites/residential.js +506 -0
  428. package/lib/render/pixelSprites/residential.js.map +1 -0
  429. package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
  430. package/lib/render/pixelSprites/residential.looks.js +43 -0
  431. package/lib/render/pixelSprites/residential.looks.js.map +1 -0
  432. package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
  433. package/lib/render/pixelSprites/residential.roaches.js +88 -0
  434. package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
  435. package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
  436. package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
  437. package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
  438. package/lib/render/pixelSprites/shop.d.ts +14 -0
  439. package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
  440. package/lib/render/pixelSprites/shop.interiors.js +382 -0
  441. package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
  442. package/lib/render/pixelSprites/shop.js +72 -0
  443. package/lib/render/pixelSprites/shop.js.map +1 -0
  444. package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
  445. package/lib/render/pixelSprites/shop.looks.js +24 -0
  446. package/lib/render/pixelSprites/shop.looks.js.map +1 -0
  447. package/lib/render/pixelSprites/skyBar.d.ts +11 -0
  448. package/lib/render/pixelSprites/skyBar.js +125 -0
  449. package/lib/render/pixelSprites/skyBar.js.map +1 -0
  450. package/lib/render/pixelSprites/spa.d.ts +3 -0
  451. package/lib/render/pixelSprites/spa.js +88 -0
  452. package/lib/render/pixelSprites/spa.js.map +1 -0
  453. package/lib/render/pixelSprites.d.ts +33 -0
  454. package/lib/render/pixelSprites.js +167 -0
  455. package/lib/render/pixelSprites.js.map +1 -0
  456. package/lib/render/regionGrid.d.ts +49 -0
  457. package/lib/render/regionGrid.js +82 -0
  458. package/lib/render/regionGrid.js.map +1 -0
  459. package/lib/render/regionPaint.d.ts +15 -0
  460. package/lib/render/regionPaint.js +33 -0
  461. package/lib/render/regionPaint.js.map +1 -0
  462. package/lib/render/renderSim.d.ts +104 -0
  463. package/lib/render/renderSim.js +2 -0
  464. package/lib/render/renderSim.js.map +1 -0
  465. package/lib/render/roomPortrait.d.ts +35 -0
  466. package/lib/render/roomPortrait.js +142 -0
  467. package/lib/render/roomPortrait.js.map +1 -0
  468. package/lib/render/roomShading.d.ts +29 -0
  469. package/lib/render/roomShading.js +43 -0
  470. package/lib/render/roomShading.js.map +1 -0
  471. package/lib/render/scale.d.ts +31 -0
  472. package/lib/render/scale.js +34 -0
  473. package/lib/render/scale.js.map +1 -0
  474. package/lib/render/sceneryLayout.d.ts +234 -0
  475. package/lib/render/sceneryLayout.js +199 -0
  476. package/lib/render/sceneryLayout.js.map +1 -0
  477. package/lib/render/sprites/common.d.ts +41 -0
  478. package/lib/render/sprites/common.js +46 -0
  479. package/lib/render/sprites/common.js.map +1 -0
  480. package/lib/render/sprites/escalator.d.ts +27 -0
  481. package/lib/render/sprites/escalator.js +156 -0
  482. package/lib/render/sprites/escalator.js.map +1 -0
  483. package/lib/render/sprites/events.d.ts +56 -0
  484. package/lib/render/sprites/events.js +280 -0
  485. package/lib/render/sprites/events.js.map +1 -0
  486. package/lib/render/sprites/facilities/garage.d.ts +23 -0
  487. package/lib/render/sprites/facilities/garage.js +230 -0
  488. package/lib/render/sprites/facilities/garage.js.map +1 -0
  489. package/lib/render/sprites/facilities/recycling.d.ts +3 -0
  490. package/lib/render/sprites/facilities/recycling.js +210 -0
  491. package/lib/render/sprites/facilities/recycling.js.map +1 -0
  492. package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
  493. package/lib/render/sprites/facilities/recyclingLook.js +52 -0
  494. package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
  495. package/lib/render/sprites/facilities/service.d.ts +14 -0
  496. package/lib/render/sprites/facilities/service.js +437 -0
  497. package/lib/render/sprites/facilities/service.js.map +1 -0
  498. package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
  499. package/lib/render/sprites/facilities/serviceKit.js +113 -0
  500. package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
  501. package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
  502. package/lib/render/sprites/facilities/vehicles.js +276 -0
  503. package/lib/render/sprites/facilities/vehicles.js.map +1 -0
  504. package/lib/render/sprites/facilities/venue.d.ts +28 -0
  505. package/lib/render/sprites/facilities/venue.js +211 -0
  506. package/lib/render/sprites/facilities/venue.js.map +1 -0
  507. package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
  508. package/lib/render/sprites/facilities/weddingHall.js +410 -0
  509. package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
  510. package/lib/render/sprites/facilities.d.ts +22 -0
  511. package/lib/render/sprites/facilities.js +24 -0
  512. package/lib/render/sprites/facilities.js.map +1 -0
  513. package/lib/render/sprites/helicopter.d.ts +11 -0
  514. package/lib/render/sprites/helicopter.js +60 -0
  515. package/lib/render/sprites/helicopter.js.map +1 -0
  516. package/lib/render/sprites/sky.d.ts +67 -0
  517. package/lib/render/sprites/sky.js +85 -0
  518. package/lib/render/sprites/sky.js.map +1 -0
  519. package/lib/render/sprites/spiralStair.d.ts +19 -0
  520. package/lib/render/sprites/spiralStair.js +111 -0
  521. package/lib/render/sprites/spiralStair.js.map +1 -0
  522. package/lib/render/sprites/structure/entrance.d.ts +35 -0
  523. package/lib/render/sprites/structure/entrance.js +347 -0
  524. package/lib/render/sprites/structure/entrance.js.map +1 -0
  525. package/lib/render/sprites/structure/lobby.d.ts +88 -0
  526. package/lib/render/sprites/structure/lobby.js +350 -0
  527. package/lib/render/sprites/structure/lobby.js.map +1 -0
  528. package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
  529. package/lib/render/sprites/structure/revolvingDoor.js +184 -0
  530. package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
  531. package/lib/render/sprites/structure/rooftop.d.ts +93 -0
  532. package/lib/render/sprites/structure/rooftop.js +302 -0
  533. package/lib/render/sprites/structure/rooftop.js.map +1 -0
  534. package/lib/render/sprites/structure/shell.d.ts +19 -0
  535. package/lib/render/sprites/structure/shell.js +142 -0
  536. package/lib/render/sprites/structure/shell.js.map +1 -0
  537. package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
  538. package/lib/render/sprites/structure/skyBridge.js +259 -0
  539. package/lib/render/sprites/structure/skyBridge.js.map +1 -0
  540. package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
  541. package/lib/render/sprites/structure/tallLobby.js +166 -0
  542. package/lib/render/sprites/structure/tallLobby.js.map +1 -0
  543. package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
  544. package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
  545. package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
  546. package/lib/render/sprites/structure.d.ts +15 -0
  547. package/lib/render/sprites/structure.js +16 -0
  548. package/lib/render/sprites/structure.js.map +1 -0
  549. package/lib/render/sprites/transport.d.ts +30 -0
  550. package/lib/render/sprites/transport.js +376 -0
  551. package/lib/render/sprites/transport.js.map +1 -0
  552. package/lib/render/sprites.d.ts +16 -0
  553. package/lib/render/sprites.js +108 -0
  554. package/lib/render/sprites.js.map +1 -0
  555. package/lib/render/venueFlights.d.ts +61 -0
  556. package/lib/render/venueFlights.js +50 -0
  557. package/lib/render/venueFlights.js.map +1 -0
  558. package/lib/shared/engineTypes.d.ts +256 -0
  559. package/lib/shared/engineTypes.js +8 -0
  560. package/lib/shared/engineTypes.js.map +1 -0
  561. package/lib/shared/floorRuns.d.ts +22 -0
  562. package/lib/shared/floorRuns.js +39 -0
  563. package/lib/shared/floorRuns.js.map +1 -0
  564. package/lib/shared/inputEvents.d.ts +18 -0
  565. package/lib/shared/inputEvents.js +23 -0
  566. package/lib/shared/inputEvents.js.map +1 -0
  567. package/lib/shared/serializedGame.d.ts +142 -0
  568. package/lib/shared/serializedGame.js +2 -0
  569. package/lib/shared/serializedGame.js.map +1 -0
  570. package/lib/shared/types.d.ts +298 -0
  571. package/lib/shared/types.js +47 -0
  572. package/lib/shared/types.js.map +1 -0
  573. package/lib/shared/unitState.d.ts +36 -0
  574. package/lib/shared/unitState.js +42 -0
  575. package/lib/shared/unitState.js.map +1 -0
  576. package/lib/shared/vacateReasonText.d.ts +20 -0
  577. package/lib/shared/vacateReasonText.js +23 -0
  578. package/lib/shared/vacateReasonText.js.map +1 -0
  579. package/lib/shared/viewZoom.d.ts +14 -0
  580. package/lib/shared/viewZoom.js +17 -0
  581. package/lib/shared/viewZoom.js.map +1 -0
  582. package/lib/shared/wellFormed.d.ts +14 -0
  583. package/lib/shared/wellFormed.js +19 -0
  584. package/lib/shared/wellFormed.js.map +1 -0
  585. package/lib/simport/cards.d.ts +26 -0
  586. package/lib/simport/cards.js +138 -0
  587. package/lib/simport/cards.js.map +1 -0
  588. package/lib/simport/clockView.d.ts +24 -0
  589. package/lib/simport/clockView.js +43 -0
  590. package/lib/simport/clockView.js.map +1 -0
  591. package/lib/simport/commands.d.ts +215 -0
  592. package/lib/simport/commands.js +2 -0
  593. package/lib/simport/commands.js.map +1 -0
  594. package/lib/simport/emergencyReads.d.ts +19 -0
  595. package/lib/simport/emergencyReads.js +47 -0
  596. package/lib/simport/emergencyReads.js.map +1 -0
  597. package/lib/simport/enginePort.d.ts +433 -0
  598. package/lib/simport/enginePort.js +11 -0
  599. package/lib/simport/enginePort.js.map +1 -0
  600. package/lib/simport/fixtures/catalog.classic.json +2137 -0
  601. package/lib/simport/fixtures/catalog.modern.json +2515 -0
  602. package/lib/simport/fixtures/viewLayout.json +927 -0
  603. package/lib/simport/headerClock.d.ts +31 -0
  604. package/lib/simport/headerClock.js +29 -0
  605. package/lib/simport/headerClock.js.map +1 -0
  606. package/lib/simport/panels.d.ts +243 -0
  607. package/lib/simport/panels.js +2 -0
  608. package/lib/simport/panels.js.map +1 -0
  609. package/lib/simport/personCards.d.ts +63 -0
  610. package/lib/simport/personCards.js +55 -0
  611. package/lib/simport/personCards.js.map +1 -0
  612. package/lib/simport/portCodes.d.ts +41 -0
  613. package/lib/simport/portCodes.js +49 -0
  614. package/lib/simport/portCodes.js.map +1 -0
  615. package/lib/simport/portEvents.d.ts +39 -0
  616. package/lib/simport/portEvents.js +43 -0
  617. package/lib/simport/portEvents.js.map +1 -0
  618. package/lib/simport/portRenderSim.d.ts +70 -0
  619. package/lib/simport/portRenderSim.js +129 -0
  620. package/lib/simport/portRenderSim.js.map +1 -0
  621. package/lib/simport/queries.d.ts +64 -0
  622. package/lib/simport/queries.js +30 -0
  623. package/lib/simport/queries.js.map +1 -0
  624. package/lib/simport/recyclingPort.d.ts +13 -0
  625. package/lib/simport/recyclingPort.js +2 -0
  626. package/lib/simport/recyclingPort.js.map +1 -0
  627. package/lib/simport/request.d.ts +44 -0
  628. package/lib/simport/request.js +214 -0
  629. package/lib/simport/request.js.map +1 -0
  630. package/lib/simport/roomTiers.d.ts +102 -0
  631. package/lib/simport/roomTiers.js +122 -0
  632. package/lib/simport/roomTiers.js.map +1 -0
  633. package/lib/simport/scheduleSlots.d.ts +19 -0
  634. package/lib/simport/scheduleSlots.js +87 -0
  635. package/lib/simport/scheduleSlots.js.map +1 -0
  636. package/lib/simport/skyBridgePort.d.ts +20 -0
  637. package/lib/simport/skyBridgePort.js +2 -0
  638. package/lib/simport/skyBridgePort.js.map +1 -0
  639. package/lib/simport/skyBridgeView.d.ts +15 -0
  640. package/lib/simport/skyBridgeView.js +42 -0
  641. package/lib/simport/skyBridgeView.js.map +1 -0
  642. package/lib/simport/statsSheet.d.ts +15 -0
  643. package/lib/simport/statsSheet.js +101 -0
  644. package/lib/simport/statsSheet.js.map +1 -0
  645. package/lib/simport/tdtRecords.d.ts +9 -0
  646. package/lib/simport/tdtRecords.js +112 -0
  647. package/lib/simport/tdtRecords.js.map +1 -0
  648. package/lib/simport/tdtReportFacts.d.ts +110 -0
  649. package/lib/simport/tdtReportFacts.js +8 -0
  650. package/lib/simport/tdtReportFacts.js.map +1 -0
  651. package/lib/simport/trafficPort.d.ts +22 -0
  652. package/lib/simport/trafficPort.js +2 -0
  653. package/lib/simport/trafficPort.js.map +1 -0
  654. package/lib/simport/view.d.ts +275 -0
  655. package/lib/simport/view.js +2 -0
  656. package/lib/simport/view.js.map +1 -0
  657. package/lib/simport/viewReader.d.ts +89 -0
  658. package/lib/simport/viewReader.js +426 -0
  659. package/lib/simport/viewReader.js.map +1 -0
  660. package/lib/styles/game/appearance.css +108 -0
  661. package/lib/styles/game/base.css +68 -0
  662. package/lib/styles/game/components.css +69 -0
  663. package/lib/styles/game/desk-title.css +183 -0
  664. package/lib/styles/game/desk.css +487 -0
  665. package/lib/styles/game/dialogs.css +360 -0
  666. package/lib/styles/game/editor-sidebar.css +116 -0
  667. package/lib/styles/game/elevator-schedule.css +217 -0
  668. package/lib/styles/game/file-dialog.css +470 -0
  669. package/lib/styles/game/help.css +141 -0
  670. package/lib/styles/game/launch-fireworks.css +17 -0
  671. package/lib/styles/game/media-landscape.css +333 -0
  672. package/lib/styles/game/media-phone.css +303 -0
  673. package/lib/styles/game/media-tablet-touch.css +177 -0
  674. package/lib/styles/game/menubar.css +158 -0
  675. package/lib/styles/game/new-tower.css +219 -0
  676. package/lib/styles/game/onboarding.css +32 -0
  677. package/lib/styles/game/screen-saver.css +85 -0
  678. package/lib/styles/game/splash.css +413 -0
  679. package/lib/styles/game/stats-saves.css +106 -0
  680. package/lib/styles/game/tools-stage.css +340 -0
  681. package/lib/styles/game/topbar.css +191 -0
  682. package/lib/styles/menu-bar.css +108 -0
  683. package/lib/styles/not-found.css +335 -0
  684. package/lib/styles/overview-map-views.css +88 -0
  685. package/lib/styles/overview-map.css +195 -0
  686. package/lib/styles/retro-components.css +179 -0
  687. package/lib/styles/retro-page.css +254 -0
  688. package/lib/styles/retro-tokens.css +122 -0
  689. package/lib/styles/schemes/high-contrast.css +173 -0
  690. package/lib/styles/schemes/skyline.css +134 -0
  691. package/lib/styles.css +66 -0
  692. package/lib/ui/desk/deskGeometry.d.ts +59 -0
  693. package/lib/ui/desk/deskGeometry.js +106 -0
  694. package/lib/ui/desk/deskGeometry.js.map +1 -0
  695. package/lib/ui/desk/deskWindow.d.ts +90 -0
  696. package/lib/ui/desk/deskWindow.js +253 -0
  697. package/lib/ui/desk/deskWindow.js.map +1 -0
  698. package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
  699. package/lib/ui/desk/deskWindowMenu.js +143 -0
  700. package/lib/ui/desk/deskWindowMenu.js.map +1 -0
  701. package/lib/ui/escape.d.ts +1 -0
  702. package/lib/ui/escape.js +14 -0
  703. package/lib/ui/escape.js.map +1 -0
  704. package/lib/ui/format.d.ts +14 -0
  705. package/lib/ui/format.js +36 -0
  706. package/lib/ui/format.js.map +1 -0
  707. package/lib/ui/iconPaths.generated.d.ts +4 -0
  708. package/lib/ui/iconPaths.generated.js +68 -0
  709. package/lib/ui/iconPaths.generated.js.map +1 -0
  710. package/lib/ui/icons.d.ts +83 -0
  711. package/lib/ui/icons.js +156 -0
  712. package/lib/ui/icons.js.map +1 -0
  713. package/lib/ui/menuBar.d.ts +94 -0
  714. package/lib/ui/menuBar.js +361 -0
  715. package/lib/ui/menuBar.js.map +1 -0
  716. package/lib/ui/modalPrecedence.d.ts +108 -0
  717. package/lib/ui/modalPrecedence.js +165 -0
  718. package/lib/ui/modalPrecedence.js.map +1 -0
  719. package/lib/ui/movableWindow.d.ts +124 -0
  720. package/lib/ui/movableWindow.js +247 -0
  721. package/lib/ui/movableWindow.js.map +1 -0
  722. package/lib/ui/overviewMapInput.d.ts +109 -0
  723. package/lib/ui/overviewMapInput.js +135 -0
  724. package/lib/ui/overviewMapInput.js.map +1 -0
  725. package/lib/ui/uiModal.d.ts +38 -0
  726. package/lib/ui/uiModal.js +70 -0
  727. package/lib/ui/uiModal.js.map +1 -0
  728. package/lib/wasmhost/buildSection.d.ts +54 -0
  729. package/lib/wasmhost/buildSection.js +143 -0
  730. package/lib/wasmhost/buildSection.js.map +1 -0
  731. package/lib/wasmhost/catalogCheck.d.ts +11 -0
  732. package/lib/wasmhost/catalogCheck.js +43 -0
  733. package/lib/wasmhost/catalogCheck.js.map +1 -0
  734. package/lib/wasmhost/engineAssets.d.ts +57 -0
  735. package/lib/wasmhost/engineAssets.js +63 -0
  736. package/lib/wasmhost/engineAssets.js.map +1 -0
  737. package/lib/wasmhost/engineBoot.d.ts +165 -0
  738. package/lib/wasmhost/engineBoot.js +254 -0
  739. package/lib/wasmhost/engineBoot.js.map +1 -0
  740. package/lib/wasmhost/engineChoice.d.ts +6 -0
  741. package/lib/wasmhost/engineChoice.js +2 -0
  742. package/lib/wasmhost/engineChoice.js.map +1 -0
  743. package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
  744. package/lib/wasmhost/engineDiagnostics.js +189 -0
  745. package/lib/wasmhost/engineDiagnostics.js.map +1 -0
  746. package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
  747. package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
  748. package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
  749. package/lib/wasmhost/engineIdentity.d.ts +30 -0
  750. package/lib/wasmhost/engineIdentity.js +59 -0
  751. package/lib/wasmhost/engineIdentity.js.map +1 -0
  752. package/lib/wasmhost/engineLabel.d.ts +40 -0
  753. package/lib/wasmhost/engineLabel.js +50 -0
  754. package/lib/wasmhost/engineLabel.js.map +1 -0
  755. package/lib/wasmhost/engineLoad.d.ts +48 -0
  756. package/lib/wasmhost/engineLoad.js +53 -0
  757. package/lib/wasmhost/engineLoad.js.map +1 -0
  758. package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
  759. package/lib/wasmhost/enginePackageCheck.js +274 -0
  760. package/lib/wasmhost/enginePackageCheck.js.map +1 -0
  761. package/lib/wasmhost/enginePackageNames.d.ts +25 -0
  762. package/lib/wasmhost/enginePackageNames.js +28 -0
  763. package/lib/wasmhost/enginePackageNames.js.map +1 -0
  764. package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
  765. package/lib/wasmhost/enginePackageRecord.js +108 -0
  766. package/lib/wasmhost/enginePackageRecord.js.map +1 -0
  767. package/lib/wasmhost/engineRepair.d.ts +55 -0
  768. package/lib/wasmhost/engineRepair.js +183 -0
  769. package/lib/wasmhost/engineRepair.js.map +1 -0
  770. package/lib/wasmhost/frameView.d.ts +87 -0
  771. package/lib/wasmhost/frameView.js +133 -0
  772. package/lib/wasmhost/frameView.js.map +1 -0
  773. package/lib/wasmhost/hostFault.d.ts +40 -0
  774. package/lib/wasmhost/hostFault.js +94 -0
  775. package/lib/wasmhost/hostFault.js.map +1 -0
  776. package/lib/wasmhost/loadEngineModule.d.ts +79 -0
  777. package/lib/wasmhost/loadEngineModule.js +66 -0
  778. package/lib/wasmhost/loadEngineModule.js.map +1 -0
  779. package/lib/wasmhost/packageHash.d.ts +48 -0
  780. package/lib/wasmhost/packageHash.js +436 -0
  781. package/lib/wasmhost/packageHash.js.map +1 -0
  782. package/lib/wasmhost/rustEngine.d.ts +49 -0
  783. package/lib/wasmhost/rustEngine.js +63 -0
  784. package/lib/wasmhost/rustEngine.js.map +1 -0
  785. package/lib/wasmhost/slotPopulation.d.ts +19 -0
  786. package/lib/wasmhost/slotPopulation.js +69 -0
  787. package/lib/wasmhost/slotPopulation.js.map +1 -0
  788. package/lib/wasmhost/telemetry.d.ts +31 -0
  789. package/lib/wasmhost/telemetry.js +13 -0
  790. package/lib/wasmhost/telemetry.js.map +1 -0
  791. package/package.json +80 -4
@@ -0,0 +1,415 @@
1
+ import * as ex from 'excalibur';
2
+ import { PinchTracker } from '../pinchTracker.js';
3
+ import { TILE, FLOOR } from '../scale.js';
4
+ import { bindSceneWorld, bakeSharedGraphics, makeStructTileMap, makeGround, makeSky, makeOverlay, setSim, followStep, rendersWithWebGL, dispose } from './towerScene.js';
5
+ import { syncScene, syncFacade } from './towerReconcile.js';
6
+ import { emptyStructPass } from './towerStructTiles.js';
7
+ import { HallDoorLayer } from './towerHallDoors.js';
8
+ import { syncMotion, updateMotion, reconcileCrowd } from './towerCrowd.js';
9
+ import { bindInput, adoptCamera, pickEntityAt, pan, zoomAt, dynamicMinZoom, clampGestureZoom, center, viewState, applyView, zoomBy, ensureVisible, setCamera, focus } from './towerInputCamera.js';
10
+ export { MAX_ZOOM, MIN_ZOOM } from './towerInputCamera.js';
11
+ import { clearLongPress } from './longPress.js';
12
+ import { guardPointerButtons } from './pointerButtonGuard.js';
13
+ import { keyboardHost } from './keyboardHost.js';
14
+ import { setReducedMotion, resetDecorativeClock } from './towerOverlay.js';
15
+ import { displayLit, runSceneSync } from './towerSyncSchedule.js';
16
+ import { clockOf } from '../../simport/headerClock.js';
17
+ import { beginFrame } from './towerFrame.js';
18
+ import { drainRegions } from './towerRegions.js';
19
+ import { NOT_BAKED } from './sceneBake.js';
20
+ import { emptyFlightPass } from '../venueFlights.js';
21
+
22
+ /**
23
+ * The Excalibur-powered tower renderer. Excalibur owns the game loop, scene,
24
+ * camera, off-screen culling, collision/hit-testing and drawing. Structural
25
+ * tiles, rooms and transport shafts are retained actors reconciled
26
+ * incrementally; moving pieces (cars, train, people) are their own actors. The
27
+ * controller (main.ts) drives tools, the sim tick and the DOM UI through the
28
+ * hooks below.
29
+ *
30
+ * The bulk of the renderer lives in friend-modules taking this instance,
31
+ * mirroring `Tower`/`UI`: `towerScene`, `towerReconcile`, `towerCrowd`,
32
+ * `towerInputCamera` (input, picking, camera, focus) and `towerOverlay`.
33
+ * Members those modules read are public and marked `@internal friend-module
34
+ * access`; the class keeps thin delegations and the shared coordinate math.
35
+ */
36
+ class TowerEngine {
37
+ setReducedMotion(on) { setReducedMotion(this, on); }
38
+ /** Reset the decorative animation clock to zero (see towerOverlay). */
39
+ resetDecorativeClock() {
40
+ resetDecorativeClock(this);
41
+ }
42
+ /** `reader`: the shared view reader. `start()` takes the saved camera, the
43
+ * hour and the revisions from it when given (slice 7, PR 4); the frame
44
+ * reads stay on `sim` until the frame slices move behind the view. */
45
+ constructor(canvas, sim, reader) {
46
+ this.reader = reader;
47
+ // ---- Event visuals (immediate-mode; no Excalibur actors to leak) --------
48
+ /** anim-clock time the current Santa flight started, or null when not flying. */
49
+ this.santaStart = null;
50
+ this.lastSantaSeq = 0;
51
+ /** In-flight bomb flashes: epicenter tile/floor + the anim time it began. */
52
+ this.explosions = [];
53
+ this.lastExplosionSeq = 0;
54
+ /** A thief slinking along a tower floor; caught → a guard trails him. */
55
+ this.thiefStart = null;
56
+ this.thiefCaught = false;
57
+ this.thiefFloor = 1;
58
+ /** The tile span of the rooms the thief runs, set when he appears. */
59
+ this.thiefSpan = null;
60
+ this.lastThiefSeq = 0;
61
+ /** Sparkles at unearthed-treasure dig sites (world tile/floor). */
62
+ this.treasures = [];
63
+ this.lastTreasureSeq = 0;
64
+ /** The VIP limo's arrival at the lobby. */
65
+ this.vipStart = null;
66
+ this.lastVipSeq = 0;
67
+ // Set by the controller each frame; rendered by the overlay. `reason` is the
68
+ // refusal string (only when `valid` is false AND the tower's catalog says the
69
+ // preview names a refusal, `rules.previewNamesRefusal`; presentation only).
70
+ this.preview = null;
71
+ this.transportPreview = null;
72
+ this.selectedId = null;
73
+ /** Called every frame with elapsed milliseconds (sim ticking lives here). */
74
+ this.onUpdate = null;
75
+ /** Hears a throw from any step of the frame, the scene's own reads of the
76
+ * simulation included, so none reaches Excalibur, whose loop stops for good
77
+ * on an uncaught throw. Unset, a throw goes on to Excalibur. */
78
+ this.onFrameError = null;
79
+ /** The frame no longer reads the simulation (its engine failed and must
80
+ * not be called again); the last drawn scene stays on screen. */
81
+ this.halted = false;
82
+ /** The GPU dropped the WebGL context (mobile browsers reset it under memory
83
+ * pressure or after backgrounding). Excalibur can't rebuild its textures in
84
+ * place, so the controller must recover, else its default handler paints a
85
+ * dead-end "please refresh the page" overlay. The clock is already stopped. */
86
+ this.onContextLost = null;
87
+ /** The browser restored the GPU context (we `preventDefault()` the loss, so
88
+ * it retries). This engine's own textures are still gone; the signal means a
89
+ * FRESH engine can be built now, which the recovery path listens for. */
90
+ this.onContextRestored = null;
91
+ // Controller-supplied input hooks (the controller owns tool semantics). `picked` is the
92
+ // entity under the pointer (or null); `panKey` is a held pan modifier (Space or Shift).
93
+ this.classifyDown = null;
94
+ this.spacePanKey = null; // the game's Space hold as `press` went down
95
+ this.onTap = null;
96
+ this.onActionDown = null;
97
+ this.onActionMove = null;
98
+ this.onActionUp = null;
99
+ /** A press cut off by a pinch or a canceled pointer: no onActionUp. */
100
+ this.onActionCancel = null;
101
+ this.onHover = null;
102
+ /** Touch long-press "peek" (the touch equivalent of a desktop hover): fires
103
+ * at the hold knee with the pressed cell/entity; onLongPressEnd on release. */
104
+ this.onLongPress = null;
105
+ this.onLongPressEnd = null;
106
+ /** Right-click: inspect whatever is under the cursor, regardless of tool. */
107
+ this.onSecondary = null;
108
+ /** Drag/click an in-world extend arrow on the selected elevator (#12).
109
+ * onExtendTo grows/shrinks the dragged end toward a target floor; onExtendEnd
110
+ * marks the gesture done so cost accounting can reset. */
111
+ this.onExtendTo = null;
112
+ this.onExtendEnd = null;
113
+ /** Screen rects of the selected elevator's extend arrows, for hit-testing.
114
+ * @internal friend-module access (towerInputCamera / towerOverlay). */
115
+ this.arrowHit = {};
116
+ /** Active extend-arrow drag end. @internal (towerInputCamera/towerScene). */
117
+ this.arrowDrag = null;
118
+ // Excalibur pointer gesture state. Contacts are tracked by their NATIVE
119
+ // pointer id (stablePointerId), never Excalibur's public id: Excalibur 0.32
120
+ // renumbers its ids when a contact lifts mid-gesture, which stranded a
121
+ // phantom entry that turned every later one-finger press into a bogus pinch.
122
+ // The two-finger pinch pans by the finger midpoint AND zooms by their
123
+ // distance ratio, so mobile keeps a pan path while a paint tool owns the drag.
124
+ this.tracker = new PinchTracker();
125
+ this.gesture = null;
126
+ this.moved = 0;
127
+ this.downTouch = false;
128
+ this.lastSx = 0;
129
+ this.lastSy = 0;
130
+ // Long-press ("peek") state (see ./longPress). downSx/downSy is the press
131
+ // origin, kept stable while lastSx/lastSy drift with a pan, so the hold's slop
132
+ // check measures travel from where the finger landed. longPressTimer is the
133
+ // pending hold; longPressFired latches once a peek fired so the release
134
+ // dismisses it and swallows the tap/action instead of placing.
135
+ this.downSx = 0;
136
+ this.downSy = 0;
137
+ this.longPressTimer = null;
138
+ this.longPressFired = false;
139
+ /** The top floor the tile map was sized for: its row 0. The tile pass maps
140
+ * floors to rows by it rather than by the bound world, so a taller world
141
+ * bound before the swap that rebuilds the map (towerScene `setSim`) never
142
+ * shifts a cell against the map it indexes (#1985). */
143
+ this.structTopFloor = 0;
144
+ this.structTiles = new Set();
145
+ /** What the tile pass last drew from (towerReconcile `syncScene`), with the
146
+ * rooms and lobby cells it kept for the syncs that skip the tiles; a null
147
+ * sim makes the next sync walk every unit. @internal friend-module access. */
148
+ this.structPass = emptyStructPass();
149
+ // Settled rooms compose into region canvases (towerRegions, spec CAP-2).
150
+ this.regions = new Map();
151
+ this.regionUnits = new Map(); // unit id -> its region keys
152
+ this.regionDirty = new Set();
153
+ this.deadParking = new Set(); // unchained parking (red X), per sync
154
+ this.animatedRooms = new Map(); // fire/construction actors
155
+ this.roomSig = new Map();
156
+ this.transportActors = new Map();
157
+ this.transportSig = new Map();
158
+ this.flightPass = emptyFlightPass(); // flights beside a venue (venueFlights.ts), per structure
159
+ // Engine-animated actors, regenerated when the layout changes.
160
+ this.carActors = [];
161
+ this.trainActors = [];
162
+ /** The metro's tunnel row, either side of the station. */
163
+ this.tunnelActors = [];
164
+ /** The pre-dawn garbage truck: one per recycling center, visible only during
165
+ * the collection hour (drives in, loads, drives off, like the metro train). */
166
+ this.truckActors = [];
167
+ /** Commute cars cruising the garage decks at rush hours: one per basement
168
+ * parking floor, ping-ponging along that floor's parking run. */
169
+ this.garageCars = [];
170
+ this.walkers = [];
171
+ this.crowdCulled = false; // zoom-cull latch: crowd per-frame work skipped (crowdCull.ts)
172
+ /** Garage/waste display fractions (parking-in-use, recycling-fill), computed
173
+ * once per syncScene (reusing sync's parking flood-fill), so they are as
174
+ * fresh as the sprites that consume them and never run per frame.
175
+ * @internal friend-module access (towerScene / towerCrowd). */
176
+ this.displayParkingUse = 0;
177
+ this.displayRecycleFill = 0;
178
+ /** Per-floor live occupancy in 0..1 (people on the floor, capped), so corridor
179
+ * loiterers only appear where tenants are. Cached and recomputed on the hour
180
+ * or when the layout changes, not per frame.
181
+ * @internal friend-module access (towerCrowd / towerScene). */
182
+ this.floorLive = new Map();
183
+ this.floorLiveHour = -1;
184
+ this.floorLiveRev = -1;
185
+ /** @internal friend-module access (towerScene setSim; read in tick). */
186
+ this.builtRev = NOT_BAKED;
187
+ this.mealOverlayRev = -1;
188
+ /** @internal friend-module access (towerScene). */
189
+ this.litState = false;
190
+ /** @internal friend-module access (towerSyncSchedule). */
191
+ this.lastSyncHour = -1;
192
+ this.hourSyncPending = false; // an hour-driven reconcile booked for the next frame
193
+ /** When the last scene sync ran, on the page's clock (`performance.now()`),
194
+ * so meal-overlay syncs coalesce (towerSyncSchedule). */
195
+ this.lastSceneSyncAt = -Infinity;
196
+ /** Set by the controller from the game speed: when paused, the decorative
197
+ * animation clock stops so on-screen people freeze with everything else. */
198
+ this.paused = false;
199
+ /** When true, the decorative animation clock is frozen (accessibility): every
200
+ * `d.anim`-driven decoration stops (ambient bed, sprite flourishes). It is
201
+ * all cosmetic: elevator cars and the routed crowd move from sim state, not
202
+ * `d.anim`, so functional motion keeps running while the animation stops. */
203
+ this.reducedMotion = false;
204
+ /** Modern's "Show decorative passers-by" switch (#2091): off (the default) hides them all. */
205
+ this.passersBy = false;
206
+ /** Frame-clock-derived animation time that only advances while unpaused.
207
+ * @internal friend-module access (towerOverlay resetDecorativeClock). */
208
+ this.animClock = 0;
209
+ // Individually-routed commuters (SimTower's signature) are owned and advanced
210
+ // by the engine; the renderer only draws each person and removes them as they
211
+ // despawn, never mutating the simulation.
212
+ this.crowdActors = new Map();
213
+ this.hallDoors = new HallDoorLayer(); // the revolving doors between lobby halls (#2068)
214
+ /** Per-tile entrance kind for the floor-1 lobby, refreshed at the top of every
215
+ * {@link reconcile.syncScene} sweep. Keyed by grid x; absent x takes the
216
+ * normal 4-variant cycle. Recomputed by walking the lobby's CONTIGUOUS runs so
217
+ * a mid-lobby gap can't orphan a grand-left half-facade from its right half. */
218
+ this.floor1EntranceMap = new Map();
219
+ /** Each tower's first and last ground-floor column as flat pairs, from `stampGroundEntrances`. */
220
+ this.groundTowers = [];
221
+ /** Whether each of {@link groundTowers} has anyone in it, so its entrance shows its staff (#2384). */
222
+ this.towerStaffed = [];
223
+ /** Exterior escape-stair actors per above-ground floor, keyed by floor. */
224
+ this.escapeActors = new Map();
225
+ /** The rooftop construction crane (present until the 100th floor tops out). */
226
+ this.craneActor = null;
227
+ /** The crane's canvas; tick() flags it dirty while the decorative clock runs. */
228
+ this.craneGfx = null;
229
+ this.sim = sim;
230
+ bindSceneWorld(sim);
231
+ guardPointerButtons(canvas); // before Excalibur's own listeners; see the module
232
+ this.engine = new ex.Engine({
233
+ canvasElement: canvas,
234
+ displayMode: ex.DisplayMode.FillContainer,
235
+ pixelArt: true,
236
+ antialiasing: false,
237
+ suppressPlayButton: true,
238
+ suppressConsoleBootMessage: true,
239
+ backgroundColor: ex.Color.fromHex("#7fb0e0"),
240
+ // Excalibur's keyboard listens here instead of on `window`, so its
241
+ // listeners go away with the engine (#322); the game reads keys itself.
242
+ global: keyboardHost(),
243
+ // No gameplay uses collisions — actors are positioned directly and picking
244
+ // goes through Actor.contains(), which reads collider geometry without the
245
+ // simulation. Left on, Excalibur's broadphase/narrowphase/solver dominates
246
+ // the frame once a tower reaches ~1000 actors (profiled at >25% of frame
247
+ // time on a big save), driving phones into a sub-2fps "freeze".
248
+ physics: false,
249
+ handleContextLost: (e) => {
250
+ e.preventDefault(); // spec: signals the browser we own recovery
251
+ this.engine.clock.stop(); // every GL call is dead now — stop the loop
252
+ this.onContextLost?.();
253
+ },
254
+ handleContextRestored: () => this.onContextRestored?.(),
255
+ });
256
+ this.d = { ctx: null, lit: false, anim: 0, hour: 9 };
257
+ this.engine.currentScene.onPostUpdate = (_e, elapsed) => this.tick(elapsed);
258
+ }
259
+ async start() {
260
+ await this.engine.start();
261
+ this.engine.currentScene.camera.zoom = 0.9;
262
+ bakeSharedGraphics(this);
263
+ makeStructTileMap(this);
264
+ makeGround(this);
265
+ makeSky(this);
266
+ makeOverlay(this);
267
+ // A boot-loaded autosave restores its saved view; a fresh tower centers.
268
+ this.adoptCamera(this.reader ? this.reader.header.camera : this.sim.view);
269
+ // Bake the boot scene against the real clock instead of the d defaults:
270
+ // the hour-driven resync now defers a frame (towerSyncSchedule), so a
271
+ // stale boot bake would actually display instead of being fixed pre-draw.
272
+ const clock = this.reader ? clockOf(this.reader.header) : this.sim.clock;
273
+ this.d.hour = clock.hour;
274
+ this.d.lit = displayLit(clock);
275
+ this.litState = this.d.lit;
276
+ this.lastSyncHour = this.d.hour;
277
+ this.syncScene();
278
+ this.syncMotion();
279
+ this.syncFacade();
280
+ const tower = this.reader ? this.reader.tower : this.sim.tower;
281
+ this.builtRev = tower.revision;
282
+ this.mealOverlayRev = tower.mealOverlayRevision;
283
+ bindInput(this);
284
+ }
285
+ tick(elapsedMs) {
286
+ if (this.halted)
287
+ return;
288
+ try {
289
+ this.runTick(elapsedMs);
290
+ }
291
+ catch (err) {
292
+ if (!this.onFrameError)
293
+ throw err;
294
+ this.onFrameError(err);
295
+ }
296
+ }
297
+ runTick(elapsedMs) {
298
+ beginFrame(this, elapsedMs);
299
+ if (this.onUpdate)
300
+ this.onUpdate(elapsedMs);
301
+ // The step heard a trap: nothing below may read the engine again.
302
+ if (this.halted)
303
+ return;
304
+ // Scene reconcile scheduling lives in towerSyncSchedule (spec CAP-3):
305
+ // hour-driven repaints defer to the next frame's drain above.
306
+ runSceneSync(this);
307
+ drainRegions(this); // budgeted region repaints (towerRegions, CAP-2)
308
+ this.updateMotion(elapsedMs);
309
+ this.reconcileCrowd();
310
+ }
311
+ // ---- Delegations to friend-modules --------------------------------------
312
+ setSim(sim, opts) { setSim(this, sim, opts); }
313
+ /** An undo or redo step changed the drawn tower: keep the scene (towerScene). */
314
+ followStep() { followStep(this); }
315
+ // Frame-pump steps for fake-driven ticks (stub these three directly);
316
+ // scene syncs route through towerSyncSchedule's module functions, observed
317
+ // with module mocks (towerEngineMealOverlay.test.ts). start() uses the
318
+ // sync delegations below.
319
+ syncScene() { syncScene(this); }
320
+ syncFacade() { syncFacade(this); }
321
+ syncMotion() { syncMotion(this); }
322
+ updateMotion(elapsedMs) { updateMotion(this, elapsedMs); }
323
+ reconcileCrowd() { reconcileCrowd(this); }
324
+ /** Camera policy for a swapped-in (or boot-loaded) tower (see towerInputCamera).
325
+ * @internal friend-module access (towerScene setSim). */
326
+ adoptCamera(view, keepCamera) {
327
+ adoptCamera(this, view, keepCamera);
328
+ }
329
+ /** Top-most unit/transport whose Excalibur collider contains the point. */
330
+ pickEntityAt(world) {
331
+ return pickEntityAt(this, world);
332
+ }
333
+ pan(dxScreen, dyScreen) { pan(this, dxScreen, dyScreen); }
334
+ zoomAt(factor, sx, sy) { zoomAt(this, factor, sx, sy); }
335
+ /** @internal friend-module access (towerInputCamera) / prototype tests. */
336
+ dynamicMinZoom() {
337
+ return dynamicMinZoom(this);
338
+ }
339
+ /** @internal friend-module access (towerInputCamera) / prototype tests. */
340
+ clampGestureZoom(z) {
341
+ return clampGestureZoom(this, z);
342
+ }
343
+ center() {
344
+ center(this);
345
+ }
346
+ /** The live camera as save-file cargo (see towerInputCamera). */
347
+ viewState() {
348
+ return viewState(this);
349
+ }
350
+ /** @internal friend-module access (towerInputCamera adoptCamera) / prototype tests. */
351
+ applyView(v) {
352
+ applyView(this, v);
353
+ }
354
+ /** Zoom by a factor about the current center (keyboard +/- zoom). */
355
+ zoomBy(factor) {
356
+ zoomBy(this, factor);
357
+ }
358
+ /** Pan the minimum amount so tile/floor sits within the viewport (with a margin). */
359
+ ensureVisible(tile, floor) {
360
+ ensureVisible(this, tile, floor);
361
+ }
362
+ setCamera(tileX, floor, zoom) {
363
+ setCamera(this, tileX, floor, zoom);
364
+ }
365
+ focus() {
366
+ return focus(this);
367
+ }
368
+ // ---- Coordinate math ----------------------------------------------------
369
+ get viewWidth() {
370
+ return this.engine.screen.resolution.width;
371
+ }
372
+ get viewHeight() {
373
+ return this.engine.screen.resolution.height;
374
+ }
375
+ /** @internal friend-module access (towerInputCamera / towerOverlay). */
376
+ get cam() {
377
+ return this.engine.currentScene.camera;
378
+ }
379
+ worldX(tile) {
380
+ return tile * TILE;
381
+ }
382
+ worldYTop(floor, h = 1) {
383
+ return -(floor + h - 1) * FLOOR;
384
+ }
385
+ /** @internal friend-module access (towerInputCamera). */
386
+ screenToWorld(sx, sy) {
387
+ return this.engine.screenToWorldCoordinates(ex.vec(sx, sy));
388
+ }
389
+ worldToScreenX(tile) {
390
+ return this.engine.worldToScreenCoordinates(ex.vec(tile * TILE, 0)).x;
391
+ }
392
+ worldToScreenY(floor) {
393
+ return this.engine.worldToScreenCoordinates(ex.vec(0, -floor * FLOOR)).y;
394
+ }
395
+ screenToTile(sx) {
396
+ return Math.floor(this.screenToWorld(sx, this.viewHeight / 2).x / TILE);
397
+ }
398
+ screenToFloor(sy) {
399
+ return Math.ceil(-this.screenToWorld(this.viewWidth / 2, sy).y / FLOOR);
400
+ }
401
+ // ---- Engine lifecycle (see towerScene) ----------------------------------
402
+ /** True when the engine draws through WebGL (else a degraded Canvas2D
403
+ * fallback the recovery path treats as a failed rebuild). */
404
+ rendersWithWebGL() {
405
+ return rendersWithWebGL(this);
406
+ }
407
+ /** Full teardown, used by in-place context-loss recovery before a rebuild. */
408
+ dispose() {
409
+ clearLongPress(this); // no pending peek callback into a torn-down engine
410
+ dispose(this);
411
+ }
412
+ }
413
+
414
+ export { FLOOR, TILE, TowerEngine };
415
+ //# sourceMappingURL=TowerEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TowerEngine.js","sources":["../../../src/render/excalibur/TowerEngine.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport type { FacilityKind, SerializedView } from \"../../shared/types\";\nimport type { SimView, UnitView } from \"../../simport/view\";\nimport type { RenderSim } from \"../renderSim\";\nimport { PinchTracker } from \"../pinchTracker\";\nimport type { DrawCtx } from \"../sprites\";\nimport type { EntranceKind } from \"../sprites/structure/lobby\";\n// World-scale constants live in ../scale (pure); re-exported for consumers.\nimport { FLOOR, TILE } from \"../scale\";\n\nimport * as scene from \"./towerScene\";\nimport * as reconcile from \"./towerReconcile\";\nimport { emptyStructPass, type StructPass } from \"./towerStructTiles\";\nimport { HallDoorLayer } from \"./towerHallDoors\";\nimport * as crowd from \"./towerCrowd\";\nimport * as camera from \"./towerInputCamera\";\nimport { clearLongPress } from \"./longPress\";\nimport { guardPointerButtons } from \"./pointerButtonGuard\";\nimport { keyboardHost } from \"./keyboardHost\";\nimport * as overlayFx from \"./towerOverlay\";\nimport { displayLit, runSceneSync } from \"./towerSyncSchedule\";\nimport { clockOf } from \"../../simport/headerClock\";\nimport { beginFrame } from \"./towerFrame\";\nimport { drainRegions, type RegionRec } from \"./towerRegions\";\nimport { NOT_BAKED } from \"./sceneBake\";\nimport type { CrowdActor, Walker } from \"./towerCrowd\";\nimport type { CabActor } from \"./cabGraphics\";\nimport type { MetroTrain } from \"./towerMetro\";\nimport type { PeopleGraphics } from \"./peopleGfx\";\nimport type { ViewFocus, Picked, ScreenRect } from \"./towerInputCamera\";\nimport type { ThiefSpan } from \"./thiefSpan\";\n\nexport { FLOOR, TILE };\n// The camera zoom range lives in its friend-module; re-exported so consumers\n// keep importing it (and the `ViewFocus`/`Picked` shapes) from this file.\nexport { MIN_ZOOM, MAX_ZOOM } from \"./towerInputCamera\";\nexport type { ViewFocus, Picked } from \"./towerInputCamera\";\n\n/**\n * The Excalibur-powered tower renderer. Excalibur owns the game loop, scene,\n * camera, off-screen culling, collision/hit-testing and drawing. Structural\n * tiles, rooms and transport shafts are retained actors reconciled\n * incrementally; moving pieces (cars, train, people) are their own actors. The\n * controller (main.ts) drives tools, the sim tick and the DOM UI through the\n * hooks below.\n *\n * The bulk of the renderer lives in friend-modules taking this instance,\n * mirroring `Tower`/`UI`: `towerScene`, `towerReconcile`, `towerCrowd`,\n * `towerInputCamera` (input, picking, camera, focus) and `towerOverlay`.\n * Members those modules read are public and marked `@internal friend-module\n * access`; the class keeps thin delegations and the shared coordinate math.\n */\nexport class TowerEngine {\n engine: ex.Engine;\n sim: RenderSim;\n /** @internal friend-module access (shared draw context). */\n d: DrawCtx;\n\n // ---- Event visuals (immediate-mode; no Excalibur actors to leak) --------\n /** anim-clock time the current Santa flight started, or null when not flying. */\n santaStart: number | null = null;\n lastSantaSeq = 0;\n /** In-flight bomb flashes: epicenter tile/floor + the anim time it began. */\n explosions: { x: number; floor: number; start: number }[] = [];\n lastExplosionSeq = 0;\n /** A thief slinking along a tower floor; caught → a guard trails him. */\n thiefStart: number | null = null;\n thiefCaught = false;\n thiefFloor = 1;\n /** The tile span of the rooms the thief runs, set when he appears. */\n thiefSpan: ThiefSpan | null = null;\n lastThiefSeq = 0;\n /** Sparkles at unearthed-treasure dig sites (world tile/floor). */\n treasures: { x: number; floor: number; start: number }[] = [];\n lastTreasureSeq = 0;\n /** The VIP limo's arrival at the lobby. */\n vipStart: number | null = null;\n lastVipSeq = 0;\n\n // Set by the controller each frame; rendered by the overlay. `reason` is the\n // refusal string (only when `valid` is false AND the tower's catalog says the\n // preview names a refusal, `rules.previewNamesRefusal`; presentation only).\n preview: { kind: FacilityKind; floor: number; x: number; valid: boolean; span?: number; reason?: string; stories?: number; label?: string } | null = null;\n transportPreview: { kind: FacilityKind; x: number; bottom: number; top: number; valid: boolean } | null = null;\n selectedId: number | null = null;\n\n /** Called every frame with elapsed milliseconds (sim ticking lives here). */\n onUpdate: ((ms: number) => void) | null = null;\n\n /** Hears a throw from any step of the frame, the scene's own reads of the\n * simulation included, so none reaches Excalibur, whose loop stops for good\n * on an uncaught throw. Unset, a throw goes on to Excalibur. */\n onFrameError: ((err: unknown) => void) | null = null;\n\n /** The frame no longer reads the simulation (its engine failed and must\n * not be called again); the last drawn scene stays on screen. */\n halted = false;\n\n /** The GPU dropped the WebGL context (mobile browsers reset it under memory\n * pressure or after backgrounding). Excalibur can't rebuild its textures in\n * place, so the controller must recover, else its default handler paints a\n * dead-end \"please refresh the page\" overlay. The clock is already stopped. */\n onContextLost: (() => void) | null = null;\n\n /** The browser restored the GPU context (we `preventDefault()` the loss, so\n * it retries). This engine's own textures are still gone; the signal means a\n * FRESH engine can be built now, which the recovery path listens for. */\n onContextRestored: (() => void) | null = null;\n\n // Controller-supplied input hooks (the controller owns tool semantics). `picked` is the\n // entity under the pointer (or null); `panKey` is a held pan modifier (Space or Shift).\n classifyDown: ((button: number, touch: boolean, panKey: boolean) => \"pan\" | \"action\") | null = null;\n spacePanKey: ((press?: Event) => boolean) | null = null; // the game's Space hold as `press` went down\n onTap: ((tile: number, floor: number, touch: boolean, picked: Picked | null, world: ex.Vector) => void) | null = null;\n onActionDown: ((tile: number, floor: number, touch: boolean, picked: Picked | null) => void) | null = null;\n onActionMove: ((tile: number, floor: number, picked: Picked | null) => void) | null = null;\n onActionUp: ((tile: number, floor: number, picked: Picked | null) => void) | null = null;\n /** A press cut off by a pinch or a canceled pointer: no onActionUp. */\n onActionCancel: (() => void) | null = null;\n onHover: ((tile: number, floor: number, picked: Picked | null) => void) | null = null;\n /** Touch long-press \"peek\" (the touch equivalent of a desktop hover): fires\n * at the hold knee with the pressed cell/entity; onLongPressEnd on release. */\n onLongPress: ((tile: number, floor: number, picked: Picked | null) => void) | null = null;\n onLongPressEnd: (() => void) | null = null;\n /** Right-click: inspect whatever is under the cursor, regardless of tool. */\n onSecondary: ((picked: Picked | null) => void) | null = null;\n /** Drag/click an in-world extend arrow on the selected elevator (#12).\n * onExtendTo grows/shrinks the dragged end toward a target floor; onExtendEnd\n * marks the gesture done so cost accounting can reset. */\n onExtendTo: ((end: \"up\" | \"down\", targetFloor: number) => void) | null = null;\n onExtendEnd: (() => void) | null = null;\n /** Screen rects of the selected elevator's extend arrows, for hit-testing.\n * @internal friend-module access (towerInputCamera / towerOverlay). */\n arrowHit: { up?: ScreenRect; down?: ScreenRect } = {};\n /** Active extend-arrow drag end. @internal (towerInputCamera/towerScene). */\n arrowDrag: { end: \"up\" | \"down\"; shaft: number | null } | null = null;\n\n // Excalibur pointer gesture state. Contacts are tracked by their NATIVE\n // pointer id (stablePointerId), never Excalibur's public id: Excalibur 0.32\n // renumbers its ids when a contact lifts mid-gesture, which stranded a\n // phantom entry that turned every later one-finger press into a bogus pinch.\n // The two-finger pinch pans by the finger midpoint AND zooms by their\n // distance ratio, so mobile keeps a pan path while a paint tool owns the drag.\n tracker = new PinchTracker();\n gesture: \"pan\" | \"action\" | null = null;\n moved = 0;\n downTouch = false;\n lastSx = 0;\n lastSy = 0;\n // Long-press (\"peek\") state (see ./longPress). downSx/downSy is the press\n // origin, kept stable while lastSx/lastSy drift with a pan, so the hold's slop\n // check measures travel from where the finger landed. longPressTimer is the\n // pending hold; longPressFired latches once a peek fired so the release\n // dismisses it and swallows the tap/action instead of placing.\n downSx = 0;\n downSy = 0;\n longPressTimer: ReturnType<typeof setTimeout> | null = null;\n longPressFired = false;\n\n // Retained scene graph, reconciled by stable id.\n /** Static floor/lobby tiles live in ONE TileMap entity, not per-tile\n * actors: paying per-actor overhead for a ~9,000-tile slab dominated the\n * frame on phones. Cells keep the same shared baked canvases the old\n * actors used, so pixels don't change. The set holds the cells that carry a\n * graphic. Cells, not unit ids, because the view gives tiles no ids. */\n structTileMap!: ex.TileMap;\n /** The top floor the tile map was sized for: its row 0. The tile pass maps\n * floors to rows by it rather than by the bound world, so a taller world\n * bound before the swap that rebuilds the map (towerScene `setSim`) never\n * shifts a cell against the map it indexes (#1985). */\n structTopFloor = 0;\n structTiles = new Set<ex.Tile>();\n /** What the tile pass last drew from (towerReconcile `syncScene`), with the\n * rooms and lobby cells it kept for the syncs that skip the tiles; a null\n * sim makes the next sync walk every unit. @internal friend-module access. */\n structPass: StructPass = emptyStructPass();\n // Settled rooms compose into region canvases (towerRegions, spec CAP-2).\n regions = new Map<number, RegionRec>();\n regionUnits = new Map<number, number[]>(); // unit id -> its region keys\n regionDirty = new Set<number>();\n deadParking = new Set<number>(); // unchained parking (red X), per sync\n animatedRooms = new Map<number, ex.Actor>(); // fire/construction actors\n roomSig = new Map<number, string>();\n transportActors = new Map<number, ex.Actor>();\n transportSig = new Map<number, string>();\n flightPass = reconcile.emptyFlightPass(); // flights beside a venue (venueFlights.ts), per structure\n // Engine-animated actors, regenerated when the layout changes.\n carActors: CabActor[] = [];\n trainActors: MetroTrain[] = [];\n /** The metro's tunnel row, either side of the station. */\n tunnelActors: ex.Actor[] = [];\n /** The pre-dawn garbage truck: one per recycling center, visible only during\n * the collection hour (drives in, loads, drives off, like the metro train). */\n truckActors: { actor: ex.Actor; u: UnitView; w: number }[] = [];\n /** Commute cars cruising the garage decks at rush hours: one per basement\n * parking floor, ping-ponging along that floor's parking run. */\n garageCars: { actor: ex.Actor; floor: number; x0w: number; x1w: number; seed: number }[] = [];\n walkers: Walker[] = [];\n crowdCulled = false; // zoom-cull latch: crowd per-frame work skipped (crowdCull.ts)\n /** Garage/waste display fractions (parking-in-use, recycling-fill), computed\n * once per syncScene (reusing sync's parking flood-fill), so they are as\n * fresh as the sprites that consume them and never run per frame.\n * @internal friend-module access (towerScene / towerCrowd). */\n displayParkingUse = 0;\n displayRecycleFill = 0;\n /** Per-floor live occupancy in 0..1 (people on the floor, capped), so corridor\n * loiterers only appear where tenants are. Cached and recomputed on the hour\n * or when the layout changes, not per frame.\n * @internal friend-module access (towerCrowd / towerScene). */\n floorLive = new Map<number, number>();\n floorLiveHour = -1;\n floorLiveRev = -1;\n /** @internal friend-module access (towerScene setSim; read in tick). */\n builtRev = NOT_BAKED;\n mealOverlayRev = -1;\n /** @internal friend-module access (towerScene). */\n litState = false;\n /** @internal friend-module access (towerSyncSchedule). */\n lastSyncHour = -1;\n hourSyncPending = false; // an hour-driven reconcile booked for the next frame\n /** When the last scene sync ran, on the page's clock (`performance.now()`),\n * so meal-overlay syncs coalesce (towerSyncSchedule). */\n lastSceneSyncAt = -Infinity;\n /** Set by the controller from the game speed: when paused, the decorative\n * animation clock stops so on-screen people freeze with everything else. */\n paused = false;\n /** When true, the decorative animation clock is frozen (accessibility): every\n * `d.anim`-driven decoration stops (ambient bed, sprite flourishes). It is\n * all cosmetic: elevator cars and the routed crowd move from sim state, not\n * `d.anim`, so functional motion keeps running while the animation stops. */\n reducedMotion = false;\n /** Modern's \"Show decorative passers-by\" switch (#2091): off (the default) hides them all. */\n passersBy = false;\n setReducedMotion(on: boolean): void { overlayFx.setReducedMotion(this, on); }\n\n /** Frame-clock-derived animation time that only advances while unpaused.\n * @internal friend-module access (towerOverlay resetDecorativeClock). */\n animClock = 0;\n /** Reset the decorative animation clock to zero (see towerOverlay). */\n resetDecorativeClock(): void {\n overlayFx.resetDecorativeClock(this);\n }\n\n // Individually-routed commuters (SimTower's signature) are owned and advanced\n // by the engine; the renderer only draws each person and removes them as they\n // despawn, never mutating the simulation.\n crowdActors = new Map<number, CrowdActor>();\n hallDoors = new HallDoorLayer(); // the revolving doors between lobby halls (#2068)\n\n // Shared graphics so thousands of tiles/people cost almost nothing.\n floorGfx!: ex.Canvas;\n /** Lobby tile variants, baked per [lit][ground][variant] so the concourse\n * pattern (columns, chandeliers/planters) repeats and lights up at night. */\n lobbyGfx!: ex.Canvas[][][];\n /** The two slices of the wide grand entrance storefront, staffed, baked per\n * [lit]. Left carries the reception attendant; right the doors and swaying\n * doorman. Both `cache: false` because the right doorman reads `d.anim`, and\n * one path for both beats mixing cache-true/false. */\n entranceGrandLeftGfx!: ex.Canvas[];\n entranceGrandRightGfx!: ex.Canvas[];\n /** The compact grand entrance, for a lobby too narrow for the storefront (`cache: false`: doorman). */\n entranceGrandSoloGfx!: ex.Canvas[];\n /** Grand entrance slices for an empty tower (no doorman or attendant), per kind and [lit]; static. */\n entranceEmptyGfx!: Record<\"grand-left\" | \"grand-right\" | \"grand-solo\", ex.Canvas[]>;\n /** The floor-1 service entrance tile, baked per [lit]. Static (`cache: true`)\n * because it has no motion of its own. */\n entranceServiceGfx!: ex.Canvas[];\n /** One story of a tall lobby's slice (#308), baked on first use and kept:\n * by lighting, ground or sky style, height, story (0 = the lobby's floor)\n * and pattern slot or entrance kind. */\n tallLobbyGfx!: (lit: boolean, ground: boolean, height: number, story: number, slot: number | EntranceKind, staffed: boolean) => ex.Canvas;\n /** Per-tile entrance kind for the floor-1 lobby, refreshed at the top of every\n * {@link reconcile.syncScene} sweep. Keyed by grid x; absent x takes the\n * normal 4-variant cycle. Recomputed by walking the lobby's CONTIGUOUS runs so\n * a mid-lobby gap can't orphan a grand-left half-facade from its right half. */\n floor1EntranceMap: Map<number, \"grand-left\" | \"grand-right\" | \"grand-solo\" | \"service\"> = new Map();\n /** Each tower's first and last ground-floor column as flat pairs, from `stampGroundEntrances`. */\n groundTowers: number[] = [];\n /** Whether each of {@link groundTowers} has anyone in it, so its entrance shows its staff (#2384). */\n towerStaffed: boolean[] = [];\n /** Fire-escape segments, baked per [side][floor parity] (shared by all floors). */\n escGfx!: { left: ex.Canvas[]; right: ex.Canvas[] };\n /** Ground-floor entrance awnings, baked per side. They stand in for the fire\n * escape on floor 1 (see {@link reconcile.syncEscapes}). */\n awningGfx!: { left: ex.Canvas; right: ex.Canvas };\n /** Exterior escape-stair actors per above-ground floor, keyed by floor. */\n escapeActors = new Map<string, { l: ex.Actor; r: ex.Actor; sig: string }>();\n /** The rooftop construction crane (present until the 100th floor tops out). */\n craneActor: ex.Actor | null = null;\n /** The crane's canvas; tick() flags it dirty while the decorative clock runs. */\n craneGfx: ex.Canvas | null = null;\n people!: PeopleGraphics;\n /** @internal friend-module access (towerScene make* / towerOverlay draw). */\n overlay!: ex.ScreenElement;\n overlayCanvas!: ex.Canvas;\n sky!: ex.ScreenElement;\n skyCanvas!: ex.Canvas;\n\n /** `reader`: the shared view reader. `start()` takes the saved camera, the\n * hour and the revisions from it when given (slice 7, PR 4); the frame\n * reads stay on `sim` until the frame slices move behind the view. */\n constructor(canvas: HTMLCanvasElement, sim: RenderSim, private readonly reader?: SimView) {\n this.sim = sim;\n scene.bindSceneWorld(sim);\n guardPointerButtons(canvas); // before Excalibur's own listeners; see the module\n this.engine = new ex.Engine({\n canvasElement: canvas,\n displayMode: ex.DisplayMode.FillContainer,\n pixelArt: true,\n antialiasing: false,\n suppressPlayButton: true,\n suppressConsoleBootMessage: true,\n backgroundColor: ex.Color.fromHex(\"#7fb0e0\"),\n // Excalibur's keyboard listens here instead of on `window`, so its\n // listeners go away with the engine (#322); the game reads keys itself.\n global: keyboardHost(),\n // No gameplay uses collisions — actors are positioned directly and picking\n // goes through Actor.contains(), which reads collider geometry without the\n // simulation. Left on, Excalibur's broadphase/narrowphase/solver dominates\n // the frame once a tower reaches ~1000 actors (profiled at >25% of frame\n // time on a big save), driving phones into a sub-2fps \"freeze\".\n physics: false,\n handleContextLost: (e) => {\n e.preventDefault(); // spec: signals the browser we own recovery\n this.engine.clock.stop(); // every GL call is dead now — stop the loop\n this.onContextLost?.();\n },\n handleContextRestored: () => this.onContextRestored?.(),\n });\n this.d = { ctx: null as unknown as CanvasRenderingContext2D, lit: false, anim: 0, hour: 9 };\n this.engine.currentScene.onPostUpdate = (_e: ex.Engine, elapsed: number) => this.tick(elapsed);\n }\n\n async start(): Promise<void> {\n await this.engine.start();\n this.engine.currentScene.camera.zoom = 0.9;\n scene.bakeSharedGraphics(this);\n scene.makeStructTileMap(this);\n scene.makeGround(this);\n scene.makeSky(this);\n scene.makeOverlay(this);\n // A boot-loaded autosave restores its saved view; a fresh tower centers.\n this.adoptCamera(this.reader ? this.reader.header.camera : this.sim.view);\n // Bake the boot scene against the real clock instead of the d defaults:\n // the hour-driven resync now defers a frame (towerSyncSchedule), so a\n // stale boot bake would actually display instead of being fixed pre-draw.\n const clock = this.reader ? clockOf(this.reader.header) : this.sim.clock;\n this.d.hour = clock.hour;\n this.d.lit = displayLit(clock);\n this.litState = this.d.lit;\n this.lastSyncHour = this.d.hour;\n this.syncScene();\n this.syncMotion();\n this.syncFacade();\n const tower = this.reader ? this.reader.tower : this.sim.tower;\n this.builtRev = tower.revision;\n this.mealOverlayRev = tower.mealOverlayRevision;\n camera.bindInput(this);\n }\n\n private tick(elapsedMs: number): void {\n if (this.halted) return;\n try {\n this.runTick(elapsedMs);\n } catch (err) {\n if (!this.onFrameError) throw err;\n this.onFrameError(err);\n }\n }\n\n private runTick(elapsedMs: number): void {\n beginFrame(this, elapsedMs);\n if (this.onUpdate) this.onUpdate(elapsedMs);\n // The step heard a trap: nothing below may read the engine again.\n if (this.halted) return;\n\n // Scene reconcile scheduling lives in towerSyncSchedule (spec CAP-3):\n // hour-driven repaints defer to the next frame's drain above.\n runSceneSync(this);\n drainRegions(this); // budgeted region repaints (towerRegions, CAP-2)\n this.updateMotion(elapsedMs);\n this.reconcileCrowd();\n }\n\n // ---- Delegations to friend-modules --------------------------------------\n\n setSim(sim: RenderSim, opts?: { keepCamera?: boolean }): void { scene.setSim(this, sim, opts); }\n /** An undo or redo step changed the drawn tower: keep the scene (towerScene). */\n followStep(): void { scene.followStep(this); }\n\n // Frame-pump steps for fake-driven ticks (stub these three directly);\n // scene syncs route through towerSyncSchedule's module functions, observed\n // with module mocks (towerEngineMealOverlay.test.ts). start() uses the\n // sync delegations below.\n private syncScene(): void { reconcile.syncScene(this); }\n private syncFacade(): void { reconcile.syncFacade(this); }\n private syncMotion(): void { crowd.syncMotion(this); }\n private updateMotion(elapsedMs: number): void { crowd.updateMotion(this, elapsedMs); }\n private reconcileCrowd(): void { crowd.reconcileCrowd(this); }\n\n /** Camera policy for a swapped-in (or boot-loaded) tower (see towerInputCamera).\n * @internal friend-module access (towerScene setSim). */\n adoptCamera(view: SerializedView | null, keepCamera?: boolean): void {\n camera.adoptCamera(this, view, keepCamera);\n }\n\n /** Top-most unit/transport whose Excalibur collider contains the point. */\n pickEntityAt(world: ex.Vector): Picked | null {\n return camera.pickEntityAt(this, world);\n }\n\n pan(dxScreen: number, dyScreen: number): void { camera.pan(this, dxScreen, dyScreen); }\n zoomAt(factor: number, sx: number, sy: number): void { camera.zoomAt(this, factor, sx, sy); }\n /** @internal friend-module access (towerInputCamera) / prototype tests. */\n dynamicMinZoom(): number {\n return camera.dynamicMinZoom(this);\n }\n /** @internal friend-module access (towerInputCamera) / prototype tests. */\n clampGestureZoom(z: number): number {\n return camera.clampGestureZoom(this, z);\n }\n center(): void {\n camera.center(this);\n }\n\n /** The live camera as save-file cargo (see towerInputCamera). */\n viewState(): SerializedView {\n return camera.viewState(this);\n }\n /** @internal friend-module access (towerInputCamera adoptCamera) / prototype tests. */\n applyView(v: SerializedView): void {\n camera.applyView(this, v);\n }\n /** Zoom by a factor about the current center (keyboard +/- zoom). */\n zoomBy(factor: number): void {\n camera.zoomBy(this, factor);\n }\n /** Pan the minimum amount so tile/floor sits within the viewport (with a margin). */\n ensureVisible(tile: number, floor: number): void {\n camera.ensureVisible(this, tile, floor);\n }\n setCamera(tileX: number, floor: number, zoom: number): void {\n camera.setCamera(this, tileX, floor, zoom);\n }\n focus(): ViewFocus {\n return camera.focus(this);\n }\n\n // ---- Coordinate math ----------------------------------------------------\n\n get viewWidth(): number {\n return this.engine.screen.resolution.width;\n }\n get viewHeight(): number {\n return this.engine.screen.resolution.height;\n }\n /** @internal friend-module access (towerInputCamera / towerOverlay). */\n get cam(): ex.Camera {\n return this.engine.currentScene.camera;\n }\n\n worldX(tile: number): number {\n return tile * TILE;\n }\n worldYTop(floor: number, h = 1): number {\n return -(floor + h - 1) * FLOOR;\n }\n /** @internal friend-module access (towerInputCamera). */\n screenToWorld(sx: number, sy: number): ex.Vector {\n return this.engine.screenToWorldCoordinates(ex.vec(sx, sy));\n }\n worldToScreenX(tile: number): number {\n return this.engine.worldToScreenCoordinates(ex.vec(tile * TILE, 0)).x;\n }\n worldToScreenY(floor: number): number {\n return this.engine.worldToScreenCoordinates(ex.vec(0, -floor * FLOOR)).y;\n }\n screenToTile(sx: number): number {\n return Math.floor(this.screenToWorld(sx, this.viewHeight / 2).x / TILE);\n }\n screenToFloor(sy: number): number {\n return Math.ceil(-this.screenToWorld(this.viewWidth / 2, sy).y / FLOOR);\n }\n\n // ---- Engine lifecycle (see towerScene) ----------------------------------\n\n /** True when the engine draws through WebGL (else a degraded Canvas2D\n * fallback the recovery path treats as a failed rebuild). */\n rendersWithWebGL(): boolean {\n return scene.rendersWithWebGL(this);\n }\n\n /** Full teardown, used by in-place context-loss recovery before a rebuild. */\n dispose(): void {\n clearLongPress(this); // no pending peek callback into a torn-down engine\n scene.dispose(this);\n }\n}\n"],"names":["overlayFx.setReducedMotion","overlayFx.resetDecorativeClock","reconcile.emptyFlightPass","scene.bindSceneWorld","scene.bakeSharedGraphics","scene.makeStructTileMap","scene.makeGround","scene.makeSky","scene.makeOverlay","camera.bindInput","scene.setSim","scene.followStep","reconcile.syncScene","reconcile.syncFacade","crowd.syncMotion","crowd.updateMotion","crowd.reconcileCrowd","camera.adoptCamera","camera.pickEntityAt","camera.pan","camera.zoomAt","camera.dynamicMinZoom","camera.clampGestureZoom","camera.center","camera.viewState","camera.applyView","camera.zoomBy","camera.ensureVisible","camera.setCamera","camera.focus","scene.rendersWithWebGL","scene.dispose"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA;;;;;;;;;;;;;AAaG;MACU,WAAW,CAAA;AAqLtB,IAAA,gBAAgB,CAAC,EAAW,EAAA,EAAUA,gBAA0B,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;;IAM5E,oBAAoB,GAAA;AAClB,QAAAC,oBAA8B,CAAC,IAAI,CAAC;IACtC;AAyDA;;AAEuE;AACvE,IAAA,WAAA,CAAY,MAAyB,EAAE,GAAc,EAAmB,MAAgB,EAAA;QAAhB,IAAA,CAAA,MAAM,GAAN,MAAM;;;QAjP9E,IAAA,CAAA,UAAU,GAAkB,IAAI;QAChC,IAAA,CAAA,YAAY,GAAG,CAAC;;QAEhB,IAAA,CAAA,UAAU,GAAkD,EAAE;QAC9D,IAAA,CAAA,gBAAgB,GAAG,CAAC;;QAEpB,IAAA,CAAA,UAAU,GAAkB,IAAI;QAChC,IAAA,CAAA,WAAW,GAAG,KAAK;QACnB,IAAA,CAAA,UAAU,GAAG,CAAC;;QAEd,IA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AAC,CAAC,GAAG,KAAK,CAAC;IACzE;;AAIA;AAC8D;IAC9D,gBAAgB,GAAA;AACd,QAAA,OAAOC,gBAAsB,CAAC,IAAI,CAAC;IACrC;;IAGA,OAAO,GAAA;AACL,QAAA,cAAc,CAAC,IAAI,CAAC,CAAC;AACrB,QAAAC,OAAa,CAAC,IAAI,CAAC;IACrB;AACD;;"}
@@ -0,0 +1,75 @@
1
+ import * as ex from "excalibur";
2
+ import type { FacilityKind } from "../../shared/types";
3
+ import type { TransportView } from "../../simport/view";
4
+ import { type CarIndicator } from "../carIndicator";
5
+ import { type CabLoad } from "./cabRiders";
6
+ import { type CabParts } from "./cabParts";
7
+ /**
8
+ * The graphic of one elevator car. It paints nothing of its own: each frame
9
+ * it lays the shared, already painted parts (`cabParts.ts`) on top of each
10
+ * other, the cab's back, each rider's standing figure in their slot and the
11
+ * cab's front, or one picture of the whole cab while it is empty. A cab's riders are real people, so its looks rarely repeat;
12
+ * when they change, the car only points at other parts, with no new canvas,
13
+ * no paint and no texture upload. Each part is painted and uploaded once for
14
+ * the whole tower.
15
+ */
16
+ /** The empty, idle cab state used to seed a fresh car's graphic. */
17
+ export declare const IDLE_CAR: CarIndicator;
18
+ /** What a car's cab state reads of the car. */
19
+ export interface CabGfxEntry {
20
+ readonly w: number;
21
+ /** Elevator kind, so each cab wears its type's look (`cabParts.ts`). */
22
+ readonly kind: FacilityKind;
23
+ /** The state the car's inputs last asked for (`cabWant`). */
24
+ want?: CabWant;
25
+ }
26
+ /** One drawn elevator car: car `i` of shaft `t`, moved along it each frame
27
+ * and drawing the state it shows (`shown`, a `carKey`) with `cab`. */
28
+ export interface CabActor extends CabGfxEntry {
29
+ readonly actor: ex.Actor;
30
+ readonly t: TransportView;
31
+ readonly i: number;
32
+ readonly cab: CabGraphic;
33
+ shown: string;
34
+ }
35
+ /** The cab state a car's inputs ask for, kept with the inputs it came from. */
36
+ export interface CabWant {
37
+ dir: number;
38
+ load: number;
39
+ cap: number;
40
+ cast: string;
41
+ ind: CarIndicator;
42
+ key: string;
43
+ }
44
+ /**
45
+ * The cab state for this frame's lantern direction, load, capacity and
46
+ * riders. Every frame asks, for every car, but the answer only changes when a
47
+ * step moves one of them, so it is worked out again only then: the frames in
48
+ * between compare four values and allocate nothing.
49
+ */
50
+ export declare function cabWant(entry: CabGfxEntry, dir: number, load: number, cap: number, riders: CabLoad): CabWant;
51
+ /** Stable key for a cab's indicator state: who rides, the lantern and FULL. */
52
+ export declare function carKey(ind: CarIndicator): string;
53
+ export declare class CabGraphic extends ex.Graphic {
54
+ private readonly parts;
55
+ private readonly kind;
56
+ private readonly cabW;
57
+ private readonly cw;
58
+ private readonly foot;
59
+ private readonly back;
60
+ private front;
61
+ /** The whole cab in one picture while nobody is aboard. */
62
+ private empty;
63
+ /** The riders' pictures and slots; the first `count` entries are drawn.
64
+ * The arrays keep their length, so a new load writes over them. */
65
+ private readonly riders;
66
+ private readonly slots;
67
+ private count;
68
+ private ind;
69
+ constructor(cab: Pick<CabGfxEntry, "w" | "kind">, ind?: CarIndicator, parts?: CabParts);
70
+ /** Show state `ind`: its lantern and FULL, and its riders standing in the
71
+ * cab. Looks up kept parts only; nothing is painted here. */
72
+ show(ind: CarIndicator): void;
73
+ protected _drawImage(ctx: ex.ExcaliburGraphicsContext, x: number, y: number): void;
74
+ clone(): CabGraphic;
75
+ }