@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 @@
1
+ {"version":3,"file":"towerInputCamera.js","sources":["../../../src/render/excalibur/towerInputCamera.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport { viewWorld } from \"../../presentation/viewWorld\";\nimport { findCatalogFacility } from \"../../catalog/catalogTypes\";\nimport type { FacilityKind, SerializedView, WeatherKind } from \"../../shared/types\";\nimport { VIEW_ZOOM_MAX, VIEW_ZOOM_MIN } from \"../../shared/viewZoom\";\nimport { wheelZoomDelta } from \"../../shared/inputEvents\";\nimport { clampCameraY, fitZoom } from \"../cameraBounds\";\nimport { stablePointerId } from \"../pinchTracker\";\nimport { FLOOR, TILE } from \"../scale\";\nimport { crowdCullNext } from \"./crowdCull\";\nimport { armLongPress, cancelLongPressOnMove, finishLongPress } from \"./longPress\";\nimport { cancelPress, endPress, isFirstContact, isUnusedMouseButton, movesWithButtonUp } from \"./pressLifecycle\";\nimport type { TowerEngine } from \"./TowerEngine\";\nimport { towerCatalog } from \"../../catalog/towerCatalog\";\n\n/** Pointer input, entity picking, camera control and the audio view-focus for\n * {@link TowerEngine}, as friend functions taking the engine instance\n * (extracted from `TowerEngine.ts`; the class keeps thin delegations and the\n * coordinate transforms these read). */\n\n/** Camera zoom range (screen px per world px). Lives in shared/viewZoom\n * (VIEW_ZOOM_MIN/MAX: the save schema clamps a restored zoom at the\n * deserialize trust boundary); re-exported under the familiar names. */\nexport const MIN_ZOOM = VIEW_ZOOM_MIN;\nexport const MAX_ZOOM = VIEW_ZOOM_MAX;\nconst clampZoom = (z: number): number => (Number.isFinite(z) ? Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, z)) : MIN_ZOOM);\n\n/** Movement value far above every tap-slop threshold. Assigned to `moved` when\n * a pinch hands off to one surviving finger, so its release can't tap-place. */\nconst TAP_SLOP_POISON = 1e6;\n\nexport interface ViewFocus {\n centerFloor: number;\n dominant: FacilityKind | \"outside\" | \"lobby\" | \"empty\";\n night: boolean;\n /** Camera zoom (world px multiplier): ~0.15 fits a tall tower in frame, 3 is\n * a tight close-up. Audio widens to the \"tower overview\" bed zoomed out and\n * fades in area detail (crowd, kitchen clatter, elevator dings) up close. */\n zoom: number;\n /** Today's sky weather; drives an outdoor rain layer in the ambient bed. */\n weather: WeatherKind;\n /** Sim clock hour as a float in [0, 24); the ambience layer's workday and\n * evening gates read it (offices type at 10:00, sleep at 03:00). */\n hour: number;\n /** 0..1 live fill of the dominant kind's units in view (occupants vs capacity),\n * falling back to visible crowd density for kinds that track no occupants\n * (lobbies, the street). Drives ambience loudness: empty is near-silent. */\n crowd: number;\n}\n\n/** What the pointer is over (see pickEntityAt), with its cell: a floor or\n * lobby tile has no id in the view (#1417). */\nexport interface Picked {\n type: \"unit\" | \"transport\";\n id: number;\n kind: FacilityKind;\n cell?: { floor: number; x: number };\n}\n\nexport interface ScreenRect {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nfunction buttonNum(ev: ex.PointerEvent): number {\n if (ev.button === ex.PointerButton.Middle) return 1;\n if (ev.button === ex.PointerButton.Right) return 2;\n return 0;\n}\n\n// ---- Input (Excalibur pointer system) ----------------------------------\n\nfunction tf(ev: ex.PointerEvent): { tile: number; floor: number } {\n return worldToCell(ev.worldPos);\n}\n\n/** World point → grid cell, the single inverse of worldX/worldYTop, shared by\n * pointer handling and the pick fallback so the two can't drift. */\nfunction worldToCell(world: ex.Vector): { tile: number; floor: number } {\n return { tile: Math.floor(world.x / TILE), floor: Math.ceil(-world.y / FLOOR) };\n}\n\nexport function bindInput(engine: TowerEngine): void {\n const ptr = engine.engine.input.pointers;\n ptr.on(\"down\", (ev) => pointerDown(engine, ev as ex.PointerEvent));\n ptr.on(\"move\", (ev) => pointerMove(engine, ev as ex.PointerEvent));\n ptr.on(\"up\", (ev) => pointerUp(engine, ev as ex.PointerEvent, \"release\"));\n // A canceled pointer (the OS took the touch) ends its gesture without acting.\n ptr.on(\"cancel\", (ev) => pointerUp(engine, ev as ex.PointerEvent, \"cancel\"));\n ptr.on(\"wheel\", (ev) => {\n const w = ev as ex.WheelEvent;\n // The native deltas, as Excalibur's own deltaY zooms on a sideways swipe; under Shift, deltaX zooms.\n const n = (w.ev ?? {}) as Partial<WheelEvent>;\n const d = wheelZoomDelta({ deltaX: n.deltaX ?? w.deltaX, deltaY: n.deltaY ?? w.deltaY, shiftKey: n.shiftKey });\n if (d === 0) return;\n zoomAt(engine, d < 0 ? 1.12 : 0.89, w.x, w.y);\n });\n}\n\n/** Top-most entity under the point: transports by collider (they overlay units), units by grid. */\nexport function pickEntityAt(engine: TowerEngine, world: ex.Vector): Picked | null {\n let best: Picked | null = null;\n let bestZ = -Infinity;\n for (const [id, a] of engine.transportActors) {\n if (a.z >= bestZ && a.contains(world.x, world.y)) {\n const t = engine.sim.tower.getTransport(id);\n if (t) {\n best = { type: \"transport\", id, kind: t.kind };\n bestZ = a.z;\n }\n }\n }\n // Every unit kind resolves by grid lookup: the tile index is\n // footprint-complete and rooms sit below transports, so one O(1) unitAt\n // matches the old O(rooms) actor scan, free of the render's actor model.\n if (!best) {\n const { tile, floor } = worldToCell(world);\n const u = engine.sim.tower.unitAt(floor, tile);\n if (u) best = { type: \"unit\", id: u.id, kind: u.kind, cell: { floor, x: tile } };\n }\n return best;\n}\n\nfunction pointerDown(engine: TowerEngine, ev: ex.PointerEvent): void {\n if (isUnusedMouseButton(ev)) return; // a side button is no press (#2073)\n // A primary press while a press is still open: that one lost its release (#1014).\n if (isFirstContact(ev.nativeEvent)) cancelPress(engine);\n const contact = engine.tracker.down(stablePointerId(ev.pointerId, ev.nativeEvent), ev.screenPos.x, ev.screenPos.y);\n if (contact === \"pinch-start\") {\n // A second finger is a camera gesture: end the press it interrupts (an\n // extend drag pointerMove would resume with a jump, a pending or showing\n // peek, a tool press that never releases), so the pinch takes over and the\n // survivor's release seeds a pan, never a swallowed tap.\n endPress(engine);\n engine.preview = null;\n engine.transportPreview = null;\n return;\n }\n if (contact === \"pinch-extra\") return;\n // lastSx/lastSy advance with a pan; downSx/downSy stay at the press origin.\n engine.lastSx = engine.downSx = ev.screenPos.x;\n engine.lastSy = engine.downSy = ev.screenPos.y;\n engine.moved = 0;\n finishLongPress(engine); // an orphaned peek (lost release) dismisses its card, not just the latch\n const touch = ev.pointerType === \"Touch\";\n engine.downTouch = touch;\n // Pan key: the game's Space hold (spacePanKey) as this press went down, or Shift alone (Ctrl+Shift\n // or Cmd+Shift is the three-story lobby, #308). Down-only: releasing it mid-drag keeps the pan.\n const native = ev.nativeEvent as (Event & { shiftKey?: boolean; ctrlKey?: boolean; metaKey?: boolean }) | undefined;\n const panKey = engine.spacePanKey?.(native) === true || (native?.shiftKey === true && !native.ctrlKey && !native.metaKey);\n // Left-click on a selected elevator's extend arrow grows the shaft. A held\n // pan key skips the arrow: the modifier promises the drag only pans.\n if (buttonNum(ev) === 0 && !panKey && engine.onExtendTo) {\n const ps = ev.screenPos;\n const inRect = (r?: ScreenRect) =>\n !!r && ps.x >= r.x && ps.x <= r.x + r.w && ps.y >= r.y && ps.y <= r.y + r.h;\n let end: \"up\" | \"down\" | null = null;\n if (inRect(engine.arrowHit.up)) end = \"up\";\n else if (inRect(engine.arrowHit.down)) end = \"down\";\n if (end) {\n // A plain click extends one floor (on pointer-up); a drag goes floor-by-floor.\n engine.arrowDrag = { end, shaft: engine.selectedId };\n engine.gesture = null;\n return;\n }\n }\n // Right-click always inspects under the cursor; it never pans or builds.\n if (buttonNum(ev) === 2 && engine.onSecondary) {\n engine.onSecondary(pickEntityAt(engine, ev.worldPos));\n engine.gesture = null;\n return;\n }\n engine.gesture = engine.classifyDown ? engine.classifyDown(buttonNum(ev), touch, panKey) : \"pan\";\n const { tile, floor } = tf(ev);\n const picked = pickEntityAt(engine, ev.worldPos);\n if (engine.gesture === \"action\") engine.onActionDown?.(tile, floor, touch, picked);\n // A held touch peeks the facility under the finger with any tool armed: the\n // hold fires only in the pre-movement window no tool's one-finger drag uses,\n // so the first move past slop hands the gesture back to the tool.\n armLongPress(engine, tile, floor, picked, touch);\n}\n\nfunction pointerMove(engine: TowerEngine, ev: ex.PointerEvent): void {\n const pid = stablePointerId(ev.pointerId, ev.nativeEvent);\n // The pressing mouse back with its button up let go off the canvas (#1014).\n if (engine.tracker.tracks(pid) && movesWithButtonUp(ev.nativeEvent)) cancelPress(engine);\n const mv = engine.tracker.move(pid, ev.screenPos.x, ev.screenPos.y);\n if (engine.tracker.pinching) {\n if (mv) {\n // Two fingers translate the camera by their midpoint delta (pan) AND\n // scale by their distance ratio (zoom): the standard map gesture.\n pan(engine, mv.panDx, mv.panDy);\n if (mv.zoom !== 1) zoomAt(engine, mv.zoom, mv.cx, mv.cy);\n }\n return;\n }\n // Only the pointer that pressed drives from here on: a hovering mouse\n // (hybrid hardware) moves without pressing, and letting it through would\n // cancel a touch's pending peek or drive its gesture at the mouse position.\n if (engine.tracker.size > 0 && !engine.tracker.tracks(pid)) return;\n // A drag lives as long as its shaft's selection: another pick ends it (#1014).\n if (engine.arrowDrag && engine.arrowDrag.shaft !== engine.selectedId) cancelPress(engine);\n if (engine.arrowDrag) {\n engine.moved += Math.abs(ev.screenPos.y - engine.lastSy);\n engine.lastSy = ev.screenPos.y;\n engine.onExtendTo?.(engine.arrowDrag.end, engine.screenToFloor(ev.screenPos.y));\n return;\n }\n // A fired peek is an absorbing state: it owns the gesture to release, so a\n // move neither pans nor re-drives the tool (that would strand a re-armed ghost\n // or paint tiles with no undo capture open).\n if (engine.longPressFired) return;\n // While a peek is still PENDING, a within-slop jitter must not drive the tool\n // (TILE 11 < slop 14, so a jitter can cross a tile and a paint tool would seed\n // a stray strip). A past-slop move clears the timer first, then drives normally.\n cancelLongPressOnMove(engine, ev.screenPos.x, ev.screenPos.y);\n if (engine.longPressTimer !== null) return;\n const { tile, floor } = tf(ev);\n if (engine.gesture === \"pan\") {\n const dx = ev.screenPos.x - engine.lastSx;\n const dy = ev.screenPos.y - engine.lastSy;\n engine.moved += Math.abs(dx) + Math.abs(dy);\n pan(engine, dx, dy);\n engine.lastSx = ev.screenPos.x;\n engine.lastSy = ev.screenPos.y;\n } else if (engine.gesture === \"action\") {\n engine.onActionMove?.(tile, floor, pickEntityAt(engine, ev.worldPos));\n } else if (ev.pointerType !== \"Touch\") {\n // Hover is a mouse/pen concept. A touch move reaches here only in odd\n // gestureless states; letting it hover would strand a build-preview ghost\n // that no later touch event clears.\n engine.onHover?.(tile, floor, pickEntityAt(engine, ev.worldPos));\n }\n}\n\nfunction pointerUp(engine: TowerEngine, ev: ex.PointerEvent, how: \"release\" | \"cancel\"): void {\n if (isUnusedMouseButton(ev)) return; // nor its release (#2073)\n const pid = stablePointerId(ev.pointerId, ev.nativeEvent);\n // Same ownership rule as pointerMove: a release from a pointer that never\n // pressed here (a mouse press begun off-canvas) must not end the tracked\n // contact's peek or fire its gesture at the mouse position.\n if (engine.tracker.size > 0 && !engine.tracker.tracks(pid)) return;\n const r = engine.tracker.up(pid);\n // A release that ends a fired peek dismisses it and swallows the tap/action.\n if (finishLongPress(engine)) return;\n if (r.pinch === \"continues\") {\n engine.gesture = null;\n return;\n }\n if (r.pinch === \"ended\") {\n if (r.survivor) {\n // Hand the survivor a pan continuation: seed from its tracked position\n // and poison the tap slop so its release can't tap-place.\n engine.gesture = \"pan\";\n engine.lastSx = r.survivor.x;\n engine.lastSy = r.survivor.y;\n engine.moved = TAP_SLOP_POISON;\n } else {\n engine.gesture = null;\n }\n return;\n }\n if (engine.arrowDrag) {\n // A press without a drag extends a single floor.\n if (engine.moved < 5 && how === \"release\") {\n const t = engine.selectedId == null ? undefined : engine.sim.tower.getTransport(engine.selectedId);\n if (t) {\n const target = engine.arrowDrag.end === \"up\" ? t.top + 1 : t.bottom - 1;\n engine.onExtendTo?.(engine.arrowDrag.end, target);\n }\n }\n engine.onExtendEnd?.();\n engine.arrowDrag = null;\n engine.gesture = null;\n return;\n }\n const { tile, floor } = tf(ev);\n if (engine.gesture === \"pan\") {\n // Touch taps jitter more than mouse clicks, so allow a larger slop.\n if (engine.moved < (engine.downTouch ? 14 : 5) && how === \"release\") {\n engine.onTap?.(tile, floor, ev.pointerType === \"Touch\", pickEntityAt(engine, ev.worldPos), ev.worldPos);\n }\n } else if (engine.gesture === \"action\") {\n if (how === \"cancel\") engine.onActionCancel?.();\n else engine.onActionUp?.(tile, floor, pickEntityAt(engine, ev.worldPos));\n }\n engine.gesture = null;\n}\n\n/** Camera policy for a swapped-in (or boot-loaded) tower. A tooling restore\n * keeps the camera (keepCamera), a genuine swap restores the save's own view\n * or else centers, and an undo or redo step keeps the scene and skips this. */\nexport function adoptCamera(engine: TowerEngine, view: SerializedView | null, keepCamera?: boolean): void {\n if (keepCamera) return;\n if (view) engine.applyView(view);\n else engine.center();\n}\n\n// ---- Camera control (Excalibur camera) ----------------------------------\n\nexport function pan(engine: TowerEngine, dxScreen: number, dyScreen: number): void {\n engine.cam.pos = ex.vec(engine.cam.pos.x - dxScreen / engine.cam.zoom, engine.cam.pos.y - dyScreen / engine.cam.zoom);\n clamp(engine);\n}\nexport function zoomAt(engine: TowerEngine, factor: number, sx: number, sy: number): void {\n const before = engine.screenToWorld(sx, sy);\n engine.cam.zoom = clampGestureZoom(engine, engine.cam.zoom * factor);\n const after = engine.screenToWorld(sx, sy);\n engine.cam.pos = ex.vec(engine.cam.pos.x + (before.x - after.x), engine.cam.pos.y + (before.y - after.y));\n clamp(engine);\n}\n\n/** The tower-aware zoom-out floor for the CURRENT tower and viewport: a pinch\n * or wheel can pull back until the whole built tower plus a breath of sky fits,\n * then stops, rather than drifting into empty void. Recomputed per gesture as\n * the tower grows and the viewport resizes. Basements count (highest floor to\n * lowest), so a deep tower frames its cellars too. See {@link fitZoom}. */\nexport function dynamicMinZoom(engine: TowerEngine): number {\n const span = engine.sim.tower.highestFloor - engine.sim.tower.lowestFloor + 1;\n return fitZoom(engine.viewHeight, span, FLOOR, MIN_ZOOM);\n}\n\n/** Clamp a gesture-driven zoom to `[effectiveMin, MAX_ZOOM]`. The static\n * {@link clampZoom} (trust-boundary floor) still guards the save-restore path\n * in {@link setCamera}; the tighter tower-aware floor applies only to live\n * pinch/wheel/keyboard zoom so the player can't zoom out past their tower.\n *\n * The floor only ever stops further zoom-OUT; it must never FORCE a zoom-in.\n * The camera can legitimately sit below the current floor after a rotation or a\n * cross-device save set on another viewport, and snapping it inward on the next\n * pinch reads as the camera fighting the player. So the effective floor drops to\n * the current zoom when the camera is already below `lo`: no further zoom-out,\n * free zoom-in, and the tower-aware floor re-engages once back above it. */\nexport function clampGestureZoom(engine: TowerEngine, z: number): number {\n const lo = dynamicMinZoom(engine);\n const cur = engine.cam.zoom;\n const effectiveLo = Number.isFinite(cur) && cur < lo ? cur : lo;\n return Number.isFinite(z) ? Math.max(effectiveLo, Math.min(MAX_ZOOM, z)) : effectiveLo;\n}\nfunction clamp(engine: TowerEngine): void {\n const x = Math.max(0, Math.min(viewWorld().lotWidth * TILE, engine.cam.pos.x));\n // Zoom-aware vertical clamp on the visible top/bottom edges, so zooming out\n // never shows void below the deepest basement. See {@link clampCameraY}.\n const y = clampCameraY(engine.cam.pos.y, engine.viewHeight, engine.cam.zoom, FLOOR, viewWorld().minFloor, viewWorld().maxFloor);\n engine.cam.pos = ex.vec(x, y);\n}\nexport function center(engine: TowerEngine): void {\n const hi = engine.sim.tower.highestFloor;\n engine.cam.pos = ex.vec((viewWorld().lotWidth / 2) * TILE, -(Math.max(6, hi) / 2) * FLOOR);\n}\n\n/** The live camera as save-file cargo: center in grid units plus zoom (the exact\n * inverse of {@link applyView}, so a same-device round trip is lossless).\n * Stamped onto the sim by the UI layer right before a save. */\nexport function viewState(engine: TowerEngine): SerializedView {\n return { tile: engine.cam.pos.x / TILE, floor: -engine.cam.pos.y / FLOOR, zoom: engine.cam.zoom };\n}\n\n/** Restore a saved view. Zoom is optional (a TDT import has none): absent, the\n * session's current zoom stays. Everything funnels through setCamera's clampZoom\n * and clamp() so a view from another device (or forged) is re-bounded here. */\nexport function applyView(engine: TowerEngine, v: SerializedView): void {\n engine.setCamera(v.tile, v.floor, v.zoom ?? engine.cam.zoom);\n clamp(engine);\n}\n\n/** Zoom by a factor about the current center (keyboard +/- zoom). */\nexport function zoomBy(engine: TowerEngine, factor: number): void {\n engine.cam.zoom = clampGestureZoom(engine, engine.cam.zoom * factor);\n clamp(engine); // bound both axes, same as pointer zoom\n}\n\n/** Pan the camera the minimum amount so tile/floor sits within the viewport\n * (with a margin), used to follow the keyboard build cursor. */\nexport function ensureVisible(engine: TowerEngine, tile: number, floor: number): void {\n const wx = tile * TILE;\n const wy = -floor * FLOOR;\n const halfW = engine.viewWidth / 2 / engine.cam.zoom;\n const halfH = engine.viewHeight / 2 / engine.cam.zoom;\n const mx = TILE * 3;\n const my = FLOOR * 1.5;\n let px = engine.cam.pos.x;\n let py = engine.cam.pos.y;\n if (wx < px - halfW + mx) px = wx + halfW - mx;\n else if (wx > px + halfW - mx) px = wx - halfW + mx;\n if (wy < py - halfH + my) py = wy + halfH - my;\n else if (wy > py + halfH - my) py = wy - halfH + my;\n engine.cam.pos = ex.vec(px, py);\n clamp(engine); // bound both axes, same as pointer pan\n}\nexport function setCamera(engine: TowerEngine, tileX: number, floor: number, zoom: number): void {\n // Validate zoom: the vertical clamp divides by zoom, so a zero/negative/NaN\n // here would poison later pan/zoom math.\n engine.cam.zoom = clampZoom(zoom);\n engine.cam.pos = ex.vec(tileX * TILE, -floor * FLOOR);\n}\n\n// ---- Audio focus --------------------------------------------------------\n\n/** Census cache per engine: the occupancy tally refreshes at most once per second\n * (the GDD's cap), while the cheap dominant/zoom/clock reads stay per call. Keyed\n * weakly so a torn-down engine drops its entry. */\nconst censusCache = new WeakMap<TowerEngine, { at: number; dominant: string; crowd: number; seen: number }>();\nconst CENSUS_REFRESH_MS = 1000;\n\n/** The occupancy walk behind {@link ViewFocus.crowd}: fill of the dominant kind's\n * units in view, with a drawn-crowd fallback for kinds that track no occupants\n * (lobbies, the street), 24 visible people a full house. While culled the view\n * carries nobody (#2151), so the fallback keeps `seen`, its last people count. */\ntype Bounds = { t0: number; t1: number; f0: number; f1: number };\nfunction censusCrowd(engine: TowerEngine, dominant: ViewFocus[\"dominant\"], bounds: Bounds, seen: number): { crowd: number; seen: number } {\n let occ = 0;\n let cap = 0;\n if (dominant !== \"empty\" && dominant !== \"outside\") {\n for (const u of engine.sim.tower.units) {\n if (u.kind !== dominant) continue;\n if (u.floor < bounds.f0 || u.floor > bounds.f1) continue;\n if (u.x + u.width < bounds.t0 || u.x > bounds.t1) continue;\n const def = findCatalogFacility(towerCatalog(engine.sim), u.kind);\n if (!def) continue; // a kind the catalog no longer knows: skip, never throw\n const unitCap = def.population > 0 ? def.population : (def.attendance ?? 0);\n if (unitCap > 0) {\n // Population>0 commercial venues read `customersIn` (the routed-\n // customer tally; a shop still draws its full population while open).\n // Attendance venues (cinema, party hall) mirror `customersIn` into\n // `occupants`, and every other kind owns `occupants` via\n // updatePresence, so both read it.\n // (`customersIn` is not persisted: just after a save load a busy venue\n // reads empty for the seconds the crowd system takes to re-route diners\n // in. That is honest and self-heals, so nothing tracks it.)\n occ += def.commercial && def.population > 0 ? (u.customersIn ?? 0) : (u.occupants ?? 0);\n cap += unitCap;\n }\n }\n }\n if (cap > 0) return { crowd: Math.min(1, Math.max(0, occ / cap)), seen };\n // Judged as the frame's people window is (`frameWindow`), from this frame's zoom.\n if (crowdCullNext(engine.cam.zoom, engine.crowdCulled)) return { crowd: seen, seen };\n let visible = 0;\n for (const p of engine.sim.crowd.people) {\n if (p.floor < bounds.f0 || p.floor > bounds.f1) continue;\n if (p.x < bounds.t0 || p.x > bounds.t1) continue;\n visible++;\n }\n return { crowd: Math.min(1, visible / 24), seen: Math.min(1, visible / 24) };\n}\n\nexport function focus(engine: TowerEngine): ViewFocus {\n const centerFloor = engine.screenToFloor(engine.viewHeight / 2);\n const night = engine.sim.clock.isNight();\n const t0 = engine.screenToTile(engine.viewWidth * 0.3);\n const t1 = engine.screenToTile(engine.viewWidth * 0.7);\n const f0 = engine.screenToFloor(engine.viewHeight * 0.7);\n const f1 = engine.screenToFloor(engine.viewHeight * 0.3);\n const tally = new Map<FacilityKind, number>();\n for (const u of engine.sim.tower.units) {\n if (u.floor < f0 || u.floor > f1) continue;\n if (u.x + u.width < t0 || u.x > t1) continue;\n tally.set(u.kind, (tally.get(u.kind) ?? 0) + u.width);\n }\n let dominant: ViewFocus[\"dominant\"] = \"empty\";\n let best = 0;\n for (const [k, v] of tally) {\n if (k === \"floor\") continue;\n if (v > best) {\n best = v;\n dominant = k === \"lobby\" ? \"lobby\" : k;\n }\n }\n if (dominant === \"empty\" && centerFloor <= 0) dominant = \"outside\";\n // The occupancy walk refreshes at most once per second (or when the dominant\n // kind changes, so a pan onto a new venue reads immediately); ambience ramps\n // slowly, so a 1 s census is plenty. Use a monotonic clock (`performance.now()`,\n // else `Date.now()`): a constant 0 would freeze `now - cached.at` forever.\n const now =\n typeof performance !== \"undefined\" && typeof performance.now === \"function\"\n ? performance.now()\n : Date.now();\n const cached = censusCache.get(engine);\n let crowd: number;\n if (cached && cached.dominant === dominant && now - cached.at < CENSUS_REFRESH_MS) {\n crowd = cached.crowd;\n } else {\n const census = censusCrowd(engine, dominant, { t0, t1, f0, f1 }, cached?.seen ?? 0);\n crowd = census.crowd;\n censusCache.set(engine, { at: now, dominant, crowd, seen: census.seen });\n }\n const hour = engine.sim.clock.minuteOfDay / 60;\n return {\n centerFloor,\n dominant,\n night,\n zoom: engine.cam.zoom,\n weather: engine.sim.weather,\n hour,\n crowd,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAeA;;;AAGyC;AAEzC;;AAEyE;AAClE,MAAM,QAAQ,GAAG;AACjB,MAAM,QAAQ,GAAG;AACxB,MAAM,SAAS,GAAG,CAAC,CAAS,MAAc,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;AAEpH;AACiF;AACjF,MAAM,eAAe,GAAG,GAAG;AAqC3B,SAAS,SAAS,CAAC,EAAmB,EAAA;IACpC,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,aAAa,CAAC,MAAM;AAAE,QAAA,OAAO,CAAC;IACnD,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,aAAa,CAAC,KAAK;AAAE,QAAA,OAAO,CAAC;AAClD,IAAA,OAAO,CAAC;AACV;AAEA;AAEA,SAAS,EAAE,CAAC,EAAmB,EAAA;AAC7B,IAAA,OAAO,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC;AACjC;AAEA;AACqE;AACrE,SAAS,WAAW,CAAC,KAAgB,EAAA;AACnC,IAAA,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GA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";
3
+ import type { TowerEngine } from "./TowerEngine";
4
+ /**
5
+ * The metro's moving and tunnel parts: each station's train and the portals
6
+ * where it disappears, and the tunnel row along the stations' bottom story.
7
+ * Friend functions taking the engine, like the rest of `towerCrowd`.
8
+ */
9
+ /** One per station: its view of the line's train. `line` holds the left edges
10
+ * (world x) of every station on its row, left to right, and `stop` this
11
+ * station's place in it, so the row's one train calls at each in turn
12
+ * (`metroTrainAt`). */
13
+ export interface MetroTrain {
14
+ actor: ex.Actor;
15
+ u: UnitView;
16
+ w: number;
17
+ shift: (offset: number) => void;
18
+ line: readonly number[];
19
+ stop: number;
20
+ }
21
+ /** Every station's train and portals, and one tunnel along their row. A Modern
22
+ * tower may run several stations on one line, so the tunnel is laid once, in
23
+ * the gaps the stations leave. */
24
+ export declare function addMetros(engine: TowerEngine, stations: readonly UnitView[]): void;
25
+ /** The tile spans `[from, to)` of a station row the tunnel fills: the whole lot
26
+ * less every station's footprint. SimTower lays the tunnel on both sides of its
27
+ * one station out to the lot's edges. */
28
+ export declare function tunnelSpans(stations: readonly {
29
+ x: number;
30
+ width: number;
31
+ }[], lotWidth: number): [number, number][];
@@ -0,0 +1,115 @@
1
+ import * as ex from 'excalibur';
2
+ import { Z } from '../depthPlanes.js';
3
+ import { viewWorld } from '../../presentation/viewWorld.js';
4
+ import { TILE, FLOOR } from '../scale.js';
5
+ import '../sprites/facilities.js';
6
+ import { METRO_TRAIN_H, drawMetroTrain, METRO_PORTAL_W, drawMetroPortal } from '../sprites/facilities/vehicles.js';
7
+ import { METRO_TUNNEL_TILE, drawMetroTunnel } from '../sprites/facilities/service.js';
8
+
9
+ /** Every station's train and portals, and one tunnel along their row. A Modern
10
+ * tower may run several stations on one line, so the tunnel is laid once, in
11
+ * the gaps the stations leave. */
12
+ function addMetros(engine, stations) {
13
+ const rows = new Map();
14
+ for (const u of stations)
15
+ rows.set(u.floor, [...(rows.get(u.floor) ?? []), u]);
16
+ for (const [floor, onRow] of rows) {
17
+ const ordered = [...onRow].sort((a, b) => a.x - b.x);
18
+ const line = ordered.map((u) => trainLeft(engine, u));
19
+ ordered.forEach((u, stop) => addMetro(engine, u, line, stop));
20
+ addTunnel(engine, floor, tunnelSpans(onRow, viewWorld().lotWidth));
21
+ }
22
+ }
23
+ /** The world x of a station's train canvas, where the train stands when it
24
+ * calls there. */
25
+ function trainLeft(engine, u) {
26
+ return engine.worldX(u.x) + 3;
27
+ }
28
+ /** The tile spans `[from, to)` of a station row the tunnel fills: the whole lot
29
+ * less every station's footprint. SimTower lays the tunnel on both sides of its
30
+ * one station out to the lot's edges. */
31
+ function tunnelSpans(stations, lotWidth) {
32
+ const spans = [];
33
+ let from = 0;
34
+ for (const u of [...stations].sort((a, b) => a.x - b.x)) {
35
+ if (u.x > from)
36
+ spans.push([from, u.x]);
37
+ from = Math.max(from, u.x + u.width);
38
+ }
39
+ if (from < lotWidth)
40
+ spans.push([from, lotWidth]);
41
+ return spans;
42
+ }
43
+ /** The station's view of the line's train, and its portals. The car sits on
44
+ * the track just below the platform edge: its base is 3px off the station
45
+ * floor and it stands METRO_TRAIN_H tall. `line` and `stop` place the station
46
+ * on its row's line, so the one train shows here only when it calls here. */
47
+ function addMetro(engine, u, line, stop) {
48
+ const w = u.width * TILE - 6;
49
+ const trainY = engine.worldYTop(u.floor) + FLOOR - 3 - METRO_TRAIN_H;
50
+ // The consist is baked once; the actor stays on the station and its canvas
51
+ // clips the train to the station footprint. The portals at both ends hide the
52
+ // cut, so the train slides out of and back into the tunnel.
53
+ const bake = document.createElement("canvas");
54
+ bake.width = w;
55
+ bake.height = METRO_TRAIN_H;
56
+ drawMetroTrain(bake.getContext("2d"), w, true);
57
+ let offset = 0;
58
+ const cv = new ex.Canvas({ width: w, height: METRO_TRAIN_H, cache: true, draw: (ctx) => ctx.drawImage(bake, Math.round(offset), 0) });
59
+ const a = new ex.Actor({ pos: ex.vec(trainLeft(engine, u), trainY), width: w, height: METRO_TRAIN_H, anchor: ex.vec(0, 0), z: Z.vehicle });
60
+ a.graphics.use(cv);
61
+ engine.engine.add(a);
62
+ const shift = (next) => {
63
+ if (next === offset)
64
+ return;
65
+ offset = next;
66
+ cv.flagDirty();
67
+ };
68
+ engine.trainActors.push({ actor: a, u, w, shift, line, stop });
69
+ addPortals(engine, u, trainY);
70
+ }
71
+ /** The tunnel along the stations' bottom story, over the tile `spans` from
72
+ * `tunnelSpans`. Tiles are phase-aligned to the world x so every span carries
73
+ * the same pattern, each under the texture-size limit. */
74
+ function addTunnel(engine, floor, spans) {
75
+ const y = engine.worldYTop(floor);
76
+ for (const [fromTile, toTile] of spans) {
77
+ const [from, to] = [engine.worldX(fromTile), engine.worldX(toTile)];
78
+ for (let x = from; x < to;) {
79
+ const tileStart = Math.floor(x / METRO_TUNNEL_TILE) * METRO_TUNNEL_TILE;
80
+ const end = Math.min(tileStart + METRO_TUNNEL_TILE, to);
81
+ const w = end - x;
82
+ const phase = x - tileStart;
83
+ const cv = new ex.Canvas({
84
+ width: w,
85
+ height: FLOOR,
86
+ cache: true,
87
+ draw: (ctx) => {
88
+ ctx.translate(-phase, 0);
89
+ drawMetroTunnel(ctx);
90
+ },
91
+ });
92
+ const a = new ex.Actor({ pos: ex.vec(x, y), width: w, height: FLOOR, anchor: ex.vec(0, 0), z: Z.structure });
93
+ a.graphics.use(cv);
94
+ engine.engine.add(a);
95
+ engine.tunnelActors.push(a);
96
+ x = end;
97
+ }
98
+ }
99
+ }
100
+ /** A dark mouth at each end of the station, drawn over the train: the train
101
+ * comes out of the dark and goes back into it. */
102
+ function addPortals(engine, u, trainY) {
103
+ const h = METRO_TRAIN_H + 3;
104
+ for (const side of ["left", "right"]) {
105
+ const x = side === "left" ? engine.worldX(u.x) : engine.worldX(u.x + u.width) - METRO_PORTAL_W;
106
+ const cv = new ex.Canvas({ width: METRO_PORTAL_W, height: h, cache: true, draw: (ctx) => drawMetroPortal(ctx, METRO_PORTAL_W, h, side) });
107
+ const a = new ex.Actor({ pos: ex.vec(x, trainY), width: METRO_PORTAL_W, height: h, anchor: ex.vec(0, 0), z: Z.vehicle + 0.05 });
108
+ a.graphics.use(cv);
109
+ engine.engine.add(a);
110
+ engine.tunnelActors.push(a);
111
+ }
112
+ }
113
+
114
+ export { addMetros, tunnelSpans };
115
+ //# sourceMappingURL=towerMetro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"towerMetro.js","sources":["../../../src/render/excalibur/towerMetro.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport { Z } from \"../depthPlanes\";\nimport { viewWorld } from \"../../presentation/viewWorld\";\nimport type { UnitView } from \"../../simport/view\";\nimport { FLOOR, TILE } from \"../scale\";\nimport { METRO_TUNNEL_TILE, drawMetroTunnel } from \"../sprites/facilities\";\nimport { METRO_PORTAL_W, METRO_TRAIN_H, drawMetroPortal, drawMetroTrain } from \"../sprites/facilities/vehicles\";\nimport type { TowerEngine } from \"./TowerEngine\";\n\n/**\n * The metro's moving and tunnel parts: each station's train and the portals\n * where it disappears, and the tunnel row along the stations' bottom story.\n * Friend functions taking the engine, like the rest of `towerCrowd`.\n */\n\n/** One per station: its view of the line's train. `line` holds the left edges\n * (world x) of every station on its row, left to right, and `stop` this\n * station's place in it, so the row's one train calls at each in turn\n * (`metroTrainAt`). */\nexport interface MetroTrain {\n actor: ex.Actor;\n u: UnitView;\n w: number;\n shift: (offset: number) => void;\n line: readonly number[];\n stop: number;\n}\n\n/** Every station's train and portals, and one tunnel along their row. A Modern\n * tower may run several stations on one line, so the tunnel is laid once, in\n * the gaps the stations leave. */\nexport function addMetros(engine: TowerEngine, stations: readonly UnitView[]): void {\n const rows = new Map<number, UnitView[]>();\n for (const u of stations) rows.set(u.floor, [...(rows.get(u.floor) ?? []), u]);\n for (const [floor, onRow] of rows) {\n const ordered = [...onRow].sort((a, b) => a.x - b.x);\n const line = ordered.map((u) => trainLeft(engine, u));\n ordered.forEach((u, stop) => addMetro(engine, u, line, stop));\n addTunnel(engine, floor, tunnelSpans(onRow, viewWorld().lotWidth));\n }\n}\n\n/** The world x of a station's train canvas, where the train stands when it\n * calls there. */\nfunction trainLeft(engine: TowerEngine, u: UnitView): number {\n return engine.worldX(u.x) + 3;\n}\n\n/** The tile spans `[from, to)` of a station row the tunnel fills: the whole lot\n * less every station's footprint. SimTower lays the tunnel on both sides of its\n * one station out to the lot's edges. */\nexport function tunnelSpans(stations: readonly { x: number; width: number }[], lotWidth: number): [number, number][] {\n const spans: [number, number][] = [];\n let from = 0;\n for (const u of [...stations].sort((a, b) => a.x - b.x)) {\n if (u.x > from) spans.push([from, u.x]);\n from = Math.max(from, u.x + u.width);\n }\n if (from < lotWidth) spans.push([from, lotWidth]);\n return spans;\n}\n\n/** The station's view of the line's train, and its portals. The car sits on\n * the track just below the platform edge: its base is 3px off the station\n * floor and it stands METRO_TRAIN_H tall. `line` and `stop` place the station\n * on its row's line, so the one train shows here only when it calls here. */\nfunction addMetro(engine: TowerEngine, u: UnitView, line: readonly number[], stop: number): void {\n const w = u.width * TILE - 6;\n const trainY = engine.worldYTop(u.floor) + FLOOR - 3 - METRO_TRAIN_H;\n // The consist is baked once; the actor stays on the station and its canvas\n // clips the train to the station footprint. The portals at both ends hide the\n // cut, so the train slides out of and back into the tunnel.\n const bake = document.createElement(\"canvas\");\n bake.width = w;\n bake.height = METRO_TRAIN_H;\n drawMetroTrain(bake.getContext(\"2d\")!, w, true);\n let offset = 0;\n const cv = new ex.Canvas({ width: w, height: METRO_TRAIN_H, cache: true, draw: (ctx) => ctx.drawImage(bake, Math.round(offset), 0) });\n const a = new ex.Actor({ pos: ex.vec(trainLeft(engine, u), trainY), width: w, height: METRO_TRAIN_H, anchor: ex.vec(0, 0), z: Z.vehicle });\n a.graphics.use(cv);\n engine.engine.add(a);\n const shift = (next: number): void => {\n if (next === offset) return;\n offset = next;\n cv.flagDirty();\n };\n engine.trainActors.push({ actor: a, u, w, shift, line, stop });\n addPortals(engine, u, trainY);\n}\n\n/** The tunnel along the stations' bottom story, over the tile `spans` from\n * `tunnelSpans`. Tiles are phase-aligned to the world x so every span carries\n * the same pattern, each under the texture-size limit. */\nfunction addTunnel(engine: TowerEngine, floor: number, spans: readonly [number, number][]): void {\n const y = engine.worldYTop(floor);\n for (const [fromTile, toTile] of spans) {\n const [from, to] = [engine.worldX(fromTile), engine.worldX(toTile)];\n for (let x = from; x < to; ) {\n const tileStart = Math.floor(x / METRO_TUNNEL_TILE) * METRO_TUNNEL_TILE;\n const end = Math.min(tileStart + METRO_TUNNEL_TILE, to);\n const w = end - x;\n const phase = x - tileStart;\n const cv = new ex.Canvas({\n width: w,\n height: FLOOR,\n cache: true,\n draw: (ctx) => {\n ctx.translate(-phase, 0);\n drawMetroTunnel(ctx);\n },\n });\n const a = new ex.Actor({ pos: ex.vec(x, y), width: w, height: FLOOR, anchor: ex.vec(0, 0), z: Z.structure });\n a.graphics.use(cv);\n engine.engine.add(a);\n engine.tunnelActors.push(a);\n x = end;\n }\n }\n}\n\n/** A dark mouth at each end of the station, drawn over the train: the train\n * comes out of the dark and goes back into it. */\nfunction addPortals(engine: TowerEngine, u: UnitView, trainY: number): void {\n const h = METRO_TRAIN_H + 3;\n for (const side of [\"left\", \"right\"] as const) {\n const x = side === \"left\" ? engine.worldX(u.x) : engine.worldX(u.x + u.width) - METRO_PORTAL_W;\n const cv = new ex.Canvas({ width: METRO_PORTAL_W, height: h, cache: true, draw: (ctx) => drawMetroPortal(ctx, METRO_PORTAL_W, h, side) });\n const a = new ex.Actor({ pos: ex.vec(x, trainY), width: METRO_PORTAL_W, height: h, anchor: ex.vec(0, 0), z: Z.vehicle + 0.05 });\n a.graphics.use(cv);\n engine.engine.add(a);\n engine.tunnelActors.push(a);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AA4BA;;AAEmC;AAC7B,SAAU,SAAS,CAAC,MAAmB,EAAE,QAA6B,EAAA;AAC1E,IAAA,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsB;IAC1C,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,IAAI,CAAC,GAAG,CAAC,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AC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,cAAc;AAC9F,QAAA,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;QACzI,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;AAC/H,QAAA,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;AAClB,QAAA,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACpB,QAAA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7B;AACF;;"}
@@ -0,0 +1,32 @@
1
+ import type { CatalogNoise } from "../../catalog/catalogTypes";
2
+ import type { TowerView } from "../../simport/view";
3
+ import type { RingView } from "./towerHaloRings";
4
+ /**
5
+ * How far a room's same-floor noise reaches, painted on its floor while it is
6
+ * being placed (Modern, #1980): a band out from each edge as far as the
7
+ * catalog's `noise` says, stopped where the engine's scan stops, at a lobby
8
+ * tile or a gap in the floor. Violet shows where the room's own noise carries,
9
+ * amber where it hears its noisy neighbors. Classic publishes no noise reach,
10
+ * so nothing is painted there.
11
+ */
12
+ /** The tiles the walk reads: the same lookups the engine's scan makes. */
13
+ export type NoiseTiles = Pick<TowerView, "unitAt" | "hasStructure" | "structureKindAt">;
14
+ /** How many tiles out from each edge of the room at `x` (width `width`) on
15
+ * `floor` the noise can travel before a lobby or a gap, up to `limit`. One
16
+ * walk of at most `limit` tiles each way, a few binary searches per tile
17
+ * and no allocation: `unitAt` is asked only where there is no structure,
18
+ * so it finds a room or nothing and never builds a tile view. */
19
+ export declare function openTiles(tower: NoiseTiles, floor: number, x: number, width: number, limit: number): {
20
+ left: number;
21
+ right: number;
22
+ };
23
+ /** Paint `noise`'s reach around the room at `x` (width `width`) whose
24
+ * lowest floor is `floor` and which stands `floors` stories tall. Its noise
25
+ * carries on every story it fills, as the engine's scan finds a room on any
26
+ * story it covers; it hears only on its lowest, where the scan walks. */
27
+ export declare function drawNoiseReach(ctx: CanvasRenderingContext2D, noise: readonly CatalogNoise[], room: {
28
+ floor: number;
29
+ floors: number;
30
+ x: number;
31
+ width: number;
32
+ }, tower: NoiseTiles, view: RingView): void;
@@ -0,0 +1,75 @@
1
+ import { FLOOR, TILE } from '../scale.js';
2
+
3
+ /** How many tiles out from each edge of the room at `x` (width `width`) on
4
+ * `floor` the noise can travel before a lobby or a gap, up to `limit`. One
5
+ * walk of at most `limit` tiles each way, a few binary searches per tile
6
+ * and no allocation: `unitAt` is asked only where there is no structure,
7
+ * so it finds a room or nothing and never builds a tile view. */
8
+ function openTiles(tower, floor, x, width, limit) {
9
+ const walk = (start, dir) => {
10
+ let n = 0;
11
+ while (n < limit) {
12
+ const at = start + dir * n;
13
+ if (tower.structureKindAt(floor, at) === "lobby")
14
+ break;
15
+ if (!tower.hasStructure(floor, at) && !tower.unitAt(floor, at))
16
+ break;
17
+ n++;
18
+ }
19
+ return n;
20
+ };
21
+ return { left: walk(x - 1, -1), right: walk(x + width, 1) };
22
+ }
23
+ const CARRIES_COLOR = "#a46ad8";
24
+ const HEARS_COLOR = "#e0a040";
25
+ const BAND_ALPHA = 0.22;
26
+ /** Paint `noise`'s reach around the room at `x` (width `width`) whose
27
+ * lowest floor is `floor` and which stands `floors` stories tall. Its noise
28
+ * carries on every story it fills, as the engine's scan finds a room on any
29
+ * story it covers; it hears only on its lowest, where the scan walks. */
30
+ function drawNoiseReach(ctx, noise, room, tower, view) {
31
+ if (noise.length === 0)
32
+ return;
33
+ // A source `tiles` tiles out from the edge still counts, so a band spans
34
+ // `tiles + 1` tiles each way; one walk per story covers the widest of them.
35
+ let limit = 0;
36
+ for (const n of noise)
37
+ limit = Math.max(limit, n.tiles + 1);
38
+ const h = FLOOR * view.cam.zoom;
39
+ const tile = TILE * view.cam.zoom;
40
+ ctx.lineWidth = 1.5;
41
+ for (let story = 0; story < room.floors; story++) {
42
+ const floor = room.floor + story;
43
+ const felt = (n) => n.role === "carries" || story === 0;
44
+ if (!noise.some(felt))
45
+ continue;
46
+ const open = openTiles(tower, floor, room.x, room.width, limit);
47
+ const y = view.worldToScreenY(floor);
48
+ let [outerLeft, outerRight] = [0, 0];
49
+ for (const n of noise) {
50
+ if (!felt(n))
51
+ continue;
52
+ const left = Math.min(n.tiles + 1, open.left);
53
+ const right = Math.min(n.tiles + 1, open.right);
54
+ outerLeft = Math.max(outerLeft, left);
55
+ outerRight = Math.max(outerRight, right);
56
+ ctx.fillStyle = n.role === "carries" ? CARRIES_COLOR : HEARS_COLOR;
57
+ ctx.globalAlpha = BAND_ALPHA;
58
+ if (left > 0)
59
+ ctx.fillRect(view.worldToScreenX(room.x - left), y, left * tile, h);
60
+ if (right > 0)
61
+ ctx.fillRect(view.worldToScreenX(room.x + room.width), y, right * tile, h);
62
+ }
63
+ ctx.globalAlpha = 1;
64
+ if (outerLeft + outerRight === 0)
65
+ continue;
66
+ ctx.strokeStyle = noise.some((n) => felt(n) && n.role === "carries") ? CARRIES_COLOR : HEARS_COLOR;
67
+ ctx.setLineDash([6, 4]);
68
+ const from = view.worldToScreenX(room.x - outerLeft);
69
+ ctx.strokeRect(from + 0.5, y + 0.5, (outerLeft + room.width + outerRight) * tile - 1, h - 1);
70
+ ctx.setLineDash([]);
71
+ }
72
+ }
73
+
74
+ export { drawNoiseReach, openTiles };
75
+ //# sourceMappingURL=towerNoiseReach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"towerNoiseReach.js","sources":["../../../src/render/excalibur/towerNoiseReach.ts"],"sourcesContent":["import type { CatalogNoise } from \"../../catalog/catalogTypes\";\nimport type { TowerView } from \"../../simport/view\";\nimport { FLOOR, TILE } from \"../scale\";\nimport type { RingView } from \"./towerHaloRings\";\n\n/**\n * How far a room's same-floor noise reaches, painted on its floor while it is\n * being placed (Modern, #1980): a band out from each edge as far as the\n * catalog's `noise` says, stopped where the engine's scan stops, at a lobby\n * tile or a gap in the floor. Violet shows where the room's own noise carries,\n * amber where it hears its noisy neighbors. Classic publishes no noise reach,\n * so nothing is painted there.\n */\n\n/** The tiles the walk reads: the same lookups the engine's scan makes. */\nexport type NoiseTiles = Pick<TowerView, \"unitAt\" | \"hasStructure\" | \"structureKindAt\">;\n\n/** How many tiles out from each edge of the room at `x` (width `width`) on\n * `floor` the noise can travel before a lobby or a gap, up to `limit`. One\n * walk of at most `limit` tiles each way, a few binary searches per tile\n * and no allocation: `unitAt` is asked only where there is no structure,\n * so it finds a room or nothing and never builds a tile view. */\nexport function openTiles(tower: NoiseTiles, floor: number, x: number, width: number, limit: number): { left: number; right: number } {\n const walk = (start: number, dir: -1 | 1): number => {\n let n = 0;\n while (n < limit) {\n const at = start + dir * n;\n if (tower.structureKindAt(floor, at) === \"lobby\") break;\n if (!tower.hasStructure(floor, at) && !tower.unitAt(floor, at)) break;\n n++;\n }\n return n;\n };\n return { left: walk(x - 1, -1), right: walk(x + width, 1) };\n}\n\nconst CARRIES_COLOR = \"#a46ad8\";\nconst HEARS_COLOR = \"#e0a040\";\nconst BAND_ALPHA = 0.22;\n\n/** Paint `noise`'s reach around the room at `x` (width `width`) whose\n * lowest floor is `floor` and which stands `floors` stories tall. Its noise\n * carries on every story it fills, as the engine's scan finds a room on any\n * story it covers; it hears only on its lowest, where the scan walks. */\nexport function drawNoiseReach(\n ctx: CanvasRenderingContext2D,\n noise: readonly CatalogNoise[],\n room: { floor: number; floors: number; x: number; width: number },\n tower: NoiseTiles,\n view: RingView,\n): void {\n if (noise.length === 0) return;\n // A source `tiles` tiles out from the edge still counts, so a band spans\n // `tiles + 1` tiles each way; one walk per story covers the widest of them.\n let limit = 0;\n for (const n of noise) limit = Math.max(limit, n.tiles + 1);\n const h = FLOOR * view.cam.zoom;\n const tile = TILE * view.cam.zoom;\n ctx.lineWidth = 1.5;\n for (let story = 0; story < room.floors; story++) {\n const floor = room.floor + story;\n const felt = (n: CatalogNoise): boolean => n.role === \"carries\" || story === 0;\n if (!noise.some(felt)) continue;\n const open = openTiles(tower, floor, room.x, room.width, limit);\n const y = view.worldToScreenY(floor);\n let [outerLeft, outerRight] = [0, 0];\n for (const n of noise) {\n if (!felt(n)) continue;\n const left = Math.min(n.tiles + 1, open.left);\n const right = Math.min(n.tiles + 1, open.right);\n outerLeft = Math.max(outerLeft, left);\n outerRight = Math.max(outerRight, right);\n ctx.fillStyle = n.role === \"carries\" ? CARRIES_COLOR : HEARS_COLOR;\n ctx.globalAlpha = BAND_ALPHA;\n if (left > 0) ctx.fillRect(view.worldToScreenX(room.x - left), y, left * tile, h);\n if (right > 0) ctx.fillRect(view.worldToScreenX(room.x + room.width), y, right * tile, h);\n }\n ctx.globalAlpha = 1;\n if (outerLeft + outerRight === 0) continue;\n ctx.strokeStyle = noise.some((n) => felt(n) && n.role === \"carries\") ? CARRIES_COLOR : HEARS_COLOR;\n ctx.setLineDash([6, 4]);\n const from = view.worldToScreenX(room.x - outerLeft);\n ctx.strokeRect(from + 0.5, y + 0.5, (outerLeft + room.width + outerRight) * tile - 1, h - 1);\n ctx.setLineDash([]);\n }\n}\n"],"names":[],"mappings":";;AAiBA;;;;AAIkE;AAC5D,SAAU,SAAS,CAAC,KAAiB,EAAE,KAAa,EAAE,CAAS,EAAE,KAAa,EAAE,KAAa,EAAA;AACjG,IAAA,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,GA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Ac,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;YACjF,IAAI,KAAK,GAAG,CAAC;gBAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAC3F;AACA,QAAA,GAAG,CAAC,WAAW,GAAG,CAAC;AACnB,QAAA,IAAI,SAAS,GAAG,UAAU,KAAK,CAAC;YAAE;AAClC,QAAA,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,GAAG,aAAa,GAAG,WAAW;QAClG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;AACpD,QAAA,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,UAAU,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAC5F,QAAA,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;IACrB;AACF;;"}
@@ -0,0 +1,59 @@
1
+ import type { TowerEngine } from "./TowerEngine";
2
+ import { floorRoomSpan, thiefX } from "./thiefSpan";
3
+ import { guardPosition } from "./guardPosition";
4
+ export { guardPosition, floorRoomSpan, thiefX };
5
+ /**
6
+ * The 2D canvas overlay and sky painters for {@link TowerEngine}, plus the
7
+ * decorative event-visual bookkeeping (syncEventFx) and the sky-color helper.
8
+ * Every painter takes the engine instance and reads its live state. Extracted
9
+ * from `TowerEngine.ts`; the class keeps thin delegations. This is a pure code
10
+ * move: the drawing math, ordering and Excalibur/canvas calls are unchanged.
11
+ */
12
+ /** How long Santa takes to cross the sky, and how long a bomb flash lingers
13
+ * (seconds of the decorative anim clock, so both freeze under pause /
14
+ * reduced motion, like every other decoration). */
15
+ export declare const SANTA_FLIGHT_SECONDS = 7;
16
+ export declare const EXPLOSION_SECONDS = 0.9;
17
+ export declare const THIEF_RUN_SECONDS = 4;
18
+ export declare const TREASURE_SECONDS = 1.8;
19
+ export declare const VIP_VISIT_SECONDS = 6.5;
20
+ /** Hard cap on simultaneous flashes/sparkles, the events are rare, but never
21
+ * let the lists grow unbounded (immediate-mode draws, no actors, so this is the
22
+ * only bound needed). */
23
+ export declare const MAX_EXPLOSIONS = 8;
24
+ export declare const MAX_TREASURES = 6;
25
+ export declare function setReducedMotion(engine: TowerEngine, on: boolean): void;
26
+ /** End the event visuals an undo or redo step left over empty space: a blast
27
+ * or a treasure dig on a spot with no room and no floor now, and a thief on a
28
+ * floor above or below the tower. Santa and the VIP limo belong to the whole
29
+ * tower (the sky and the ground lobby), so they fly on. */
30
+ export declare function dropStrandedFx(engine: TowerEngine): void;
31
+ /** Reset the decorative animation clock to zero. Used by the screenshot
32
+ * generator right after it swaps in a manually stepped clock, so the
33
+ * decorations start from a known phase (the pre-swap boot accumulated a
34
+ * wall-time-dependent amount) and every capture is reproducible. */
35
+ export declare function resetDecorativeClock(engine: TowerEngine): void;
36
+ /**
37
+ * Poll the sim's cosmetic fx counters and start/retire the matching event
38
+ * visuals. New visuals only begin while animating (reduced motion / pause
39
+ * suppress fresh motion, matching every other decoration); in-flight ones
40
+ * retire when their window on the anim clock elapses. No Excalibur actors are
41
+ * involved, these are immediate-mode draws, so there is nothing to leak.
42
+ */
43
+ export declare function syncEventFx(engine: TowerEngine, animating: boolean): void;
44
+ export declare function drawOverlay(engine: TowerEngine, ctx: CanvasRenderingContext2D): void;
45
+ /** The countdown text: hours and minutes of game time left. */
46
+ export declare function bombCountdownText(minutesLeft: number): string;
47
+ /** How strong the red glow at the screen's edges is during a bomb search:
48
+ * one slow beat a second (in step with the tick), stronger in the last game
49
+ * hour. Under reduced motion it holds steady, never beating. Far below any
50
+ * flash threshold: one soft beat a second at low contrast. */
51
+ export declare function bombPulseAlpha(animSeconds: number, minutesLeft: number, reducedMotion: boolean): number;
52
+ /** The size a figure walking a floor (a search guard, a thief) is drawn at:
53
+ * the camera zoom, as the crowd is. A {@link FLOOR}-pixel floor is taller
54
+ * than the figure (`FIGURE_HEIGHT` in the sprites), so it stays inside its
55
+ * floor at every zoom; a fixed minimum once drew guards floors tall. */
56
+ export declare function floorFigureScale(zoom: number): number;
57
+ /** Rain falls on the open sky on rainy days (overlay layer), never on the
58
+ * building or below the ground (#638). */
59
+ export declare function drawRain(engine: TowerEngine, ctx: CanvasRenderingContext2D): void;