@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.
- package/ASSETS-LICENSE.md +49 -0
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/lib/audio/Audio.d.ts +110 -0
- package/lib/audio/Audio.js +199 -0
- package/lib/audio/Audio.js.map +1 -0
- package/lib/audio/ToneAudioEngine.d.ts +125 -0
- package/lib/audio/ToneAudioEngine.js +452 -0
- package/lib/audio/ToneAudioEngine.js.map +1 -0
- package/lib/audio/audioAssets.d.ts +25 -0
- package/lib/audio/audioAssets.js +28 -0
- package/lib/audio/audioAssets.js.map +1 -0
- package/lib/audio/awayWatch.d.ts +17 -0
- package/lib/audio/awayWatch.js +33 -0
- package/lib/audio/awayWatch.js.map +1 -0
- package/lib/audio/firstCueLatch.d.ts +18 -0
- package/lib/audio/firstCueLatch.js +34 -0
- package/lib/audio/firstCueLatch.js.map +1 -0
- package/lib/audio/lightEnvelope.d.ts +64 -0
- package/lib/audio/lightEnvelope.js +124 -0
- package/lib/audio/lightEnvelope.js.map +1 -0
- package/lib/audio/lightSynth.d.ts +125 -0
- package/lib/audio/lightSynth.js +203 -0
- package/lib/audio/lightSynth.js.map +1 -0
- package/lib/audio/toneContext.d.ts +30 -0
- package/lib/audio/toneContext.js +79 -0
- package/lib/audio/toneContext.js.map +1 -0
- package/lib/audio/toneCrowd.d.ts +62 -0
- package/lib/audio/toneCrowd.js +429 -0
- package/lib/audio/toneCrowd.js.map +1 -0
- package/lib/audio/toneCrowdData.d.ts +144 -0
- package/lib/audio/toneCrowdData.js +317 -0
- package/lib/audio/toneCrowdData.js.map +1 -0
- package/lib/audio/toneCrowdPrograms.d.ts +71 -0
- package/lib/audio/toneCrowdPrograms.js +273 -0
- package/lib/audio/toneCrowdPrograms.js.map +1 -0
- package/lib/audio/toneCrowdVoices.d.ts +49 -0
- package/lib/audio/toneCrowdVoices.js +212 -0
- package/lib/audio/toneCrowdVoices.js.map +1 -0
- package/lib/audio/toneMusicVoices.d.ts +11 -0
- package/lib/audio/toneMusicVoices.js +31 -0
- package/lib/audio/toneMusicVoices.js.map +1 -0
- package/lib/audio/tonePercussion.d.ts +45 -0
- package/lib/audio/tonePercussion.js +97 -0
- package/lib/audio/tonePercussion.js.map +1 -0
- package/lib/audio/toneRain.d.ts +23 -0
- package/lib/audio/toneRain.js +39 -0
- package/lib/audio/toneRain.js.map +1 -0
- package/lib/audio/toneRecordingMock.d.ts +89 -0
- package/lib/audio/toneRecordingMock.js +145 -0
- package/lib/audio/toneRecordingMock.js.map +1 -0
- package/lib/audio/toneRoomTone.d.ts +11 -0
- package/lib/audio/toneRoomTone.js +27 -0
- package/lib/audio/toneRoomTone.js.map +1 -0
- package/lib/audio/toneScenes.d.ts +57 -0
- package/lib/audio/toneScenes.js +208 -0
- package/lib/audio/toneScenes.js.map +1 -0
- package/lib/audio/toneTracks.d.ts +50 -0
- package/lib/audio/toneTracks.js +356 -0
- package/lib/audio/toneTracks.js.map +1 -0
- package/lib/audio/toneVoices.d.ts +57 -0
- package/lib/audio/toneVoices.js +208 -0
- package/lib/audio/toneVoices.js.map +1 -0
- package/lib/catalog/catalogTypes.d.ts +428 -0
- package/lib/catalog/catalogTypes.js +102 -0
- package/lib/catalog/catalogTypes.js.map +1 -0
- package/lib/catalog/skyBridgeTypes.d.ts +25 -0
- package/lib/catalog/skyBridgeTypes.js +7 -0
- package/lib/catalog/skyBridgeTypes.js.map +1 -0
- package/lib/catalog/starDutyTypes.d.ts +22 -0
- package/lib/catalog/starDutyTypes.js +7 -0
- package/lib/catalog/starDutyTypes.js.map +1 -0
- package/lib/catalog/towerCatalog.d.ts +32 -0
- package/lib/catalog/towerCatalog.js +44 -0
- package/lib/catalog/towerCatalog.js.map +1 -0
- package/lib/engineBinding/binding.d.ts +36 -0
- package/lib/engineBinding/binding.js +90 -0
- package/lib/engineBinding/binding.js.map +1 -0
- package/lib/engineBinding/catalog.d.ts +24 -0
- package/lib/engineBinding/catalog.js +267 -0
- package/lib/engineBinding/catalog.js.map +1 -0
- package/lib/engineBinding/engine.d.ts +866 -0
- package/lib/engineBinding/exportTiers.d.ts +289 -0
- package/lib/engineBinding/exportTiers.js +283 -0
- package/lib/engineBinding/exportTiers.js.map +1 -0
- package/lib/engineBinding/toolingMethods.d.ts +12 -0
- package/lib/engineBinding/toolingMethods.js +20 -0
- package/lib/engineBinding/toolingMethods.js.map +1 -0
- package/lib/events/gameplayCatalog.d.ts +57 -0
- package/lib/events/gameplayCatalog.js +214 -0
- package/lib/events/gameplayCatalog.js.map +1 -0
- package/lib/events/gameplayEventRules.d.ts +4 -0
- package/lib/events/gameplayEventRules.js +32 -0
- package/lib/events/gameplayEventRules.js.map +1 -0
- package/lib/events/gameplayEvents.d.ts +284 -0
- package/lib/presentation/clockText.d.ts +28 -0
- package/lib/presentation/clockText.js +38 -0
- package/lib/presentation/clockText.js.map +1 -0
- package/lib/presentation/facilityPresentation.d.ts +20 -0
- package/lib/presentation/facilityPresentation.js +164 -0
- package/lib/presentation/facilityPresentation.js.map +1 -0
- package/lib/presentation/statsCopy.d.ts +20 -0
- package/lib/presentation/statsCopy.js +37 -0
- package/lib/presentation/statsCopy.js.map +1 -0
- package/lib/presentation/traffic.d.ts +75 -0
- package/lib/presentation/traffic.js +79 -0
- package/lib/presentation/traffic.js.map +1 -0
- package/lib/presentation/viewKinds.d.ts +33 -0
- package/lib/presentation/viewKinds.js +88 -0
- package/lib/presentation/viewKinds.js.map +1 -0
- package/lib/presentation/viewWorld.d.ts +29 -0
- package/lib/presentation/viewWorld.js +31 -0
- package/lib/presentation/viewWorld.js.map +1 -0
- package/lib/render/atlas/archive.d.ts +78 -0
- package/lib/render/atlas/archive.js +427 -0
- package/lib/render/atlas/archive.js.map +1 -0
- package/lib/render/atlas/bake.d.ts +132 -0
- package/lib/render/atlas/bake.js +331 -0
- package/lib/render/atlas/bake.js.map +1 -0
- package/lib/render/atlas/bakeAdditions.d.ts +24 -0
- package/lib/render/atlas/bakeAdditions.js +46 -0
- package/lib/render/atlas/bakeAdditions.js.map +1 -0
- package/lib/render/atlas/browserEntry.d.ts +12 -0
- package/lib/render/atlas/browserEntry.js +222 -0
- package/lib/render/atlas/browserEntry.js.map +1 -0
- package/lib/render/atlas/catalog.d.ts +118 -0
- package/lib/render/atlas/catalog.js +253 -0
- package/lib/render/atlas/catalog.js.map +1 -0
- package/lib/render/atlas/catalogExtras.d.ts +45 -0
- package/lib/render/atlas/catalogExtras.js +217 -0
- package/lib/render/atlas/catalogExtras.js.map +1 -0
- package/lib/render/atlas/compose.d.ts +30 -0
- package/lib/render/atlas/compose.js +125 -0
- package/lib/render/atlas/compose.js.map +1 -0
- package/lib/render/atlas/cycles.d.ts +25 -0
- package/lib/render/atlas/cycles.js +41 -0
- package/lib/render/atlas/cycles.js.map +1 -0
- package/lib/render/atlas/lookup.d.ts +65 -0
- package/lib/render/atlas/lookup.js +83 -0
- package/lib/render/atlas/lookup.js.map +1 -0
- package/lib/render/atlas/pack.d.ts +23 -0
- package/lib/render/atlas/pack.js +50 -0
- package/lib/render/atlas/pack.js.map +1 -0
- package/lib/render/atlas/paint.d.ts +120 -0
- package/lib/render/atlas/paint.js +154 -0
- package/lib/render/atlas/paint.js.map +1 -0
- package/lib/render/atlas/pixels.d.ts +46 -0
- package/lib/render/atlas/pixels.js +158 -0
- package/lib/render/atlas/pixels.js.map +1 -0
- package/lib/render/atlas/png.d.ts +3 -0
- package/lib/render/atlas/png.js +102 -0
- package/lib/render/atlas/png.js.map +1 -0
- package/lib/render/atlas/raster.d.ts +34 -0
- package/lib/render/atlas/raster.js +114 -0
- package/lib/render/atlas/raster.js.map +1 -0
- package/lib/render/atlas/recyclingFill.d.ts +5 -0
- package/lib/render/atlas/recyclingFill.js +65 -0
- package/lib/render/atlas/recyclingFill.js.map +1 -0
- package/lib/render/atlas/samples.d.ts +24 -0
- package/lib/render/atlas/samples.js +75 -0
- package/lib/render/atlas/samples.js.map +1 -0
- package/lib/render/atlas/scenery.d.ts +230 -0
- package/lib/render/atlas/scenery.js +242 -0
- package/lib/render/atlas/scenery.js.map +1 -0
- package/lib/render/atlas/schema.d.ts +189 -0
- package/lib/render/atlas/schema.js +31 -0
- package/lib/render/atlas/schema.js.map +1 -0
- package/lib/render/atlas/shellMarks.d.ts +16 -0
- package/lib/render/atlas/shellMarks.js +72 -0
- package/lib/render/atlas/shellMarks.js.map +1 -0
- package/lib/render/atlas/store.d.ts +75 -0
- package/lib/render/atlas/store.js +127 -0
- package/lib/render/atlas/store.js.map +1 -0
- package/lib/render/atlas/verify.d.ts +43 -0
- package/lib/render/atlas/verify.js +87 -0
- package/lib/render/atlas/verify.js.map +1 -0
- package/lib/render/atlas/verifyExtras.d.ts +19 -0
- package/lib/render/atlas/verifyExtras.js +310 -0
- package/lib/render/atlas/verifyExtras.js.map +1 -0
- package/lib/render/cameraBounds.d.ts +71 -0
- package/lib/render/cameraBounds.js +107 -0
- package/lib/render/cameraBounds.js.map +1 -0
- package/lib/render/carIndicator.d.ts +41 -0
- package/lib/render/carIndicator.js +45 -0
- package/lib/render/carIndicator.js.map +1 -0
- package/lib/render/carMotion.d.ts +33 -0
- package/lib/render/carMotion.js +42 -0
- package/lib/render/carMotion.js.map +1 -0
- package/lib/render/catalogScale.d.ts +40 -0
- package/lib/render/catalogScale.js +33 -0
- package/lib/render/catalogScale.js.map +1 -0
- package/lib/render/climbPath.d.ts +59 -0
- package/lib/render/climbPath.js +115 -0
- package/lib/render/climbPath.js.map +1 -0
- package/lib/render/depthPlanes.d.ts +55 -0
- package/lib/render/depthPlanes.js +58 -0
- package/lib/render/depthPlanes.js.map +1 -0
- package/lib/render/excalibur/TowerEngine.d.ts +348 -0
- package/lib/render/excalibur/TowerEngine.js +415 -0
- package/lib/render/excalibur/TowerEngine.js.map +1 -0
- package/lib/render/excalibur/cabGraphics.d.ts +75 -0
- package/lib/render/excalibur/cabGraphics.js +108 -0
- package/lib/render/excalibur/cabGraphics.js.map +1 -0
- package/lib/render/excalibur/cabParts.d.ts +32 -0
- package/lib/render/excalibur/cabParts.js +79 -0
- package/lib/render/excalibur/cabParts.js.map +1 -0
- package/lib/render/excalibur/cabRiders.d.ts +72 -0
- package/lib/render/excalibur/cabRiders.js +176 -0
- package/lib/render/excalibur/cabRiders.js.map +1 -0
- package/lib/render/excalibur/crowdCull.d.ts +34 -0
- package/lib/render/excalibur/crowdCull.js +72 -0
- package/lib/render/excalibur/crowdCull.js.map +1 -0
- package/lib/render/excalibur/crowdFigure.d.ts +42 -0
- package/lib/render/excalibur/crowdFigure.js +99 -0
- package/lib/render/excalibur/crowdFigure.js.map +1 -0
- package/lib/render/excalibur/crowdLook.d.ts +137 -0
- package/lib/render/excalibur/crowdLook.js +186 -0
- package/lib/render/excalibur/crowdLook.js.map +1 -0
- package/lib/render/excalibur/frameHold.d.ts +23 -0
- package/lib/render/excalibur/frameHold.js +30 -0
- package/lib/render/excalibur/frameHold.js.map +1 -0
- package/lib/render/excalibur/guardPosition.d.ts +17 -0
- package/lib/render/excalibur/guardPosition.js +37 -0
- package/lib/render/excalibur/guardPosition.js.map +1 -0
- package/lib/render/excalibur/keyboardHost.d.ts +15 -0
- package/lib/render/excalibur/keyboardHost.js +22 -0
- package/lib/render/excalibur/keyboardHost.js.map +1 -0
- package/lib/render/excalibur/longPress.d.ts +16 -0
- package/lib/render/excalibur/longPress.js +71 -0
- package/lib/render/excalibur/longPress.js.map +1 -0
- package/lib/render/excalibur/peopleGfx.d.ts +16 -0
- package/lib/render/excalibur/peopleGfx.js +46 -0
- package/lib/render/excalibur/peopleGfx.js.map +1 -0
- package/lib/render/excalibur/peopleWindow.d.ts +35 -0
- package/lib/render/excalibur/peopleWindow.js +38 -0
- package/lib/render/excalibur/peopleWindow.js.map +1 -0
- package/lib/render/excalibur/personFocus.d.ts +36 -0
- package/lib/render/excalibur/personFocus.js +169 -0
- package/lib/render/excalibur/personFocus.js.map +1 -0
- package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
- package/lib/render/excalibur/pointerButtonGuard.js +86 -0
- package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
- package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
- package/lib/render/excalibur/pressLifecycle.js +66 -0
- package/lib/render/excalibur/pressLifecycle.js.map +1 -0
- package/lib/render/excalibur/rainShelter.d.ts +16 -0
- package/lib/render/excalibur/rainShelter.js +94 -0
- package/lib/render/excalibur/rainShelter.js.map +1 -0
- package/lib/render/excalibur/roomSignature.d.ts +30 -0
- package/lib/render/excalibur/roomSignature.js +49 -0
- package/lib/render/excalibur/roomSignature.js.map +1 -0
- package/lib/render/excalibur/sceneBake.d.ts +9 -0
- package/lib/render/excalibur/sceneBake.js +12 -0
- package/lib/render/excalibur/sceneBake.js.map +1 -0
- package/lib/render/excalibur/thiefSpan.d.ts +18 -0
- package/lib/render/excalibur/thiefSpan.js +51 -0
- package/lib/render/excalibur/thiefSpan.js.map +1 -0
- package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
- package/lib/render/excalibur/towerBridgeTiles.js +43 -0
- package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
- package/lib/render/excalibur/towerCrowd.d.ts +73 -0
- package/lib/render/excalibur/towerCrowd.js +464 -0
- package/lib/render/excalibur/towerCrowd.js.map +1 -0
- package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
- package/lib/render/excalibur/towerCrowdLayout.js +77 -0
- package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
- package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
- package/lib/render/excalibur/towerFireResponse.js +89 -0
- package/lib/render/excalibur/towerFireResponse.js.map +1 -0
- package/lib/render/excalibur/towerFrame.d.ts +8 -0
- package/lib/render/excalibur/towerFrame.js +57 -0
- package/lib/render/excalibur/towerFrame.js.map +1 -0
- package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
- package/lib/render/excalibur/towerGhostLabel.js +37 -0
- package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
- package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
- package/lib/render/excalibur/towerHallDoors.js +129 -0
- package/lib/render/excalibur/towerHallDoors.js.map +1 -0
- package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
- package/lib/render/excalibur/towerHaloRings.js +45 -0
- package/lib/render/excalibur/towerHaloRings.js.map +1 -0
- package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
- package/lib/render/excalibur/towerInputCamera.js +480 -0
- package/lib/render/excalibur/towerInputCamera.js.map +1 -0
- package/lib/render/excalibur/towerMetro.d.ts +31 -0
- package/lib/render/excalibur/towerMetro.js +115 -0
- package/lib/render/excalibur/towerMetro.js.map +1 -0
- package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
- package/lib/render/excalibur/towerNoiseReach.js +75 -0
- package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
- package/lib/render/excalibur/towerOverlay.d.ts +59 -0
- package/lib/render/excalibur/towerOverlay.js +453 -0
- package/lib/render/excalibur/towerOverlay.js.map +1 -0
- package/lib/render/excalibur/towerReconcile.d.ts +17 -0
- package/lib/render/excalibur/towerReconcile.js +404 -0
- package/lib/render/excalibur/towerReconcile.js.map +1 -0
- package/lib/render/excalibur/towerRegions.d.ts +61 -0
- package/lib/render/excalibur/towerRegions.js +193 -0
- package/lib/render/excalibur/towerRegions.js.map +1 -0
- package/lib/render/excalibur/towerScene.d.ts +66 -0
- package/lib/render/excalibur/towerScene.js +443 -0
- package/lib/render/excalibur/towerScene.js.map +1 -0
- package/lib/render/excalibur/towerScenery.d.ts +12 -0
- package/lib/render/excalibur/towerScenery.js +299 -0
- package/lib/render/excalibur/towerScenery.js.map +1 -0
- package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
- package/lib/render/excalibur/towerSceneryDraw.js +288 -0
- package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
- package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
- package/lib/render/excalibur/towerShaftNumbers.js +90 -0
- package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
- package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
- package/lib/render/excalibur/towerStructTiles.js +238 -0
- package/lib/render/excalibur/towerStructTiles.js.map +1 -0
- package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
- package/lib/render/excalibur/towerSyncSchedule.js +137 -0
- package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
- package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
- package/lib/render/excalibur/towerWalkerBuild.js +126 -0
- package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
- package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
- package/lib/render/excalibur/trafficSpotlight.js +64 -0
- package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
- package/lib/render/facadeGeometry.d.ts +50 -0
- package/lib/render/facadeGeometry.js +79 -0
- package/lib/render/facadeGeometry.js.map +1 -0
- package/lib/render/groundEntrances.d.ts +44 -0
- package/lib/render/groundEntrances.js +118 -0
- package/lib/render/groundEntrances.js.map +1 -0
- package/lib/render/lateNight.d.ts +14 -0
- package/lib/render/lateNight.js +18 -0
- package/lib/render/lateNight.js.map +1 -0
- package/lib/render/lobbyHalls.d.ts +44 -0
- package/lib/render/lobbyHalls.js +63 -0
- package/lib/render/lobbyHalls.js.map +1 -0
- package/lib/render/metroTrainSchedule.d.ts +20 -0
- package/lib/render/metroTrainSchedule.js +65 -0
- package/lib/render/metroTrainSchedule.js.map +1 -0
- package/lib/render/overviewMap/drawList.d.ts +67 -0
- package/lib/render/overviewMap/drawList.js +103 -0
- package/lib/render/overviewMap/drawList.js.map +1 -0
- package/lib/render/overviewMap/extent.d.ts +70 -0
- package/lib/render/overviewMap/extent.js +155 -0
- package/lib/render/overviewMap/extent.js.map +1 -0
- package/lib/render/overviewMap/floorSpans.d.ts +27 -0
- package/lib/render/overviewMap/floorSpans.js +32 -0
- package/lib/render/overviewMap/floorSpans.js.map +1 -0
- package/lib/render/overviewMap/gaps.d.ts +48 -0
- package/lib/render/overviewMap/gaps.js +148 -0
- package/lib/render/overviewMap/gaps.js.map +1 -0
- package/lib/render/overviewMap/geometry.d.ts +139 -0
- package/lib/render/overviewMap/geometry.js +245 -0
- package/lib/render/overviewMap/geometry.js.map +1 -0
- package/lib/render/overviewMap/heatView.d.ts +91 -0
- package/lib/render/overviewMap/heatView.js +143 -0
- package/lib/render/overviewMap/heatView.js.map +1 -0
- package/lib/render/overviewMap/hotelView.d.ts +82 -0
- package/lib/render/overviewMap/hotelView.js +136 -0
- package/lib/render/overviewMap/hotelView.js.map +1 -0
- package/lib/render/overviewMap/model.d.ts +97 -0
- package/lib/render/overviewMap/model.js +116 -0
- package/lib/render/overviewMap/model.js.map +1 -0
- package/lib/render/overviewMap/paint.d.ts +63 -0
- package/lib/render/overviewMap/paint.js +168 -0
- package/lib/render/overviewMap/paint.js.map +1 -0
- package/lib/render/overviewMap/style.d.ts +46 -0
- package/lib/render/overviewMap/style.js +117 -0
- package/lib/render/overviewMap/style.js.map +1 -0
- package/lib/render/overviewMap/tierView.d.ts +103 -0
- package/lib/render/overviewMap/tierView.js +209 -0
- package/lib/render/overviewMap/tierView.js.map +1 -0
- package/lib/render/overviewMap/viewMark.d.ts +69 -0
- package/lib/render/overviewMap/viewMark.js +103 -0
- package/lib/render/overviewMap/viewMark.js.map +1 -0
- package/lib/render/overviewMap/views.d.ts +24 -0
- package/lib/render/overviewMap/views.js +29 -0
- package/lib/render/overviewMap/views.js.map +1 -0
- package/lib/render/pinchTracker.d.ts +91 -0
- package/lib/render/pinchTracker.js +145 -0
- package/lib/render/pinchTracker.js.map +1 -0
- package/lib/render/pixelSprites/amusements.d.ts +32 -0
- package/lib/render/pixelSprites/amusements.js +243 -0
- package/lib/render/pixelSprites/amusements.js.map +1 -0
- package/lib/render/pixelSprites/artScale.d.ts +97 -0
- package/lib/render/pixelSprites/artScale.js +151 -0
- package/lib/render/pixelSprites/artScale.js.map +1 -0
- package/lib/render/pixelSprites/boutique.d.ts +30 -0
- package/lib/render/pixelSprites/boutique.js +244 -0
- package/lib/render/pixelSprites/boutique.js.map +1 -0
- package/lib/render/pixelSprites/clinic.d.ts +30 -0
- package/lib/render/pixelSprites/clinic.js +184 -0
- package/lib/render/pixelSprites/clinic.js.map +1 -0
- package/lib/render/pixelSprites/common.d.ts +185 -0
- package/lib/render/pixelSprites/common.js +449 -0
- package/lib/render/pixelSprites/common.js.map +1 -0
- package/lib/render/pixelSprites/daycare.d.ts +3 -0
- package/lib/render/pixelSprites/daycare.js +99 -0
- package/lib/render/pixelSprites/daycare.js.map +1 -0
- package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
- package/lib/render/pixelSprites/dollhouse.js +110 -0
- package/lib/render/pixelSprites/dollhouse.js.map +1 -0
- package/lib/render/pixelSprites/fitness.d.ts +30 -0
- package/lib/render/pixelSprites/fitness.js +176 -0
- package/lib/render/pixelSprites/fitness.js.map +1 -0
- package/lib/render/pixelSprites/food.d.ts +27 -0
- package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
- package/lib/render/pixelSprites/food.interiors.js +516 -0
- package/lib/render/pixelSprites/food.interiors.js.map +1 -0
- package/lib/render/pixelSprites/food.js +36 -0
- package/lib/render/pixelSprites/food.js.map +1 -0
- package/lib/render/pixelSprites/food.kit.d.ts +50 -0
- package/lib/render/pixelSprites/food.kit.js +140 -0
- package/lib/render/pixelSprites/food.kit.js.map +1 -0
- package/lib/render/pixelSprites/food.looks.d.ts +45 -0
- package/lib/render/pixelSprites/food.looks.js +56 -0
- package/lib/render/pixelSprites/food.looks.js.map +1 -0
- package/lib/render/pixelSprites/layers.d.ts +49 -0
- package/lib/render/pixelSprites/layers.js +61 -0
- package/lib/render/pixelSprites/layers.js.map +1 -0
- package/lib/render/pixelSprites/nightclub.d.ts +3 -0
- package/lib/render/pixelSprites/nightclub.js +108 -0
- package/lib/render/pixelSprites/nightclub.js.map +1 -0
- package/lib/render/pixelSprites/people.d.ts +168 -0
- package/lib/render/pixelSprites/people.js +431 -0
- package/lib/render/pixelSprites/people.js.map +1 -0
- package/lib/render/pixelSprites/residential.d.ts +5 -0
- package/lib/render/pixelSprites/residential.js +506 -0
- package/lib/render/pixelSprites/residential.js.map +1 -0
- package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
- package/lib/render/pixelSprites/residential.looks.js +43 -0
- package/lib/render/pixelSprites/residential.looks.js.map +1 -0
- package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
- package/lib/render/pixelSprites/residential.roaches.js +88 -0
- package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
- package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
- package/lib/render/pixelSprites/shop.d.ts +14 -0
- package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
- package/lib/render/pixelSprites/shop.interiors.js +382 -0
- package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
- package/lib/render/pixelSprites/shop.js +72 -0
- package/lib/render/pixelSprites/shop.js.map +1 -0
- package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
- package/lib/render/pixelSprites/shop.looks.js +24 -0
- package/lib/render/pixelSprites/shop.looks.js.map +1 -0
- package/lib/render/pixelSprites/skyBar.d.ts +11 -0
- package/lib/render/pixelSprites/skyBar.js +125 -0
- package/lib/render/pixelSprites/skyBar.js.map +1 -0
- package/lib/render/pixelSprites/spa.d.ts +3 -0
- package/lib/render/pixelSprites/spa.js +88 -0
- package/lib/render/pixelSprites/spa.js.map +1 -0
- package/lib/render/pixelSprites.d.ts +33 -0
- package/lib/render/pixelSprites.js +167 -0
- package/lib/render/pixelSprites.js.map +1 -0
- package/lib/render/regionGrid.d.ts +49 -0
- package/lib/render/regionGrid.js +82 -0
- package/lib/render/regionGrid.js.map +1 -0
- package/lib/render/regionPaint.d.ts +15 -0
- package/lib/render/regionPaint.js +33 -0
- package/lib/render/regionPaint.js.map +1 -0
- package/lib/render/renderSim.d.ts +104 -0
- package/lib/render/renderSim.js +2 -0
- package/lib/render/renderSim.js.map +1 -0
- package/lib/render/roomPortrait.d.ts +35 -0
- package/lib/render/roomPortrait.js +142 -0
- package/lib/render/roomPortrait.js.map +1 -0
- package/lib/render/roomShading.d.ts +29 -0
- package/lib/render/roomShading.js +43 -0
- package/lib/render/roomShading.js.map +1 -0
- package/lib/render/scale.d.ts +31 -0
- package/lib/render/scale.js +34 -0
- package/lib/render/scale.js.map +1 -0
- package/lib/render/sceneryLayout.d.ts +234 -0
- package/lib/render/sceneryLayout.js +199 -0
- package/lib/render/sceneryLayout.js.map +1 -0
- package/lib/render/sprites/common.d.ts +41 -0
- package/lib/render/sprites/common.js +46 -0
- package/lib/render/sprites/common.js.map +1 -0
- package/lib/render/sprites/escalator.d.ts +27 -0
- package/lib/render/sprites/escalator.js +156 -0
- package/lib/render/sprites/escalator.js.map +1 -0
- package/lib/render/sprites/events.d.ts +56 -0
- package/lib/render/sprites/events.js +280 -0
- package/lib/render/sprites/events.js.map +1 -0
- package/lib/render/sprites/facilities/garage.d.ts +23 -0
- package/lib/render/sprites/facilities/garage.js +230 -0
- package/lib/render/sprites/facilities/garage.js.map +1 -0
- package/lib/render/sprites/facilities/recycling.d.ts +3 -0
- package/lib/render/sprites/facilities/recycling.js +210 -0
- package/lib/render/sprites/facilities/recycling.js.map +1 -0
- package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
- package/lib/render/sprites/facilities/recyclingLook.js +52 -0
- package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
- package/lib/render/sprites/facilities/service.d.ts +14 -0
- package/lib/render/sprites/facilities/service.js +437 -0
- package/lib/render/sprites/facilities/service.js.map +1 -0
- package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
- package/lib/render/sprites/facilities/serviceKit.js +113 -0
- package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
- package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
- package/lib/render/sprites/facilities/vehicles.js +276 -0
- package/lib/render/sprites/facilities/vehicles.js.map +1 -0
- package/lib/render/sprites/facilities/venue.d.ts +28 -0
- package/lib/render/sprites/facilities/venue.js +211 -0
- package/lib/render/sprites/facilities/venue.js.map +1 -0
- package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
- package/lib/render/sprites/facilities/weddingHall.js +410 -0
- package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
- package/lib/render/sprites/facilities.d.ts +22 -0
- package/lib/render/sprites/facilities.js +24 -0
- package/lib/render/sprites/facilities.js.map +1 -0
- package/lib/render/sprites/helicopter.d.ts +11 -0
- package/lib/render/sprites/helicopter.js +60 -0
- package/lib/render/sprites/helicopter.js.map +1 -0
- package/lib/render/sprites/sky.d.ts +67 -0
- package/lib/render/sprites/sky.js +85 -0
- package/lib/render/sprites/sky.js.map +1 -0
- package/lib/render/sprites/spiralStair.d.ts +19 -0
- package/lib/render/sprites/spiralStair.js +111 -0
- package/lib/render/sprites/spiralStair.js.map +1 -0
- package/lib/render/sprites/structure/entrance.d.ts +35 -0
- package/lib/render/sprites/structure/entrance.js +347 -0
- package/lib/render/sprites/structure/entrance.js.map +1 -0
- package/lib/render/sprites/structure/lobby.d.ts +88 -0
- package/lib/render/sprites/structure/lobby.js +350 -0
- package/lib/render/sprites/structure/lobby.js.map +1 -0
- package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
- package/lib/render/sprites/structure/revolvingDoor.js +184 -0
- package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
- package/lib/render/sprites/structure/rooftop.d.ts +93 -0
- package/lib/render/sprites/structure/rooftop.js +302 -0
- package/lib/render/sprites/structure/rooftop.js.map +1 -0
- package/lib/render/sprites/structure/shell.d.ts +19 -0
- package/lib/render/sprites/structure/shell.js +142 -0
- package/lib/render/sprites/structure/shell.js.map +1 -0
- package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
- package/lib/render/sprites/structure/skyBridge.js +259 -0
- package/lib/render/sprites/structure/skyBridge.js.map +1 -0
- package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
- package/lib/render/sprites/structure/tallLobby.js +166 -0
- package/lib/render/sprites/structure/tallLobby.js.map +1 -0
- package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
- package/lib/render/sprites/structure.d.ts +15 -0
- package/lib/render/sprites/structure.js +16 -0
- package/lib/render/sprites/structure.js.map +1 -0
- package/lib/render/sprites/transport.d.ts +30 -0
- package/lib/render/sprites/transport.js +376 -0
- package/lib/render/sprites/transport.js.map +1 -0
- package/lib/render/sprites.d.ts +16 -0
- package/lib/render/sprites.js +108 -0
- package/lib/render/sprites.js.map +1 -0
- package/lib/render/venueFlights.d.ts +61 -0
- package/lib/render/venueFlights.js +50 -0
- package/lib/render/venueFlights.js.map +1 -0
- package/lib/shared/engineTypes.d.ts +256 -0
- package/lib/shared/engineTypes.js +8 -0
- package/lib/shared/engineTypes.js.map +1 -0
- package/lib/shared/floorRuns.d.ts +22 -0
- package/lib/shared/floorRuns.js +39 -0
- package/lib/shared/floorRuns.js.map +1 -0
- package/lib/shared/inputEvents.d.ts +18 -0
- package/lib/shared/inputEvents.js +23 -0
- package/lib/shared/inputEvents.js.map +1 -0
- package/lib/shared/serializedGame.d.ts +142 -0
- package/lib/shared/serializedGame.js +2 -0
- package/lib/shared/serializedGame.js.map +1 -0
- package/lib/shared/types.d.ts +298 -0
- package/lib/shared/types.js +47 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/shared/unitState.d.ts +36 -0
- package/lib/shared/unitState.js +42 -0
- package/lib/shared/unitState.js.map +1 -0
- package/lib/shared/vacateReasonText.d.ts +20 -0
- package/lib/shared/vacateReasonText.js +23 -0
- package/lib/shared/vacateReasonText.js.map +1 -0
- package/lib/shared/viewZoom.d.ts +14 -0
- package/lib/shared/viewZoom.js +17 -0
- package/lib/shared/viewZoom.js.map +1 -0
- package/lib/shared/wellFormed.d.ts +14 -0
- package/lib/shared/wellFormed.js +19 -0
- package/lib/shared/wellFormed.js.map +1 -0
- package/lib/simport/cards.d.ts +26 -0
- package/lib/simport/cards.js +138 -0
- package/lib/simport/cards.js.map +1 -0
- package/lib/simport/clockView.d.ts +24 -0
- package/lib/simport/clockView.js +43 -0
- package/lib/simport/clockView.js.map +1 -0
- package/lib/simport/commands.d.ts +215 -0
- package/lib/simport/commands.js +2 -0
- package/lib/simport/commands.js.map +1 -0
- package/lib/simport/emergencyReads.d.ts +19 -0
- package/lib/simport/emergencyReads.js +47 -0
- package/lib/simport/emergencyReads.js.map +1 -0
- package/lib/simport/enginePort.d.ts +433 -0
- package/lib/simport/enginePort.js +11 -0
- package/lib/simport/enginePort.js.map +1 -0
- package/lib/simport/fixtures/catalog.classic.json +2137 -0
- package/lib/simport/fixtures/catalog.modern.json +2515 -0
- package/lib/simport/fixtures/viewLayout.json +927 -0
- package/lib/simport/headerClock.d.ts +31 -0
- package/lib/simport/headerClock.js +29 -0
- package/lib/simport/headerClock.js.map +1 -0
- package/lib/simport/panels.d.ts +243 -0
- package/lib/simport/panels.js +2 -0
- package/lib/simport/panels.js.map +1 -0
- package/lib/simport/personCards.d.ts +63 -0
- package/lib/simport/personCards.js +55 -0
- package/lib/simport/personCards.js.map +1 -0
- package/lib/simport/portCodes.d.ts +41 -0
- package/lib/simport/portCodes.js +49 -0
- package/lib/simport/portCodes.js.map +1 -0
- package/lib/simport/portEvents.d.ts +39 -0
- package/lib/simport/portEvents.js +43 -0
- package/lib/simport/portEvents.js.map +1 -0
- package/lib/simport/portRenderSim.d.ts +70 -0
- package/lib/simport/portRenderSim.js +129 -0
- package/lib/simport/portRenderSim.js.map +1 -0
- package/lib/simport/queries.d.ts +64 -0
- package/lib/simport/queries.js +30 -0
- package/lib/simport/queries.js.map +1 -0
- package/lib/simport/recyclingPort.d.ts +13 -0
- package/lib/simport/recyclingPort.js +2 -0
- package/lib/simport/recyclingPort.js.map +1 -0
- package/lib/simport/request.d.ts +44 -0
- package/lib/simport/request.js +214 -0
- package/lib/simport/request.js.map +1 -0
- package/lib/simport/roomTiers.d.ts +102 -0
- package/lib/simport/roomTiers.js +122 -0
- package/lib/simport/roomTiers.js.map +1 -0
- package/lib/simport/scheduleSlots.d.ts +19 -0
- package/lib/simport/scheduleSlots.js +87 -0
- package/lib/simport/scheduleSlots.js.map +1 -0
- package/lib/simport/skyBridgePort.d.ts +20 -0
- package/lib/simport/skyBridgePort.js +2 -0
- package/lib/simport/skyBridgePort.js.map +1 -0
- package/lib/simport/skyBridgeView.d.ts +15 -0
- package/lib/simport/skyBridgeView.js +42 -0
- package/lib/simport/skyBridgeView.js.map +1 -0
- package/lib/simport/statsSheet.d.ts +15 -0
- package/lib/simport/statsSheet.js +101 -0
- package/lib/simport/statsSheet.js.map +1 -0
- package/lib/simport/tdtRecords.d.ts +9 -0
- package/lib/simport/tdtRecords.js +112 -0
- package/lib/simport/tdtRecords.js.map +1 -0
- package/lib/simport/tdtReportFacts.d.ts +110 -0
- package/lib/simport/tdtReportFacts.js +8 -0
- package/lib/simport/tdtReportFacts.js.map +1 -0
- package/lib/simport/trafficPort.d.ts +22 -0
- package/lib/simport/trafficPort.js +2 -0
- package/lib/simport/trafficPort.js.map +1 -0
- package/lib/simport/view.d.ts +275 -0
- package/lib/simport/view.js +2 -0
- package/lib/simport/view.js.map +1 -0
- package/lib/simport/viewReader.d.ts +89 -0
- package/lib/simport/viewReader.js +426 -0
- package/lib/simport/viewReader.js.map +1 -0
- package/lib/styles/game/appearance.css +108 -0
- package/lib/styles/game/base.css +68 -0
- package/lib/styles/game/components.css +69 -0
- package/lib/styles/game/desk-title.css +183 -0
- package/lib/styles/game/desk.css +487 -0
- package/lib/styles/game/dialogs.css +360 -0
- package/lib/styles/game/editor-sidebar.css +116 -0
- package/lib/styles/game/elevator-schedule.css +217 -0
- package/lib/styles/game/file-dialog.css +470 -0
- package/lib/styles/game/help.css +141 -0
- package/lib/styles/game/launch-fireworks.css +17 -0
- package/lib/styles/game/media-landscape.css +333 -0
- package/lib/styles/game/media-phone.css +303 -0
- package/lib/styles/game/media-tablet-touch.css +177 -0
- package/lib/styles/game/menubar.css +158 -0
- package/lib/styles/game/new-tower.css +219 -0
- package/lib/styles/game/onboarding.css +32 -0
- package/lib/styles/game/screen-saver.css +85 -0
- package/lib/styles/game/splash.css +413 -0
- package/lib/styles/game/stats-saves.css +106 -0
- package/lib/styles/game/tools-stage.css +340 -0
- package/lib/styles/game/topbar.css +191 -0
- package/lib/styles/menu-bar.css +108 -0
- package/lib/styles/not-found.css +335 -0
- package/lib/styles/overview-map-views.css +88 -0
- package/lib/styles/overview-map.css +195 -0
- package/lib/styles/retro-components.css +179 -0
- package/lib/styles/retro-page.css +254 -0
- package/lib/styles/retro-tokens.css +122 -0
- package/lib/styles/schemes/high-contrast.css +173 -0
- package/lib/styles/schemes/skyline.css +134 -0
- package/lib/styles.css +66 -0
- package/lib/ui/desk/deskGeometry.d.ts +59 -0
- package/lib/ui/desk/deskGeometry.js +106 -0
- package/lib/ui/desk/deskGeometry.js.map +1 -0
- package/lib/ui/desk/deskWindow.d.ts +90 -0
- package/lib/ui/desk/deskWindow.js +253 -0
- package/lib/ui/desk/deskWindow.js.map +1 -0
- package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
- package/lib/ui/desk/deskWindowMenu.js +143 -0
- package/lib/ui/desk/deskWindowMenu.js.map +1 -0
- package/lib/ui/escape.d.ts +1 -0
- package/lib/ui/escape.js +14 -0
- package/lib/ui/escape.js.map +1 -0
- package/lib/ui/format.d.ts +14 -0
- package/lib/ui/format.js +36 -0
- package/lib/ui/format.js.map +1 -0
- package/lib/ui/iconPaths.generated.d.ts +4 -0
- package/lib/ui/iconPaths.generated.js +68 -0
- package/lib/ui/iconPaths.generated.js.map +1 -0
- package/lib/ui/icons.d.ts +83 -0
- package/lib/ui/icons.js +156 -0
- package/lib/ui/icons.js.map +1 -0
- package/lib/ui/menuBar.d.ts +94 -0
- package/lib/ui/menuBar.js +361 -0
- package/lib/ui/menuBar.js.map +1 -0
- package/lib/ui/modalPrecedence.d.ts +108 -0
- package/lib/ui/modalPrecedence.js +165 -0
- package/lib/ui/modalPrecedence.js.map +1 -0
- package/lib/ui/movableWindow.d.ts +124 -0
- package/lib/ui/movableWindow.js +247 -0
- package/lib/ui/movableWindow.js.map +1 -0
- package/lib/ui/overviewMapInput.d.ts +109 -0
- package/lib/ui/overviewMapInput.js +135 -0
- package/lib/ui/overviewMapInput.js.map +1 -0
- package/lib/ui/uiModal.d.ts +38 -0
- package/lib/ui/uiModal.js +70 -0
- package/lib/ui/uiModal.js.map +1 -0
- package/lib/wasmhost/buildSection.d.ts +54 -0
- package/lib/wasmhost/buildSection.js +143 -0
- package/lib/wasmhost/buildSection.js.map +1 -0
- package/lib/wasmhost/catalogCheck.d.ts +11 -0
- package/lib/wasmhost/catalogCheck.js +43 -0
- package/lib/wasmhost/catalogCheck.js.map +1 -0
- package/lib/wasmhost/engineAssets.d.ts +57 -0
- package/lib/wasmhost/engineAssets.js +63 -0
- package/lib/wasmhost/engineAssets.js.map +1 -0
- package/lib/wasmhost/engineBoot.d.ts +165 -0
- package/lib/wasmhost/engineBoot.js +254 -0
- package/lib/wasmhost/engineBoot.js.map +1 -0
- package/lib/wasmhost/engineChoice.d.ts +6 -0
- package/lib/wasmhost/engineChoice.js +2 -0
- package/lib/wasmhost/engineChoice.js.map +1 -0
- package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
- package/lib/wasmhost/engineDiagnostics.js +189 -0
- package/lib/wasmhost/engineDiagnostics.js.map +1 -0
- package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
- package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
- package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
- package/lib/wasmhost/engineIdentity.d.ts +30 -0
- package/lib/wasmhost/engineIdentity.js +59 -0
- package/lib/wasmhost/engineIdentity.js.map +1 -0
- package/lib/wasmhost/engineLabel.d.ts +40 -0
- package/lib/wasmhost/engineLabel.js +50 -0
- package/lib/wasmhost/engineLabel.js.map +1 -0
- package/lib/wasmhost/engineLoad.d.ts +48 -0
- package/lib/wasmhost/engineLoad.js +53 -0
- package/lib/wasmhost/engineLoad.js.map +1 -0
- package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
- package/lib/wasmhost/enginePackageCheck.js +274 -0
- package/lib/wasmhost/enginePackageCheck.js.map +1 -0
- package/lib/wasmhost/enginePackageNames.d.ts +25 -0
- package/lib/wasmhost/enginePackageNames.js +28 -0
- package/lib/wasmhost/enginePackageNames.js.map +1 -0
- package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
- package/lib/wasmhost/enginePackageRecord.js +108 -0
- package/lib/wasmhost/enginePackageRecord.js.map +1 -0
- package/lib/wasmhost/engineRepair.d.ts +55 -0
- package/lib/wasmhost/engineRepair.js +183 -0
- package/lib/wasmhost/engineRepair.js.map +1 -0
- package/lib/wasmhost/frameView.d.ts +87 -0
- package/lib/wasmhost/frameView.js +133 -0
- package/lib/wasmhost/frameView.js.map +1 -0
- package/lib/wasmhost/hostFault.d.ts +40 -0
- package/lib/wasmhost/hostFault.js +94 -0
- package/lib/wasmhost/hostFault.js.map +1 -0
- package/lib/wasmhost/loadEngineModule.d.ts +79 -0
- package/lib/wasmhost/loadEngineModule.js +66 -0
- package/lib/wasmhost/loadEngineModule.js.map +1 -0
- package/lib/wasmhost/packageHash.d.ts +48 -0
- package/lib/wasmhost/packageHash.js +436 -0
- package/lib/wasmhost/packageHash.js.map +1 -0
- package/lib/wasmhost/rustEngine.d.ts +49 -0
- package/lib/wasmhost/rustEngine.js +63 -0
- package/lib/wasmhost/rustEngine.js.map +1 -0
- package/lib/wasmhost/slotPopulation.d.ts +19 -0
- package/lib/wasmhost/slotPopulation.js +69 -0
- package/lib/wasmhost/slotPopulation.js.map +1 -0
- package/lib/wasmhost/telemetry.d.ts +31 -0
- package/lib/wasmhost/telemetry.js +13 -0
- package/lib/wasmhost/telemetry.js.map +1 -0
- package/package.json +80 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Asset License: CC BY 4.0
|
|
2
|
+
|
|
3
|
+
The original **visual and audio assets** of Verticopolis (the procedurally
|
|
4
|
+
drawn pixel-art sprites, the generated/procedural audio, the app icons, and the
|
|
5
|
+
committed screenshots under `docs/screenshots/`) are licensed under the
|
|
6
|
+
**Creative Commons Attribution 4.0 International License (CC BY 4.0)**.
|
|
7
|
+
|
|
8
|
+
You are free to:
|
|
9
|
+
|
|
10
|
+
- **Share**: copy and redistribute the assets in any medium or format.
|
|
11
|
+
- **Adapt**: remix, transform, and build upon them, for any purpose, even
|
|
12
|
+
commercially.
|
|
13
|
+
|
|
14
|
+
…under one condition:
|
|
15
|
+
|
|
16
|
+
- **Attribution**: you must give appropriate credit, provide a link to the
|
|
17
|
+
license, and indicate if changes were made.
|
|
18
|
+
|
|
19
|
+
Suggested attribution:
|
|
20
|
+
|
|
21
|
+
> "Verticopolis" assets by maniator
|
|
22
|
+
> (https://github.com/maniator/verticopolis), licensed under CC BY 4.0.
|
|
23
|
+
|
|
24
|
+
- Human-readable summary: https://creativecommons.org/licenses/by/4.0/
|
|
25
|
+
- Full legal code: https://creativecommons.org/licenses/by/4.0/legalcode
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Voice seed recordings
|
|
30
|
+
|
|
31
|
+
The two voice seed files under `src/public/audio/` (`voice-talk.mp3` and
|
|
32
|
+
`voice-laughs.mp3`) are original gibberish and laughter recordings made by the
|
|
33
|
+
project owner and family specifically for Verticopolis's crowd ambience. No
|
|
34
|
+
third-party material is included, no intelligible words are present, and all
|
|
35
|
+
rights are held by the project owner. They are licensed under the same
|
|
36
|
+
**CC BY 4.0** terms as the rest of the assets above.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
The project's **source code** is licensed separately under the **MIT License**;
|
|
41
|
+
see [`LICENSE`](./LICENSE).
|
|
42
|
+
|
|
43
|
+
Neither license grants any right to the **Verticopolis™** name, which is the
|
|
44
|
+
project's trademark. A copy or fork of the game is welcome under these
|
|
45
|
+
licenses, but it needs a name of its own.
|
|
46
|
+
|
|
47
|
+
Verticopolis is an unofficial, from-scratch homage to SimTower (1994). It ships
|
|
48
|
+
no assets from the original and is not affiliated with or endorsed by Maxis,
|
|
49
|
+
OPeNBooK, or Vivarium.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 maniator
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,122 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Verticopolis components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The TypeScript pieces of [Verticopolis](https://verticopolis.com) that a
|
|
4
|
+
frontend builds on: the renderer and Excalibur scene, the Win95 windows and
|
|
5
|
+
menus, the procedural sprites and audio, the engine binding and port, and the
|
|
6
|
+
WebAssembly host loader. The web game is built from them, and so can any other
|
|
7
|
+
game that runs the Verticopolis engine.
|
|
8
|
+
|
|
9
|
+
## The Verticopolis repositories
|
|
10
|
+
|
|
11
|
+
| Repository | What it holds |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| [Verticopolis/engine](https://github.com/Verticopolis/engine) | The Rust simulation engine, its WebAssembly package and the conformance lock |
|
|
14
|
+
| **[Verticopolis/components](https://github.com/Verticopolis/components)** (this one) | The renderer, windows and menus, audio, the engine binding and host |
|
|
15
|
+
| [Verticopolis/web](https://github.com/Verticopolis/web) | The web game at [verticopolis.com](https://verticopolis.com) and its player's manual |
|
|
16
|
+
|
|
17
|
+
The game depends on the engine and the components, and the components load
|
|
18
|
+
the engine's WebAssembly package at run time.
|
|
19
|
+
|
|
20
|
+
## Use it
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @verticopolis/components @verticopolis/engine excalibur tone lit-html
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Until the first version is on npm, install a release's tarball by its URL,
|
|
27
|
+
for example
|
|
28
|
+
`https://github.com/Verticopolis/components/releases/download/components-v0.2.0/verticopolis-components-0.2.0.tgz`.
|
|
29
|
+
Each `components-v<version>` release carries the tarball with its SHA-256
|
|
30
|
+
checksum, and the bytes on npm are the bytes attached there.
|
|
31
|
+
|
|
32
|
+
The package ships compiled JavaScript (ES modules, one file per source
|
|
33
|
+
module, with `.d.ts` types and source maps). The types are written for a
|
|
34
|
+
bundler (`"moduleResolution": "bundler"` in a game's tsconfig). Only the CSS files count as side
|
|
35
|
+
effects, so a bundler drops every module a game does not import.
|
|
36
|
+
|
|
37
|
+
The version stays below 1.0 while every module is reachable as a subpath:
|
|
38
|
+
any subpath may change in a minor version, so pin a minor (`~0.2.0`). 1.0
|
|
39
|
+
waits for a curated public surface. Each folder is a subpath export:
|
|
40
|
+
|
|
41
|
+
| Import | Folder | What it is |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| `@verticopolis/components/render/*` | `src/render/` | The Excalibur scene, the tower renderer and the procedural sprites |
|
|
44
|
+
| `@verticopolis/components/presentation/*` | `src/presentation/` | What the view shows for each kind of room |
|
|
45
|
+
| `@verticopolis/components/catalog/*` | `src/catalog/` | The engine catalog as the view reads it |
|
|
46
|
+
| `@verticopolis/components/shared/*` | `src/shared/` | Small shared helpers |
|
|
47
|
+
| `@verticopolis/components/binding/*` | `src/engineBinding/` | The WebAssembly binding's types and export tiers |
|
|
48
|
+
| `@verticopolis/components/port/*` | `src/simport/` | The engine port a frontend talks to |
|
|
49
|
+
| `@verticopolis/components/host/*` | `src/wasmhost/` | Loading and checking the engine package |
|
|
50
|
+
| `@verticopolis/components/events/*` | `src/events/` | The gameplay events a host drains |
|
|
51
|
+
| `@verticopolis/components/audio/*` | `src/audio/` | The procedural music and ambience on Tone.js |
|
|
52
|
+
| `@verticopolis/components/windows/*` | `src/ui/` | The Win95 windows, menus and message boxes |
|
|
53
|
+
| `@verticopolis/components/styles.css` | `src/styles.css` | The styles the windows use |
|
|
54
|
+
| `@verticopolis/components/styles/*` | `src/styles/` | The stylesheets `styles.css` imports, one by one |
|
|
55
|
+
| `@verticopolis/components/fixtures/*` | `src/simport/fixtures/` | The engine-written JSON fixtures (catalogs, the view layout) for a game's unit tests |
|
|
56
|
+
|
|
57
|
+
For example, `import { MenuBar } from "@verticopolis/components/windows/menuBar"`.
|
|
58
|
+
|
|
59
|
+
Excalibur, Tone, lit-html and `@verticopolis/engine` are required peer
|
|
60
|
+
dependencies. npm 7 and later install them with the components; with
|
|
61
|
+
`--legacy-peer-deps` or a package manager that skips peers, a game without
|
|
62
|
+
the engine builds, and fails at run time when the host loads the engine's
|
|
63
|
+
WebAssembly. The components never import the engine's JavaScript: the host
|
|
64
|
+
(`host/*`) loads the engine's WebAssembly at run time from the URL the game
|
|
65
|
+
serves it at, and the binding (`binding/*`) is written against that engine's
|
|
66
|
+
API. So a game installs `@verticopolis/engine` itself, serves its `web/`
|
|
67
|
+
build, and keeps it in the version range this package names. A host defines four build
|
|
68
|
+
constants (`__APP_VERSION__`, `__APP_SHA__`, `__TOOLING_ENGINE__`,
|
|
69
|
+
`__ENGINE_PACKAGE__`), declared in `src/env.d.ts`; with Vite that is its
|
|
70
|
+
`define` option.
|
|
71
|
+
|
|
72
|
+
## Build and test
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm ci
|
|
76
|
+
npm run typecheck
|
|
77
|
+
npm run lint
|
|
78
|
+
npm test
|
|
79
|
+
npm run build # compiles src/ into lib/, what the package ships
|
|
80
|
+
npm run pack -- 0.0.0-local # writes dist/verticopolis-components-0.0.0-local.tgz
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The unit tests mock the engine and read its catalog from the JSON fixtures in
|
|
84
|
+
`src/simport/fixtures`, so they need no engine build. Every pull request and
|
|
85
|
+
push to `main` packs the tarball as a workflow artifact.
|
|
86
|
+
|
|
87
|
+
## Releasing
|
|
88
|
+
|
|
89
|
+
Run **Release components** (`.github/workflows/components-release.yml`)
|
|
90
|
+
from the Actions tab on `main` with the version. It packs `main`, tags
|
|
91
|
+
`components-v<version>` on that commit, publishes the GitHub release with
|
|
92
|
+
the tarball and its checksum, and then publishes that same tarball to npm.
|
|
93
|
+
The npm job waits on the `registry` environment, which only the owner
|
|
94
|
+
approves, and uses trusted publishing, so no npm token is stored anywhere and
|
|
95
|
+
each version carries an npm provenance statement. A tag, release or npm
|
|
96
|
+
version that already exists is left alone, so a re-run finishes what a
|
|
97
|
+
failed run started.
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
The components came out of the game's repository, and its rules came with
|
|
102
|
+
them: American English, no em-dashes in prose, a 500-line ceiling per source
|
|
103
|
+
file, and unit tests that stand in for the engine with spies.
|
|
104
|
+
|
|
105
|
+
These components live here now. Pull requests open here once the game
|
|
106
|
+
builds from this repository's packages, which takes a few days. Until then,
|
|
107
|
+
changes to these folders are on hold everywhere, Verticopolis/web included.
|
|
108
|
+
Issues are welcome here now.
|
|
109
|
+
|
|
110
|
+
## History
|
|
111
|
+
|
|
112
|
+
This repository was extracted from `maniator/verticopolis`, now
|
|
113
|
+
Verticopolis/web, with every past path of every file kept, so `git log` and
|
|
114
|
+
`git blame` reach back to each line's first commit with the original authors,
|
|
115
|
+
dates and messages. `#123` in an old commit message was rewritten to
|
|
116
|
+
`Verticopolis/web#123`, the issue or pull request it meant.
|
|
117
|
+
`history/commit-map.txt` maps each commit here to the one it came from.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
Code is MIT, see [LICENSE](LICENSE). The visual and audio assets are CC BY 4.0,
|
|
122
|
+
see [ASSETS-LICENSE.md](ASSETS-LICENSE.md).
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ViewFocus } from "../render/excalibur/TowerEngine";
|
|
2
|
+
import type { SfxName } from "./ToneAudioEngine";
|
|
3
|
+
import type { ProgramKind } from "./toneTracks";
|
|
4
|
+
export type { SfxName };
|
|
5
|
+
export type { ProgramKind };
|
|
6
|
+
/** The subset of the Tone engine the facade constructs and drives. Declared
|
|
7
|
+
* structurally (rather than importing the concrete class) so the loader is a
|
|
8
|
+
* clean injectable seam — tests supply any object with this shape, no
|
|
9
|
+
* dynamic-import mocking required. */
|
|
10
|
+
interface AudioEngineImpl {
|
|
11
|
+
readonly started: boolean;
|
|
12
|
+
start(): void;
|
|
13
|
+
setMuted(m: boolean): void;
|
|
14
|
+
setAway(away: boolean): void;
|
|
15
|
+
setVolumes(music: number, ambience: number, sfx: number): void;
|
|
16
|
+
setProgram(program: ProgramKind): void;
|
|
17
|
+
update(focus: ViewFocus): void;
|
|
18
|
+
sfx(name: SfxName): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
}
|
|
21
|
+
/** What the lazy engine chunk exposes: a zero-arg engine constructor. */
|
|
22
|
+
type EngineModule = {
|
|
23
|
+
ToneAudioEngine: new () => AudioEngineImpl;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Lightweight synchronous facade over the procedural {@link ToneAudioEngine}.
|
|
27
|
+
*
|
|
28
|
+
* The real engine pulls in all of Tone.js (~230 kB), none of which is audible
|
|
29
|
+
* until the player's first gesture (browser autoplay policy). So this facade —
|
|
30
|
+
* which carries NO `tone` import — is what the app constructs at boot, and it
|
|
31
|
+
* defers `await import("./ToneAudioEngine")` until the first {@link start} call.
|
|
32
|
+
* That keeps Tone out of the initial `main` chunk; it lands in its own async
|
|
33
|
+
* chunk instead (still precached by the service worker for offline audio).
|
|
34
|
+
*
|
|
35
|
+
* The facade mirrors the engine's public surface exactly, so callers
|
|
36
|
+
* (`main.ts` and the `Pick<AudioEngine, "sfx">` consumers) are unchanged. State
|
|
37
|
+
* that must be readable synchronously — `muted`, `started` — lives here and is
|
|
38
|
+
* forwarded to the real engine once it loads; every other call is a no-op until
|
|
39
|
+
* then, which matches the engine's own pre-`start()` behavior.
|
|
40
|
+
*/
|
|
41
|
+
export declare class AudioEngine {
|
|
42
|
+
private readonly loadEngine;
|
|
43
|
+
/** Authoritative mute state — read synchronously by the UI toggle, forwarded
|
|
44
|
+
* to the real engine on load. */
|
|
45
|
+
muted: boolean;
|
|
46
|
+
/** Authoritative player volume levels 0..1 (music / crowd & room ambience /
|
|
47
|
+
* action jingles), read synchronously by the settings sliders and forwarded
|
|
48
|
+
* to the real engine on load. Independent of `muted`. */
|
|
49
|
+
musicVolume: number;
|
|
50
|
+
ambienceVolume: number;
|
|
51
|
+
sfxVolume: number;
|
|
52
|
+
private musicDucked;
|
|
53
|
+
/** The player left the page (`watchAway`). Kept apart from `muted`, the
|
|
54
|
+
* player's own setting, which coming back restores untouched. */
|
|
55
|
+
private away;
|
|
56
|
+
/** Which composed track should play. Stored here (start screen vs. tower) so
|
|
57
|
+
* a pre-load switch lands on the engine the moment it builds. */
|
|
58
|
+
program: ProgramKind;
|
|
59
|
+
/** True once the real engine has loaded and started. */
|
|
60
|
+
started: boolean;
|
|
61
|
+
private impl;
|
|
62
|
+
/** In-flight guard so repeated gestures don't kick off duplicate imports. */
|
|
63
|
+
private loading;
|
|
64
|
+
/** Bumped whenever `start()` kicks off a new load and by every `dispose()`. A
|
|
65
|
+
* resolving import that captured an older value is stale — a `dispose()` or a
|
|
66
|
+
* superseding load happened mid-flight — and must abandon rather than
|
|
67
|
+
* resurrect a torn-down engine. */
|
|
68
|
+
private generation;
|
|
69
|
+
/** Latest focus seen before the engine loaded, replayed once it's ready so the
|
|
70
|
+
* correct scene is showing immediately rather than a frame later. */
|
|
71
|
+
private lastFocus;
|
|
72
|
+
/** The latest cue fired while the engine was loading, and when. */
|
|
73
|
+
private pendingCue;
|
|
74
|
+
/**
|
|
75
|
+
* @param loadEngine Loader for the heavy Tone engine chunk. Defaults to the
|
|
76
|
+
* dynamic `import()` that produces the lazy async chunk — the whole point of
|
|
77
|
+
* this facade. Injectable purely so tests can supply a synchronous stub
|
|
78
|
+
* instead of exercising the bundler's code-split at runtime.
|
|
79
|
+
*/
|
|
80
|
+
constructor(loadEngine?: () => Promise<EngineModule>);
|
|
81
|
+
/** Load (once) and start the real engine. Must be called from a user gesture. */
|
|
82
|
+
start(): void;
|
|
83
|
+
setMuted(m: boolean): void;
|
|
84
|
+
/** The player left the page or came back: all sound fades out and the
|
|
85
|
+
* audio clock stops while away, then resumes at the player's own mute and
|
|
86
|
+
* volume settings. Stored here and forwarded to the engine when it loads. */
|
|
87
|
+
setAway(away: boolean): void;
|
|
88
|
+
/** Choose the composed track: `"splash"` on the start screen, `"game"` in
|
|
89
|
+
* the tower. Stored synchronously and forwarded to the engine (now if it's
|
|
90
|
+
* loaded, otherwise when it builds). */
|
|
91
|
+
setProgram(program: ProgramKind): void;
|
|
92
|
+
/** Set the player volume levels (0..1 each). Inputs are clamped, and a
|
|
93
|
+
* non-finite value keeps that channel's current level (NaN would slip
|
|
94
|
+
* through a min/max clamp and later blow up the native AudioParam ramp),
|
|
95
|
+
* so synchronous readers of the fields always see the same sane values
|
|
96
|
+
* the engine gets. */
|
|
97
|
+
setVolumes(music: number, ambience: number, sfx: number): void;
|
|
98
|
+
/** Dip the music to half while a bomb search counts down, so the tick and
|
|
99
|
+
* the outcome stand out; ambience and effects stay as they are. The
|
|
100
|
+
* player's own music level is kept and comes back when the search ends. */
|
|
101
|
+
setMusicDucked(ducked: boolean): void;
|
|
102
|
+
/** The music level the engine plays: the player's, halved while ducked. */
|
|
103
|
+
private heardMusic;
|
|
104
|
+
update(focus: ViewFocus): void;
|
|
105
|
+
sfx(name: SfxName): void;
|
|
106
|
+
/** The cue fired while the engine loaded, if it is still fresh enough to
|
|
107
|
+
* play; taking it clears it. */
|
|
108
|
+
private takePendingCue;
|
|
109
|
+
dispose(): void;
|
|
110
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight synchronous facade over the procedural {@link ToneAudioEngine}.
|
|
3
|
+
*
|
|
4
|
+
* The real engine pulls in all of Tone.js (~230 kB), none of which is audible
|
|
5
|
+
* until the player's first gesture (browser autoplay policy). So this facade —
|
|
6
|
+
* which carries NO `tone` import — is what the app constructs at boot, and it
|
|
7
|
+
* defers `await import("./ToneAudioEngine")` until the first {@link start} call.
|
|
8
|
+
* That keeps Tone out of the initial `main` chunk; it lands in its own async
|
|
9
|
+
* chunk instead (still precached by the service worker for offline audio).
|
|
10
|
+
*
|
|
11
|
+
* The facade mirrors the engine's public surface exactly, so callers
|
|
12
|
+
* (`main.ts` and the `Pick<AudioEngine, "sfx">` consumers) are unchanged. State
|
|
13
|
+
* that must be readable synchronously — `muted`, `started` — lives here and is
|
|
14
|
+
* forwarded to the real engine once it loads; every other call is a no-op until
|
|
15
|
+
* then, which matches the engine's own pre-`start()` behavior.
|
|
16
|
+
*/
|
|
17
|
+
class AudioEngine {
|
|
18
|
+
/**
|
|
19
|
+
* @param loadEngine Loader for the heavy Tone engine chunk. Defaults to the
|
|
20
|
+
* dynamic `import()` that produces the lazy async chunk — the whole point of
|
|
21
|
+
* this facade. Injectable purely so tests can supply a synchronous stub
|
|
22
|
+
* instead of exercising the bundler's code-split at runtime.
|
|
23
|
+
*/
|
|
24
|
+
constructor(loadEngine = () => import('./ToneAudioEngine.js')) {
|
|
25
|
+
this.loadEngine = loadEngine;
|
|
26
|
+
/** Authoritative mute state — read synchronously by the UI toggle, forwarded
|
|
27
|
+
* to the real engine on load. */
|
|
28
|
+
this.muted = false;
|
|
29
|
+
/** Authoritative player volume levels 0..1 (music / crowd & room ambience /
|
|
30
|
+
* action jingles), read synchronously by the settings sliders and forwarded
|
|
31
|
+
* to the real engine on load. Independent of `muted`. */
|
|
32
|
+
this.musicVolume = 1;
|
|
33
|
+
this.ambienceVolume = 1;
|
|
34
|
+
this.sfxVolume = 1;
|
|
35
|
+
this.musicDucked = false;
|
|
36
|
+
/** The player left the page (`watchAway`). Kept apart from `muted`, the
|
|
37
|
+
* player's own setting, which coming back restores untouched. */
|
|
38
|
+
this.away = false;
|
|
39
|
+
/** Which composed track should play. Stored here (start screen vs. tower) so
|
|
40
|
+
* a pre-load switch lands on the engine the moment it builds. */
|
|
41
|
+
this.program = "game";
|
|
42
|
+
/** True once the real engine has loaded and started. */
|
|
43
|
+
this.started = false;
|
|
44
|
+
this.impl = null;
|
|
45
|
+
/** In-flight guard so repeated gestures don't kick off duplicate imports. */
|
|
46
|
+
this.loading = false;
|
|
47
|
+
/** Bumped whenever `start()` kicks off a new load and by every `dispose()`. A
|
|
48
|
+
* resolving import that captured an older value is stale — a `dispose()` or a
|
|
49
|
+
* superseding load happened mid-flight — and must abandon rather than
|
|
50
|
+
* resurrect a torn-down engine. */
|
|
51
|
+
this.generation = 0;
|
|
52
|
+
/** Latest focus seen before the engine loaded, replayed once it's ready so the
|
|
53
|
+
* correct scene is showing immediately rather than a frame later. */
|
|
54
|
+
this.lastFocus = null;
|
|
55
|
+
/** The latest cue fired while the engine was loading, and when. */
|
|
56
|
+
this.pendingCue = null;
|
|
57
|
+
}
|
|
58
|
+
/** Load (once) and start the real engine. Must be called from a user gesture. */
|
|
59
|
+
start() {
|
|
60
|
+
if (this.impl) {
|
|
61
|
+
this.impl.start();
|
|
62
|
+
this.started = this.impl.started;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (this.loading)
|
|
66
|
+
return;
|
|
67
|
+
// Feature-detect BEFORE importing so tests / SSR / unsupported environments
|
|
68
|
+
// stay fully inert and never fetch the audio chunk — matching the engine's
|
|
69
|
+
// own no-op-without-WebAudio contract.
|
|
70
|
+
const g = globalThis;
|
|
71
|
+
if (typeof g.AudioContext === "undefined" && typeof g.webkitAudioContext === "undefined")
|
|
72
|
+
return;
|
|
73
|
+
this.loading = true;
|
|
74
|
+
const generation = ++this.generation;
|
|
75
|
+
void this.loadEngine()
|
|
76
|
+
.then(({ ToneAudioEngine }) => {
|
|
77
|
+
// A dispose() (or a superseding start()) during the load window bumped
|
|
78
|
+
// `generation`; abandon this stale load — never resurrect a torn-down
|
|
79
|
+
// engine — and leave `loading` to whoever now owns it.
|
|
80
|
+
if (generation !== this.generation)
|
|
81
|
+
return;
|
|
82
|
+
this.loading = false;
|
|
83
|
+
const impl = new ToneAudioEngine();
|
|
84
|
+
// Adopt the instance BEFORE start()/setMuted() so that if engine init
|
|
85
|
+
// throws (a live AudioContext already allocated in the constructor), it
|
|
86
|
+
// stays reachable by dispose() rather than leaking as an orphan.
|
|
87
|
+
this.impl = impl;
|
|
88
|
+
impl.setMuted(this.muted);
|
|
89
|
+
impl.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);
|
|
90
|
+
impl.setProgram(this.program);
|
|
91
|
+
// Before start(), so a player who left during the load hears nothing:
|
|
92
|
+
// the master builds silent and the context goes to sleep.
|
|
93
|
+
impl.setAway(this.away);
|
|
94
|
+
impl.start();
|
|
95
|
+
this.started = impl.started;
|
|
96
|
+
if (this.lastFocus)
|
|
97
|
+
impl.update(this.lastFocus);
|
|
98
|
+
const cue = this.takePendingCue();
|
|
99
|
+
if (cue)
|
|
100
|
+
impl.sfx(cue);
|
|
101
|
+
})
|
|
102
|
+
.catch(() => {
|
|
103
|
+
// Chunk failed to load (offline first-run, blocked request) — stay
|
|
104
|
+
// silent and let a later gesture retry. Only clear our own guard.
|
|
105
|
+
if (generation === this.generation) {
|
|
106
|
+
this.loading = false;
|
|
107
|
+
this.pendingCue = null;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
setMuted(m) {
|
|
112
|
+
this.muted = m;
|
|
113
|
+
this.impl?.setMuted(m);
|
|
114
|
+
}
|
|
115
|
+
/** The player left the page or came back: all sound fades out and the
|
|
116
|
+
* audio clock stops while away, then resumes at the player's own mute and
|
|
117
|
+
* volume settings. Stored here and forwarded to the engine when it loads. */
|
|
118
|
+
setAway(away) {
|
|
119
|
+
this.away = away;
|
|
120
|
+
this.impl?.setAway(away);
|
|
121
|
+
}
|
|
122
|
+
/** Choose the composed track: `"splash"` on the start screen, `"game"` in
|
|
123
|
+
* the tower. Stored synchronously and forwarded to the engine (now if it's
|
|
124
|
+
* loaded, otherwise when it builds). */
|
|
125
|
+
setProgram(program) {
|
|
126
|
+
this.program = program;
|
|
127
|
+
this.impl?.setProgram(program);
|
|
128
|
+
}
|
|
129
|
+
/** Set the player volume levels (0..1 each). Inputs are clamped, and a
|
|
130
|
+
* non-finite value keeps that channel's current level (NaN would slip
|
|
131
|
+
* through a min/max clamp and later blow up the native AudioParam ramp),
|
|
132
|
+
* so synchronous readers of the fields always see the same sane values
|
|
133
|
+
* the engine gets. */
|
|
134
|
+
setVolumes(music, ambience, sfx) {
|
|
135
|
+
this.musicVolume = saneLevel(music, this.musicVolume);
|
|
136
|
+
this.ambienceVolume = saneLevel(ambience, this.ambienceVolume);
|
|
137
|
+
this.sfxVolume = saneLevel(sfx, this.sfxVolume);
|
|
138
|
+
this.impl?.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);
|
|
139
|
+
}
|
|
140
|
+
/** Dip the music to half while a bomb search counts down, so the tick and
|
|
141
|
+
* the outcome stand out; ambience and effects stay as they are. The
|
|
142
|
+
* player's own music level is kept and comes back when the search ends. */
|
|
143
|
+
setMusicDucked(ducked) {
|
|
144
|
+
if (ducked === this.musicDucked)
|
|
145
|
+
return;
|
|
146
|
+
this.musicDucked = ducked;
|
|
147
|
+
this.impl?.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);
|
|
148
|
+
}
|
|
149
|
+
/** The music level the engine plays: the player's, halved while ducked. */
|
|
150
|
+
heardMusic() {
|
|
151
|
+
return this.musicDucked ? this.musicVolume * MUSIC_DUCK : this.musicVolume;
|
|
152
|
+
}
|
|
153
|
+
update(focus) {
|
|
154
|
+
this.lastFocus = focus;
|
|
155
|
+
this.impl?.update(focus);
|
|
156
|
+
}
|
|
157
|
+
sfx(name) {
|
|
158
|
+
if (this.impl) {
|
|
159
|
+
this.impl.sfx(name);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
// The first gesture starts the engine, but its chunk loads asynchronously,
|
|
163
|
+
// so the cue that same gesture fires arrives before there is an engine to
|
|
164
|
+
// play it. Keep the latest one and hand it over when the engine starts,
|
|
165
|
+
// unless the load took so long that it would sound late (#554).
|
|
166
|
+
if (this.loading)
|
|
167
|
+
this.pendingCue = { name, at: nowMs() };
|
|
168
|
+
}
|
|
169
|
+
/** The cue fired while the engine loaded, if it is still fresh enough to
|
|
170
|
+
* play; taking it clears it. */
|
|
171
|
+
takePendingCue() {
|
|
172
|
+
const cue = this.pendingCue;
|
|
173
|
+
this.pendingCue = null;
|
|
174
|
+
return cue && nowMs() - cue.at <= FIRST_CUE_MAX_DELAY_MS ? cue.name : null;
|
|
175
|
+
}
|
|
176
|
+
dispose() {
|
|
177
|
+
// Invalidate any in-flight load so it can't resurrect us, and release the
|
|
178
|
+
// guard so a later start() can retry cleanly.
|
|
179
|
+
this.generation++;
|
|
180
|
+
this.loading = false;
|
|
181
|
+
this.pendingCue = null;
|
|
182
|
+
this.impl?.dispose();
|
|
183
|
+
this.impl = null;
|
|
184
|
+
this.started = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** The longest a cue fired during the engine's load may wait and still play:
|
|
188
|
+
* past this, it would sound detached from the click that made it. */
|
|
189
|
+
const FIRST_CUE_MAX_DELAY_MS = 1000;
|
|
190
|
+
const nowMs = () => performance.now();
|
|
191
|
+
/** How far the music dips while a bomb search counts down. */
|
|
192
|
+
const MUSIC_DUCK = 0.5;
|
|
193
|
+
/** Clamp a level into 0..1; a non-finite input falls back to `prev`. */
|
|
194
|
+
function saneLevel(v, prev) {
|
|
195
|
+
return Number.isFinite(v) ? Math.max(0, Math.min(1, v)) : prev;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { AudioEngine };
|
|
199
|
+
//# sourceMappingURL=Audio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Audio.js","sources":["../../src/audio/Audio.ts"],"sourcesContent":["import type { ViewFocus } from \"../render/excalibur/TowerEngine\";\nimport type { SfxName } from \"./ToneAudioEngine\";\nimport type { ProgramKind } from \"./toneTracks\";\n\nexport type { SfxName };\nexport type { ProgramKind };\n\n/** The subset of the Tone engine the facade constructs and drives. Declared\n * structurally (rather than importing the concrete class) so the loader is a\n * clean injectable seam — tests supply any object with this shape, no\n * dynamic-import mocking required. */\ninterface AudioEngineImpl {\n readonly started: boolean;\n start(): void;\n setMuted(m: boolean): void;\n setAway(away: boolean): void;\n setVolumes(music: number, ambience: number, sfx: number): void;\n setProgram(program: ProgramKind): void;\n update(focus: ViewFocus): void;\n sfx(name: SfxName): void;\n dispose(): void;\n}\n\n/** What the lazy engine chunk exposes: a zero-arg engine constructor. */\ntype EngineModule = { ToneAudioEngine: new () => AudioEngineImpl };\n\n/**\n * Lightweight synchronous facade over the procedural {@link ToneAudioEngine}.\n *\n * The real engine pulls in all of Tone.js (~230 kB), none of which is audible\n * until the player's first gesture (browser autoplay policy). So this facade —\n * which carries NO `tone` import — is what the app constructs at boot, and it\n * defers `await import(\"./ToneAudioEngine\")` until the first {@link start} call.\n * That keeps Tone out of the initial `main` chunk; it lands in its own async\n * chunk instead (still precached by the service worker for offline audio).\n *\n * The facade mirrors the engine's public surface exactly, so callers\n * (`main.ts` and the `Pick<AudioEngine, \"sfx\">` consumers) are unchanged. State\n * that must be readable synchronously — `muted`, `started` — lives here and is\n * forwarded to the real engine once it loads; every other call is a no-op until\n * then, which matches the engine's own pre-`start()` behavior.\n */\nexport class AudioEngine {\n /** Authoritative mute state — read synchronously by the UI toggle, forwarded\n * to the real engine on load. */\n muted = false;\n /** Authoritative player volume levels 0..1 (music / crowd & room ambience /\n * action jingles), read synchronously by the settings sliders and forwarded\n * to the real engine on load. Independent of `muted`. */\n musicVolume = 1;\n ambienceVolume = 1;\n sfxVolume = 1;\n private musicDucked = false;\n /** The player left the page (`watchAway`). Kept apart from `muted`, the\n * player's own setting, which coming back restores untouched. */\n private away = false;\n /** Which composed track should play. Stored here (start screen vs. tower) so\n * a pre-load switch lands on the engine the moment it builds. */\n program: ProgramKind = \"game\";\n /** True once the real engine has loaded and started. */\n started = false;\n\n private impl: AudioEngineImpl | null = null;\n /** In-flight guard so repeated gestures don't kick off duplicate imports. */\n private loading = false;\n /** Bumped whenever `start()` kicks off a new load and by every `dispose()`. A\n * resolving import that captured an older value is stale — a `dispose()` or a\n * superseding load happened mid-flight — and must abandon rather than\n * resurrect a torn-down engine. */\n private generation = 0;\n /** Latest focus seen before the engine loaded, replayed once it's ready so the\n * correct scene is showing immediately rather than a frame later. */\n private lastFocus: ViewFocus | null = null;\n /** The latest cue fired while the engine was loading, and when. */\n private pendingCue: { name: SfxName; at: number } | null = null;\n\n /**\n * @param loadEngine Loader for the heavy Tone engine chunk. Defaults to the\n * dynamic `import()` that produces the lazy async chunk — the whole point of\n * this facade. Injectable purely so tests can supply a synchronous stub\n * instead of exercising the bundler's code-split at runtime.\n */\n constructor(private readonly loadEngine: () => Promise<EngineModule> = () => import(\"./ToneAudioEngine\")) {}\n\n /** Load (once) and start the real engine. Must be called from a user gesture. */\n start(): void {\n if (this.impl) {\n this.impl.start();\n this.started = this.impl.started;\n return;\n }\n if (this.loading) return;\n // Feature-detect BEFORE importing so tests / SSR / unsupported environments\n // stay fully inert and never fetch the audio chunk — matching the engine's\n // own no-op-without-WebAudio contract.\n const g = globalThis as { AudioContext?: unknown; webkitAudioContext?: unknown };\n if (typeof g.AudioContext === \"undefined\" && typeof g.webkitAudioContext === \"undefined\") return;\n this.loading = true;\n const generation = ++this.generation;\n void this.loadEngine()\n .then(({ ToneAudioEngine }) => {\n // A dispose() (or a superseding start()) during the load window bumped\n // `generation`; abandon this stale load — never resurrect a torn-down\n // engine — and leave `loading` to whoever now owns it.\n if (generation !== this.generation) return;\n this.loading = false;\n const impl = new ToneAudioEngine();\n // Adopt the instance BEFORE start()/setMuted() so that if engine init\n // throws (a live AudioContext already allocated in the constructor), it\n // stays reachable by dispose() rather than leaking as an orphan.\n this.impl = impl;\n impl.setMuted(this.muted);\n impl.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);\n impl.setProgram(this.program);\n // Before start(), so a player who left during the load hears nothing:\n // the master builds silent and the context goes to sleep.\n impl.setAway(this.away);\n impl.start();\n this.started = impl.started;\n if (this.lastFocus) impl.update(this.lastFocus);\n const cue = this.takePendingCue();\n if (cue) impl.sfx(cue);\n })\n .catch(() => {\n // Chunk failed to load (offline first-run, blocked request) — stay\n // silent and let a later gesture retry. Only clear our own guard.\n if (generation === this.generation) {\n this.loading = false;\n this.pendingCue = null;\n }\n });\n }\n\n setMuted(m: boolean): void {\n this.muted = m;\n this.impl?.setMuted(m);\n }\n\n /** The player left the page or came back: all sound fades out and the\n * audio clock stops while away, then resumes at the player's own mute and\n * volume settings. Stored here and forwarded to the engine when it loads. */\n setAway(away: boolean): void {\n this.away = away;\n this.impl?.setAway(away);\n }\n\n /** Choose the composed track: `\"splash\"` on the start screen, `\"game\"` in\n * the tower. Stored synchronously and forwarded to the engine (now if it's\n * loaded, otherwise when it builds). */\n setProgram(program: ProgramKind): void {\n this.program = program;\n this.impl?.setProgram(program);\n }\n\n /** Set the player volume levels (0..1 each). Inputs are clamped, and a\n * non-finite value keeps that channel's current level (NaN would slip\n * through a min/max clamp and later blow up the native AudioParam ramp),\n * so synchronous readers of the fields always see the same sane values\n * the engine gets. */\n setVolumes(music: number, ambience: number, sfx: number): void {\n this.musicVolume = saneLevel(music, this.musicVolume);\n this.ambienceVolume = saneLevel(ambience, this.ambienceVolume);\n this.sfxVolume = saneLevel(sfx, this.sfxVolume);\n this.impl?.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);\n }\n\n /** Dip the music to half while a bomb search counts down, so the tick and\n * the outcome stand out; ambience and effects stay as they are. The\n * player's own music level is kept and comes back when the search ends. */\n setMusicDucked(ducked: boolean): void {\n if (ducked === this.musicDucked) return;\n this.musicDucked = ducked;\n this.impl?.setVolumes(this.heardMusic(), this.ambienceVolume, this.sfxVolume);\n }\n\n /** The music level the engine plays: the player's, halved while ducked. */\n private heardMusic(): number {\n return this.musicDucked ? this.musicVolume * MUSIC_DUCK : this.musicVolume;\n }\n\n update(focus: ViewFocus): void {\n this.lastFocus = focus;\n this.impl?.update(focus);\n }\n\n sfx(name: SfxName): void {\n if (this.impl) {\n this.impl.sfx(name);\n return;\n }\n // The first gesture starts the engine, but its chunk loads asynchronously,\n // so the cue that same gesture fires arrives before there is an engine to\n // play it. Keep the latest one and hand it over when the engine starts,\n // unless the load took so long that it would sound late (#554).\n if (this.loading) this.pendingCue = { name, at: nowMs() };\n }\n\n /** The cue fired while the engine loaded, if it is still fresh enough to\n * play; taking it clears it. */\n private takePendingCue(): SfxName | null {\n const cue = this.pendingCue;\n this.pendingCue = null;\n return cue && nowMs() - cue.at <= FIRST_CUE_MAX_DELAY_MS ? cue.name : null;\n }\n\n dispose(): void {\n // Invalidate any in-flight load so it can't resurrect us, and release the\n // guard so a later start() can retry cleanly.\n this.generation++;\n this.loading = false;\n this.pendingCue = null;\n this.impl?.dispose();\n this.impl = null;\n this.started = false;\n }\n}\n\n/** The longest a cue fired during the engine's load may wait and still play:\n * past this, it would sound detached from the click that made it. */\nconst FIRST_CUE_MAX_DELAY_MS = 1000;\n\nconst nowMs = (): number => performance.now();\n\n/** How far the music dips while a bomb search counts down. */\nconst MUSIC_DUCK = 0.5;\n\n/** Clamp a level into 0..1; a non-finite input falls back to `prev`. */\nfunction saneLevel(v: number, prev: number): number {\n return Number.isFinite(v) ? Math.max(0, Math.min(1, v)) : prev;\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { ViewFocus } from "../render/excalibur/TowerEngine";
|
|
2
|
+
import { type SfxName } from "./toneScenes";
|
|
3
|
+
import { type ProgramKind } from "./toneTracks";
|
|
4
|
+
/**
|
|
5
|
+
* Music + ambient audio for the tower, built on Tone.js.
|
|
6
|
+
*
|
|
7
|
+
* The music is two looping tracks transcribed from the owner's own recordings
|
|
8
|
+
* (see `./toneTracks.ts`), played by a looping {@link Tone.Part} through bass,
|
|
9
|
+
* pad, melody, and percussion voices; {@link setProgram} picks the track.
|
|
10
|
+
*
|
|
11
|
+
* Layered under it is the building's ambient life: a per-area "room tone" bed
|
|
12
|
+
* (filtered noise), an outdoor rain layer, and the crowd/venue ambience layer
|
|
13
|
+
* (see `./toneCrowd.ts`): voices, venue detail, and composed venue programs
|
|
14
|
+
* driven by scene, zoom, live occupancy, and the sim clock. The music runs on
|
|
15
|
+
* its own path so it stays warm at any zoom.
|
|
16
|
+
*
|
|
17
|
+
* Feature-detected and gesture-gated: with no AudioContext (tests / unsupported)
|
|
18
|
+
* `start()` is a no-op and the engine stays inert. It carries the whole Tone.js
|
|
19
|
+
* dependency (~230 kB), so the {@link AudioEngine} facade loads it lazily via a
|
|
20
|
+
* dynamic `import()` on the first gesture.
|
|
21
|
+
*/
|
|
22
|
+
export type { SfxName };
|
|
23
|
+
export declare class ToneAudioEngine {
|
|
24
|
+
private master;
|
|
25
|
+
/** Player-set music level: the composed tracks only. */
|
|
26
|
+
private musicBus;
|
|
27
|
+
/** Player-set ambience level: the crowd/venue layer, room tone, and rain,
|
|
28
|
+
* so voices mix independently of the music (an owner request: turn the
|
|
29
|
+
* music down and hear the crowd better). Two nodes because rain stays on
|
|
30
|
+
* its deliberate dry path while the rest shares the reverb. */
|
|
31
|
+
private ambBus;
|
|
32
|
+
private ambDryBus;
|
|
33
|
+
/** Player-set effects level: the one-shot action jingles only. */
|
|
34
|
+
private sfxBus;
|
|
35
|
+
/** Distance lowpass on the AMBIENT bed; opens up as you zoom in. The music
|
|
36
|
+
* bypasses it (see the music chain) so the composed track stays consistent. */
|
|
37
|
+
private bedFilter;
|
|
38
|
+
private reverb;
|
|
39
|
+
private arp;
|
|
40
|
+
private bassVoice;
|
|
41
|
+
private hook;
|
|
42
|
+
private perc;
|
|
43
|
+
private musicGain;
|
|
44
|
+
/** Warm lowpass + sub high-pass on the music (never bright/harsh, no rumble). */
|
|
45
|
+
private musicTone;
|
|
46
|
+
private musicSub;
|
|
47
|
+
/** The looping player for the active track. Rebuilt on a program change. */
|
|
48
|
+
private musicPart;
|
|
49
|
+
/** Target level for the music bed; the crossfade dips to 0 and back to this. */
|
|
50
|
+
private readonly musicLevel;
|
|
51
|
+
/** Pending track-swap during a crossfade, so a re-switch can cancel it. */
|
|
52
|
+
private swapTimer;
|
|
53
|
+
/** The jingle instrument set (recipes and construction in toneVoices.ts). */
|
|
54
|
+
private sfxVoices;
|
|
55
|
+
/** The crowd/venue ambience layer (talkers, venue detail, venue programs). */
|
|
56
|
+
private crowd;
|
|
57
|
+
private ambNoise;
|
|
58
|
+
private ambFilter;
|
|
59
|
+
/** Fixed roll-off on the ambient bed so it never turns into bright hiss. */
|
|
60
|
+
private ambTone;
|
|
61
|
+
private ambGain;
|
|
62
|
+
private rain;
|
|
63
|
+
private scene;
|
|
64
|
+
private targetScene;
|
|
65
|
+
/** Hysteresis latch for the zoomed-out overview scene. */
|
|
66
|
+
private overview;
|
|
67
|
+
private ambBase;
|
|
68
|
+
private detail;
|
|
69
|
+
private rainTarget;
|
|
70
|
+
/** Which composed track plays. The app switches this at the splash boundary. */
|
|
71
|
+
private program;
|
|
72
|
+
muted: boolean;
|
|
73
|
+
/** The player left the page (`watchAway`): silent, and asleep once faded. */
|
|
74
|
+
private away;
|
|
75
|
+
private readonly sleep;
|
|
76
|
+
/** The latest focus `update` saw, so leaving can stop the crowd at once. */
|
|
77
|
+
private focus;
|
|
78
|
+
/** Player-set levels 0..1, kept even while the graph isn't built so start()
|
|
79
|
+
* can apply them; independent of `muted` (the master kill switch). */
|
|
80
|
+
musicVolume: number;
|
|
81
|
+
ambienceVolume: number;
|
|
82
|
+
sfxVolume: number;
|
|
83
|
+
started: boolean;
|
|
84
|
+
private readonly firstCue;
|
|
85
|
+
/** Lazily create the audio graph. Must be called from a user gesture. */
|
|
86
|
+
start(): void;
|
|
87
|
+
setMuted(m: boolean): void;
|
|
88
|
+
/** The player left the page or came back. A page in the background or out
|
|
89
|
+
* of focus gets a starved, throttled main thread, so notes arrived late and
|
|
90
|
+
* the mix crackled; away, everything fades out and the context sleeps. */
|
|
91
|
+
setAway(away: boolean): void;
|
|
92
|
+
private get silent();
|
|
93
|
+
/** Fade the master to match; sleep while away, wake once heard again. */
|
|
94
|
+
private applySilence;
|
|
95
|
+
/** Player volume levels, 0..1 each (clamped, ramped). Safe before start().
|
|
96
|
+
* A non-finite input keeps that channel's level (NaN survives clamp() and
|
|
97
|
+
* the native AudioParam rejects non-finite ramp targets). */
|
|
98
|
+
setVolumes(music: number, ambience: number, sfx: number): void;
|
|
99
|
+
/** Choose which composed track plays: `"splash"` on the start screen,
|
|
100
|
+
* `"game"` in the tower. Safe before start() (stored, applied on build).
|
|
101
|
+
* Live, it CROSSFADES so the splash theme flows into the in-game bed instead
|
|
102
|
+
* of cutting. A repeat of the current program is a no-op. */
|
|
103
|
+
setProgram(program: ProgramKind): void;
|
|
104
|
+
/** Dip to silence, swap the part at the bottom, swell back up; percGain rides the dip. */
|
|
105
|
+
private crossfadeProgram;
|
|
106
|
+
/** Called every frame with the renderer's focus; drives the ambient life
|
|
107
|
+
* (scene room-tone, zoom detail, rain). The music is program-driven, not
|
|
108
|
+
* focus-driven, so it is untouched here. */
|
|
109
|
+
update(focus: ViewFocus): void;
|
|
110
|
+
/** Build (or rebuild) the looping part for the active program, clearing any
|
|
111
|
+
* prior part first so a switch never stacks two tracks. */
|
|
112
|
+
private buildMusicPart;
|
|
113
|
+
/** Resolve a track voice tag to its live synth (owner request: a switch). */
|
|
114
|
+
private noteVoice;
|
|
115
|
+
private crossfadeTo;
|
|
116
|
+
/** Move the ambient room-tone bed to a scene's character (music is not
|
|
117
|
+
* scene-driven; only the ambient life follows what you view). */
|
|
118
|
+
private applyScene;
|
|
119
|
+
/** React to zoom: open the distance filter and scale ambient detail. */
|
|
120
|
+
private applyDetail;
|
|
121
|
+
private updateAmbGain;
|
|
122
|
+
sfx(name: SfxName): void;
|
|
123
|
+
private sfxIfAny;
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|