@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,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep pointer buttons Excalibur cannot name away from its input handler.
|
|
3
|
+
*
|
|
4
|
+
* Excalibur 0.32's pointer receiver maps the DOM `PointerEvent.button` code to
|
|
5
|
+
* its own enum and throws on any code it does not list: it knows "no button"
|
|
6
|
+
* (-1), left (0), middle (1), right (2) and back (3), and calls `fail(button)`
|
|
7
|
+
* for anything else. A mouse's forward side button reports 4 and a pen's
|
|
8
|
+
* eraser reports 5, so pressing either over the tower canvas threw an uncaught
|
|
9
|
+
* `Error: 4` from inside the vendor handler (seen in production after the
|
|
10
|
+
* 2026-11-12 launch traffic). The game gives those buttons no meaning, so the
|
|
11
|
+
* guard swallows the event before Excalibur sees it, except that the last up
|
|
12
|
+
* of a pointer is handed on with no button named, so a press never sticks.
|
|
13
|
+
*
|
|
14
|
+
* It listens in the capture phase on the canvas itself, which Excalibur also
|
|
15
|
+
* listens on (the default `PointerScope.Canvas`), so it runs first and
|
|
16
|
+
* `stopImmediatePropagation` keeps the event from reaching Excalibur's handler.
|
|
17
|
+
* It also prevents the default action, as Excalibur does for every other
|
|
18
|
+
* pointer event on the canvas.
|
|
19
|
+
*/
|
|
20
|
+
/** The DOM `PointerEvent.button` codes Excalibur's receiver can map. */
|
|
21
|
+
const EXCALIBUR_POINTER_BUTTONS = {
|
|
22
|
+
none: -1,
|
|
23
|
+
left: 0,
|
|
24
|
+
middle: 1,
|
|
25
|
+
right: 2,
|
|
26
|
+
back: 3,
|
|
27
|
+
};
|
|
28
|
+
const KNOWN_BUTTONS = new Set(Object.values(EXCALIBUR_POINTER_BUTTONS));
|
|
29
|
+
/** True when Excalibur's pointer receiver can map this DOM button code. */
|
|
30
|
+
function excaliburCanMapButton(button) {
|
|
31
|
+
return KNOWN_BUTTONS.has(button);
|
|
32
|
+
}
|
|
33
|
+
/** The pointer events Excalibur's receiver handles on its target. */
|
|
34
|
+
const GUARDED_EVENTS = ["pointerdown", "pointerup", "pointermove", "pointercancel"];
|
|
35
|
+
const guarded = new WeakSet();
|
|
36
|
+
/** `PointerEvent.buttons` when no button is held. */
|
|
37
|
+
const NO_BUTTONS_HELD = 0;
|
|
38
|
+
/** True when this event is the last of its pointer: an up with no button
|
|
39
|
+
* still held, or a cancel. */
|
|
40
|
+
function endsPointer(event) {
|
|
41
|
+
return event.type === "pointercancel" || (event.type === "pointerup" && event.buttons === NO_BUTTONS_HELD);
|
|
42
|
+
}
|
|
43
|
+
function swallowUnmappedButton(event) {
|
|
44
|
+
const pointer = event;
|
|
45
|
+
if (typeof pointer.button !== "number" || excaliburCanMapButton(pointer.button))
|
|
46
|
+
return;
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
event.stopImmediatePropagation();
|
|
49
|
+
// A chord can end on the unmapped button: press left, press forward, let go
|
|
50
|
+
// of left, then of forward. The pointer's only up is then the forward
|
|
51
|
+
// button's, and swallowing it would leave Excalibur holding a press that
|
|
52
|
+
// never ends. Hand on the same up with no button named instead.
|
|
53
|
+
if (endsPointer(pointer) && event.currentTarget) {
|
|
54
|
+
event.currentTarget.dispatchEvent(new PointerEvent(event.type, {
|
|
55
|
+
bubbles: true,
|
|
56
|
+
cancelable: true,
|
|
57
|
+
// With a view the browser adds the page scroll to pageX and pageY,
|
|
58
|
+
// which Excalibur reads.
|
|
59
|
+
view: window,
|
|
60
|
+
pointerId: pointer.pointerId,
|
|
61
|
+
pointerType: pointer.pointerType,
|
|
62
|
+
isPrimary: pointer.isPrimary,
|
|
63
|
+
clientX: pointer.clientX,
|
|
64
|
+
clientY: pointer.clientY,
|
|
65
|
+
screenX: pointer.screenX,
|
|
66
|
+
screenY: pointer.screenY,
|
|
67
|
+
button: EXCALIBUR_POINTER_BUTTONS.none,
|
|
68
|
+
buttons: NO_BUTTONS_HELD,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Install the guard on the canvas Excalibur reads pointer input from. Call it
|
|
74
|
+
* before the engine is constructed so the guard is registered first. Safe to
|
|
75
|
+
* call again for the same canvas: it installs once.
|
|
76
|
+
*/
|
|
77
|
+
function guardPointerButtons(target) {
|
|
78
|
+
if (guarded.has(target))
|
|
79
|
+
return;
|
|
80
|
+
guarded.add(target);
|
|
81
|
+
for (const type of GUARDED_EVENTS)
|
|
82
|
+
target.addEventListener(type, swallowUnmappedButton, { capture: true });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { EXCALIBUR_POINTER_BUTTONS, excaliburCanMapButton, guardPointerButtons };
|
|
86
|
+
//# sourceMappingURL=pointerButtonGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointerButtonGuard.js","sources":["../../../src/render/excalibur/pointerButtonGuard.ts"],"sourcesContent":["/**\n * Keep pointer buttons Excalibur cannot name away from its input handler.\n *\n * Excalibur 0.32's pointer receiver maps the DOM `PointerEvent.button` code to\n * its own enum and throws on any code it does not list: it knows \"no button\"\n * (-1), left (0), middle (1), right (2) and back (3), and calls `fail(button)`\n * for anything else. A mouse's forward side button reports 4 and a pen's\n * eraser reports 5, so pressing either over the tower canvas threw an uncaught\n * `Error: 4` from inside the vendor handler (seen in production after the\n * 2026-11-12 launch traffic). The game gives those buttons no meaning, so the\n * guard swallows the event before Excalibur sees it, except that the last up\n * of a pointer is handed on with no button named, so a press never sticks.\n *\n * It listens in the capture phase on the canvas itself, which Excalibur also\n * listens on (the default `PointerScope.Canvas`), so it runs first and\n * `stopImmediatePropagation` keeps the event from reaching Excalibur's handler.\n * It also prevents the default action, as Excalibur does for every other\n * pointer event on the canvas.\n */\n\n/** The DOM `PointerEvent.button` codes Excalibur's receiver can map. */\nexport const EXCALIBUR_POINTER_BUTTONS = {\n none: -1,\n left: 0,\n middle: 1,\n right: 2,\n back: 3,\n} as const;\n\nconst KNOWN_BUTTONS: ReadonlySet<number> = new Set(Object.values(EXCALIBUR_POINTER_BUTTONS));\n\n/** True when Excalibur's pointer receiver can map this DOM button code. */\nexport function excaliburCanMapButton(button: number): boolean {\n return KNOWN_BUTTONS.has(button);\n}\n\n/** The pointer events Excalibur's receiver handles on its target. */\nconst GUARDED_EVENTS = [\"pointerdown\", \"pointerup\", \"pointermove\", \"pointercancel\"] as const;\n\nconst guarded = new WeakSet<EventTarget>();\n\n/** `PointerEvent.buttons` when no button is held. */\nconst NO_BUTTONS_HELD = 0;\n\n/** True when this event is the last of its pointer: an up with no button\n * still held, or a cancel. */\nfunction endsPointer(event: PointerEvent): boolean {\n return event.type === \"pointercancel\" || (event.type === \"pointerup\" && event.buttons === NO_BUTTONS_HELD);\n}\n\nfunction swallowUnmappedButton(event: Event): void {\n const pointer = event as PointerEvent;\n if (typeof pointer.button !== \"number\" || excaliburCanMapButton(pointer.button)) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n // A chord can end on the unmapped button: press left, press forward, let go\n // of left, then of forward. The pointer's only up is then the forward\n // button's, and swallowing it would leave Excalibur holding a press that\n // never ends. Hand on the same up with no button named instead.\n if (endsPointer(pointer) && event.currentTarget) {\n event.currentTarget.dispatchEvent(\n new PointerEvent(event.type, {\n bubbles: true,\n cancelable: true,\n // With a view the browser adds the page scroll to pageX and pageY,\n // which Excalibur reads.\n view: window,\n pointerId: pointer.pointerId,\n pointerType: pointer.pointerType,\n isPrimary: pointer.isPrimary,\n clientX: pointer.clientX,\n clientY: pointer.clientY,\n screenX: pointer.screenX,\n screenY: pointer.screenY,\n button: EXCALIBUR_POINTER_BUTTONS.none,\n buttons: NO_BUTTONS_HELD,\n }),\n );\n }\n}\n\n/**\n * Install the guard on the canvas Excalibur reads pointer input from. Call it\n * before the engine is constructed so the guard is registered first. Safe to\n * call again for the same canvas: it installs once.\n */\nexport function guardPointerButtons(target: EventTarget): void {\n if (guarded.has(target)) return;\n guarded.add(target);\n for (const type of GUARDED_EVENTS) target.addEventListener(type, swallowUnmappedButton, { capture: true });\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAEH;AACO,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,CAAC,CAAC;AACR,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,IAAI,EAAE,CAAC;;AAGT,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAE5F;AACM,SAAU,qBAAqB,CAAC,MAAc,EAAA;AAClD,IAAA,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC;AAClC;AAEA;AACA,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,CAAU;AAE5F,MAAM,OAAO,GAAG,IAAI,OAAO,EAAe;AAE1C;AACA,MAAM,eAAe,GAAG,CAAC;AAEzB;AAC+B;AAC/B,SAAS,WAAW,CAAC,KAAmB,EAAA;AACtC,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,eAAe,KAAK,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,OAAO,KAAK,eAAe,CAAC;AAC5G;AAEA,SAAS,qBAAqB,CAAC,KAAY,EAAA;IACzC,MAAM,OAAO,GAAG,KAAqB;AACrC,IAAA,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,IAAI,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE;IACjF,KAAK,CAAC,cAAc,EAAE;IACtB,KAAK,CAAC,wBAAwB,EAAE;;;;;IAKhC,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,aAAa,EAAE;QAC/C,KAAK,CAAC,aAAa,CAAC,aAAa,CAC/B,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE;AAC3B,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,UAAU,EAAE,IAAI;;;AAGhB,YAAA,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,yBAAyB,CAAC,IAAI;AACtC,YAAA,OAAO,EAAE,eAAe;AACzB,SAAA,CAAC,CACH;IACH;AACF;AAEA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAAmB,EAAA;AACrD,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE;AACzB,IAAA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,cAAc;AAAE,QAAA,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5G;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as ex from "excalibur";
|
|
2
|
+
import type { TowerEngine } from "./TowerEngine";
|
|
3
|
+
/** End a live extend-arrow drag, closing its step. Cleared first, so a step
|
|
4
|
+
* the end closes cannot find the drag still open. */
|
|
5
|
+
export declare function endArrowDrag(engine: TowerEngine): void;
|
|
6
|
+
/** End whatever press is open as a cancel: an extend drag closes its step, a
|
|
7
|
+
* tool press closes its step and places nothing, a pending or showing peek is
|
|
8
|
+
* dismissed, a pan just stops and never taps. A canvas with no press open is
|
|
9
|
+
* left as it is. The contacts stay tracked (a pinch reads them). */
|
|
10
|
+
export declare function endPress(engine: TowerEngine): void;
|
|
11
|
+
/** {@link endPress} for a press whose release was lost: every tracked contact
|
|
12
|
+
* is forgotten with it, since none of them is still down. */
|
|
13
|
+
export declare function cancelPress(engine: TowerEngine): void;
|
|
14
|
+
/** A mouse or pen moving with no button held: if it pressed here, its
|
|
15
|
+
* release went where the canvas never heard it. A touch cannot move without
|
|
16
|
+
* touching, so it never reads as let go. */
|
|
17
|
+
export declare function movesWithButtonUp(native: unknown): boolean;
|
|
18
|
+
/** A primary press: no other pointer of its kind is down, so any contact
|
|
19
|
+
* still tracked lost its release (#1014). A second finger is not primary. */
|
|
20
|
+
export declare function isFirstContact(native: unknown): boolean;
|
|
21
|
+
/** A mouse button the tower has no use for: the back and forward side buttons
|
|
22
|
+
* and any other extra one, which Excalibur reports as an unknown button. The
|
|
23
|
+
* tower read them as a left click, so the back button placed rooms (#2073);
|
|
24
|
+
* their press and release are ignored. A touch also reports an unknown
|
|
25
|
+
* button and stays a press. */
|
|
26
|
+
export declare function isUnusedMouseButton(ev: Pick<ex.PointerEvent, "button" | "pointerType">): boolean;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as ex from 'excalibur';
|
|
2
|
+
import { finishLongPress } from './longPress.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* How a canvas press ends when the canvas never hears its release (#1014,
|
|
6
|
+
* #824).
|
|
7
|
+
*
|
|
8
|
+
* Excalibur listens on the canvas alone and the game sets no pointer capture,
|
|
9
|
+
* so a mouse let go over a panel, a dialog or another window sends its
|
|
10
|
+
* pointer-up somewhere the tower never sees, and a browser can swallow one
|
|
11
|
+
* outright. Without an end, an extend-arrow drag kept billing against its own
|
|
12
|
+
* mark, a tool press kept its undo step open, and a mouse that came back with
|
|
13
|
+
* the button up went on painting, bulldozing or sizing a shaft. Each of the
|
|
14
|
+
* ways in below ends the press as a cancel: the drag or press closes the step
|
|
15
|
+
* it built so far, and nothing is placed.
|
|
16
|
+
*/
|
|
17
|
+
/** `PointerEvent.buttons` when no button is held. */
|
|
18
|
+
const NO_BUTTONS_HELD = 0;
|
|
19
|
+
/** End a live extend-arrow drag, closing its step. Cleared first, so a step
|
|
20
|
+
* the end closes cannot find the drag still open. */
|
|
21
|
+
function endArrowDrag(engine) {
|
|
22
|
+
if (!engine.arrowDrag)
|
|
23
|
+
return;
|
|
24
|
+
engine.arrowDrag = null;
|
|
25
|
+
engine.onExtendEnd?.();
|
|
26
|
+
}
|
|
27
|
+
/** End whatever press is open as a cancel: an extend drag closes its step, a
|
|
28
|
+
* tool press closes its step and places nothing, a pending or showing peek is
|
|
29
|
+
* dismissed, a pan just stops and never taps. A canvas with no press open is
|
|
30
|
+
* left as it is. The contacts stay tracked (a pinch reads them). */
|
|
31
|
+
function endPress(engine) {
|
|
32
|
+
endArrowDrag(engine);
|
|
33
|
+
if (engine.gesture === "action")
|
|
34
|
+
engine.onActionCancel?.();
|
|
35
|
+
finishLongPress(engine);
|
|
36
|
+
engine.gesture = null;
|
|
37
|
+
}
|
|
38
|
+
/** {@link endPress} for a press whose release was lost: every tracked contact
|
|
39
|
+
* is forgotten with it, since none of them is still down. */
|
|
40
|
+
function cancelPress(engine) {
|
|
41
|
+
endPress(engine);
|
|
42
|
+
engine.tracker.reset();
|
|
43
|
+
}
|
|
44
|
+
/** A mouse or pen moving with no button held: if it pressed here, its
|
|
45
|
+
* release went where the canvas never heard it. A touch cannot move without
|
|
46
|
+
* touching, so it never reads as let go. */
|
|
47
|
+
function movesWithButtonUp(native) {
|
|
48
|
+
const ev = (native ?? {});
|
|
49
|
+
return ev.pointerType !== "touch" && ev.buttons === NO_BUTTONS_HELD;
|
|
50
|
+
}
|
|
51
|
+
/** A primary press: no other pointer of its kind is down, so any contact
|
|
52
|
+
* still tracked lost its release (#1014). A second finger is not primary. */
|
|
53
|
+
function isFirstContact(native) {
|
|
54
|
+
return native?.isPrimary === true;
|
|
55
|
+
}
|
|
56
|
+
/** A mouse button the tower has no use for: the back and forward side buttons
|
|
57
|
+
* and any other extra one, which Excalibur reports as an unknown button. The
|
|
58
|
+
* tower read them as a left click, so the back button placed rooms (#2073);
|
|
59
|
+
* their press and release are ignored. A touch also reports an unknown
|
|
60
|
+
* button and stays a press. */
|
|
61
|
+
function isUnusedMouseButton(ev) {
|
|
62
|
+
return ev.pointerType === ex.PointerType.Mouse && ev.button === ex.PointerButton.Unknown;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { cancelPress, endArrowDrag, endPress, isFirstContact, isUnusedMouseButton, movesWithButtonUp };
|
|
66
|
+
//# sourceMappingURL=pressLifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pressLifecycle.js","sources":["../../../src/render/excalibur/pressLifecycle.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport type { TowerEngine } from \"./TowerEngine\";\nimport { finishLongPress } from \"./longPress\";\n\n/**\n * How a canvas press ends when the canvas never hears its release (#1014,\n * #824).\n *\n * Excalibur listens on the canvas alone and the game sets no pointer capture,\n * so a mouse let go over a panel, a dialog or another window sends its\n * pointer-up somewhere the tower never sees, and a browser can swallow one\n * outright. Without an end, an extend-arrow drag kept billing against its own\n * mark, a tool press kept its undo step open, and a mouse that came back with\n * the button up went on painting, bulldozing or sizing a shaft. Each of the\n * ways in below ends the press as a cancel: the drag or press closes the step\n * it built so far, and nothing is placed.\n */\n\n/** `PointerEvent.buttons` when no button is held. */\nconst NO_BUTTONS_HELD = 0;\n\n/** End a live extend-arrow drag, closing its step. Cleared first, so a step\n * the end closes cannot find the drag still open. */\nexport function endArrowDrag(engine: TowerEngine): void {\n if (!engine.arrowDrag) return;\n engine.arrowDrag = null;\n engine.onExtendEnd?.();\n}\n\n/** End whatever press is open as a cancel: an extend drag closes its step, a\n * tool press closes its step and places nothing, a pending or showing peek is\n * dismissed, a pan just stops and never taps. A canvas with no press open is\n * left as it is. The contacts stay tracked (a pinch reads them). */\nexport function endPress(engine: TowerEngine): void {\n endArrowDrag(engine);\n if (engine.gesture === \"action\") engine.onActionCancel?.();\n finishLongPress(engine);\n engine.gesture = null;\n}\n\n/** {@link endPress} for a press whose release was lost: every tracked contact\n * is forgotten with it, since none of them is still down. */\nexport function cancelPress(engine: TowerEngine): void {\n endPress(engine);\n engine.tracker.reset();\n}\n\n/** The DOM event behind a pointer event, as far as these checks read it. */\ninterface NativePointer {\n pointerType?: unknown;\n buttons?: unknown;\n isPrimary?: unknown;\n}\n\n/** A mouse or pen moving with no button held: if it pressed here, its\n * release went where the canvas never heard it. A touch cannot move without\n * touching, so it never reads as let go. */\nexport function movesWithButtonUp(native: unknown): boolean {\n const ev = (native ?? {}) as NativePointer;\n return ev.pointerType !== \"touch\" && ev.buttons === NO_BUTTONS_HELD;\n}\n\n/** A primary press: no other pointer of its kind is down, so any contact\n * still tracked lost its release (#1014). A second finger is not primary. */\nexport function isFirstContact(native: unknown): boolean {\n return (native as NativePointer | undefined)?.isPrimary === true;\n}\n\n/** A mouse button the tower has no use for: the back and forward side buttons\n * and any other extra one, which Excalibur reports as an unknown button. The\n * tower read them as a left click, so the back button placed rooms (#2073);\n * their press and release are ignored. A touch also reports an unknown\n * button and stays a press. */\nexport function isUnusedMouseButton(ev: Pick<ex.PointerEvent, \"button\" | \"pointerType\">): boolean {\n return ev.pointerType === ex.PointerType.Mouse && ev.button === ex.PointerButton.Unknown;\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;AAYG;AAEH;AACA,MAAM,eAAe,GAAG,CAAC;AAEzB;AACsD;AAChD,SAAU,YAAY,CAAC,MAAmB,EAAA;IAC9C,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE;AACvB,IAAA,MAAM,CAAC,SAAS,GAAG,IAAI;AACvB,IAAA,MAAM,CAAC,WAAW,IAAI;AACxB;AAEA;;;AAGqE;AAC/D,SAAU,QAAQ,CAAC,MAAmB,EAAA;IAC1C,YAAY,CAAC,MAAM,CAAC;AACpB,IAAA,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ;AAAE,QAAA,MAAM,CAAC,cAAc,IAAI;IAC1D,eAAe,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,CAAC,OAAO,GAAG,IAAI;AACvB;AAEA;AAC8D;AACxD,SAAU,WAAW,CAAC,MAAmB,EAAA;IAC7C,QAAQ,CAAC,MAAM,CAAC;AAChB,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;AACxB;AASA;;AAE6C;AACvC,SAAU,iBAAiB,CAAC,MAAe,EAAA;AAC/C,IAAA,MAAM,EAAE,IAAI,MAAM,IAAI,EAAE,CAAkB;IAC1C,OAAO,EAAE,CAAC,WAAW,KAAK,OAAO,IAAI,EAAE,CAAC,OAAO,KAAK,eAAe;AACrE;AAEA;AAC8E;AACxE,SAAU,cAAc,CAAC,MAAe,EAAA;AAC5C,IAAA,OAAQ,MAAoC,EAAE,SAAS,KAAK,IAAI;AAClE;AAEA;;;;AAIgC;AAC1B,SAAU,mBAAmB,CAAC,EAAmD,EAAA;AACrF,IAAA,OAAO,EAAE,CAAC,WAAW,KAAK,EAAE,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,aAAa,CAAC,OAAO;AAC1F;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FloorEdge } from "../facadeGeometry";
|
|
2
|
+
import type { TowerEngine } from "./TowerEngine";
|
|
3
|
+
/** The facade's runs as one flat array, `RUN_STRIDE` numbers per run, in
|
|
4
|
+
* floor order (left to right within a floor). */
|
|
5
|
+
export declare function shelterRuns(runs: ReadonlyMap<number, readonly FloorEdge[]>): Int32Array;
|
|
6
|
+
/** Record the tower's current runs as the rain's shelter. */
|
|
7
|
+
export declare function setRainShelter(engine: TowerEngine, runs: ReadonlyMap<number, readonly FloorEdge[]>): void;
|
|
8
|
+
/**
|
|
9
|
+
* Clip `ctx` to the open sky: the view above the ground line, less every
|
|
10
|
+
* on-screen run of the building. Returns false, with nothing clipped, when no
|
|
11
|
+
* sky is on screen (a view of the basements). The caller saves and restores.
|
|
12
|
+
*/
|
|
13
|
+
export declare function clipToOpenSky(engine: TowerEngine, ctx: CanvasRenderingContext2D, viewW: number, viewH: number): boolean;
|
|
14
|
+
/** Index of the first run on floor `floor` or above, by binary search over the
|
|
15
|
+
* floor-sorted shelter array (its length when every run is lower). */
|
|
16
|
+
export declare function firstRunAtOrAbove(runs: Int32Array, floor: number): number;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the rain does not fall (#638). The rain overlay used to cover the
|
|
3
|
+
* whole view, the tower and the basements included; in the original it falls
|
|
4
|
+
* only on the open sky, so the rooms read as dry and indoors. The building is
|
|
5
|
+
* the facade's runs: each above-ground floor row's runs of built tiles, the
|
|
6
|
+
* same runs the fire escapes hang off. A wedding hall's garden crown is not a
|
|
7
|
+
* building row, so rain still falls on it.
|
|
8
|
+
*
|
|
9
|
+
* The runs are flattened once per structural change (`setRainShelter`, from
|
|
10
|
+
* `syncFacade`) into one flat array sorted by floor, so the per-frame clip
|
|
11
|
+
* finds the first on-screen floor by binary search and walks only the rows in
|
|
12
|
+
* view, plain numbers with no allocation.
|
|
13
|
+
*/
|
|
14
|
+
/** Values per run in a shelter array: floor, first tile, exclusive end tile. */
|
|
15
|
+
const RUN_STRIDE = 3;
|
|
16
|
+
const shelters = new WeakMap();
|
|
17
|
+
/** The facade's runs as one flat array, `RUN_STRIDE` numbers per run, in
|
|
18
|
+
* floor order (left to right within a floor). */
|
|
19
|
+
function shelterRuns(runs) {
|
|
20
|
+
let count = 0;
|
|
21
|
+
for (const row of runs.values())
|
|
22
|
+
count += row.length;
|
|
23
|
+
const out = new Int32Array(count * RUN_STRIDE);
|
|
24
|
+
let i = 0;
|
|
25
|
+
const floors = [...runs.keys()].sort((a, b) => a - b);
|
|
26
|
+
for (const floor of floors) {
|
|
27
|
+
for (const run of runs.get(floor) ?? []) {
|
|
28
|
+
out[i++] = floor;
|
|
29
|
+
out[i++] = run.min;
|
|
30
|
+
out[i++] = run.max;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
/** Record the tower's current runs as the rain's shelter. */
|
|
36
|
+
function setRainShelter(engine, runs) {
|
|
37
|
+
shelters.set(engine, shelterRuns(runs));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Clip `ctx` to the open sky: the view above the ground line, less every
|
|
41
|
+
* on-screen run of the building. Returns false, with nothing clipped, when no
|
|
42
|
+
* sky is on screen (a view of the basements). The caller saves and restores.
|
|
43
|
+
*/
|
|
44
|
+
function clipToOpenSky(engine, ctx, viewW, viewH) {
|
|
45
|
+
// Floor f spans world rows from f - 1 (its bottom) to f (its top); the
|
|
46
|
+
// ground line is floor 1's bottom.
|
|
47
|
+
const ground = engine.worldToScreenY(0);
|
|
48
|
+
if (ground <= 0)
|
|
49
|
+
return false;
|
|
50
|
+
const floorH = engine.worldToScreenY(1) - ground; // negative: up the screen
|
|
51
|
+
const x0 = engine.worldToScreenX(0);
|
|
52
|
+
const tileW = engine.worldToScreenX(1) - x0;
|
|
53
|
+
ctx.beginPath();
|
|
54
|
+
ctx.rect(0, 0, viewW, Math.min(ground, viewH));
|
|
55
|
+
const runs = shelters.get(engine);
|
|
56
|
+
if (runs) {
|
|
57
|
+
// Floor rows that can touch the view, widened by one so rounding never
|
|
58
|
+
// drops a row; the exact test is per run below.
|
|
59
|
+
const rows = -floorH;
|
|
60
|
+
const lowest = Math.floor((ground - viewH) / rows);
|
|
61
|
+
const highest = Math.ceil(ground / rows) + 1;
|
|
62
|
+
for (let i = firstRunAtOrAbove(runs, lowest); i < runs.length && runs[i] <= highest; i += RUN_STRIDE) {
|
|
63
|
+
const top = ground + runs[i] * floorH;
|
|
64
|
+
const bottom = top - floorH;
|
|
65
|
+
if (bottom <= 0 || top >= viewH)
|
|
66
|
+
continue; // off screen
|
|
67
|
+
const left = x0 + runs[i + 1] * tileW;
|
|
68
|
+
const right = x0 + runs[i + 2] * tileW;
|
|
69
|
+
if (right <= 0 || left >= viewW)
|
|
70
|
+
continue;
|
|
71
|
+
ctx.rect(left, top, right - left, bottom - top);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Each run lies inside the sky rect on screen, so even-odd cuts it out.
|
|
75
|
+
ctx.clip("evenodd");
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
/** Index of the first run on floor `floor` or above, by binary search over the
|
|
79
|
+
* floor-sorted shelter array (its length when every run is lower). */
|
|
80
|
+
function firstRunAtOrAbove(runs, floor) {
|
|
81
|
+
let lo = 0;
|
|
82
|
+
let hi = runs.length / RUN_STRIDE;
|
|
83
|
+
while (lo < hi) {
|
|
84
|
+
const mid = (lo + hi) >>> 1;
|
|
85
|
+
if (runs[mid * RUN_STRIDE] < floor)
|
|
86
|
+
lo = mid + 1;
|
|
87
|
+
else
|
|
88
|
+
hi = mid;
|
|
89
|
+
}
|
|
90
|
+
return lo * RUN_STRIDE;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { clipToOpenSky, firstRunAtOrAbove, setRainShelter, shelterRuns };
|
|
94
|
+
//# sourceMappingURL=rainShelter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rainShelter.js","sources":["../../../src/render/excalibur/rainShelter.ts"],"sourcesContent":["import type { FloorEdge } from \"../facadeGeometry\";\nimport type { TowerEngine } from \"./TowerEngine\";\n\n/**\n * Where the rain does not fall (#638). The rain overlay used to cover the\n * whole view, the tower and the basements included; in the original it falls\n * only on the open sky, so the rooms read as dry and indoors. The building is\n * the facade's runs: each above-ground floor row's runs of built tiles, the\n * same runs the fire escapes hang off. A wedding hall's garden crown is not a\n * building row, so rain still falls on it.\n *\n * The runs are flattened once per structural change (`setRainShelter`, from\n * `syncFacade`) into one flat array sorted by floor, so the per-frame clip\n * finds the first on-screen floor by binary search and walks only the rows in\n * view, plain numbers with no allocation.\n */\n\n/** Values per run in a shelter array: floor, first tile, exclusive end tile. */\nconst RUN_STRIDE = 3;\n\nconst shelters = new WeakMap<TowerEngine, Int32Array>();\n\n/** The facade's runs as one flat array, `RUN_STRIDE` numbers per run, in\n * floor order (left to right within a floor). */\nexport function shelterRuns(runs: ReadonlyMap<number, readonly FloorEdge[]>): Int32Array {\n let count = 0;\n for (const row of runs.values()) count += row.length;\n const out = new Int32Array(count * RUN_STRIDE);\n let i = 0;\n const floors = [...runs.keys()].sort((a, b) => a - b);\n for (const floor of floors) {\n for (const run of runs.get(floor) ?? []) {\n out[i++] = floor;\n out[i++] = run.min;\n out[i++] = run.max;\n }\n }\n return out;\n}\n\n/** Record the tower's current runs as the rain's shelter. */\nexport function setRainShelter(engine: TowerEngine, runs: ReadonlyMap<number, readonly FloorEdge[]>): void {\n shelters.set(engine, shelterRuns(runs));\n}\n\n/**\n * Clip `ctx` to the open sky: the view above the ground line, less every\n * on-screen run of the building. Returns false, with nothing clipped, when no\n * sky is on screen (a view of the basements). The caller saves and restores.\n */\nexport function clipToOpenSky(engine: TowerEngine, ctx: CanvasRenderingContext2D, viewW: number, viewH: number): boolean {\n // Floor f spans world rows from f - 1 (its bottom) to f (its top); the\n // ground line is floor 1's bottom.\n const ground = engine.worldToScreenY(0);\n if (ground <= 0) return false;\n const floorH = engine.worldToScreenY(1) - ground; // negative: up the screen\n const x0 = engine.worldToScreenX(0);\n const tileW = engine.worldToScreenX(1) - x0;\n ctx.beginPath();\n ctx.rect(0, 0, viewW, Math.min(ground, viewH));\n const runs = shelters.get(engine);\n if (runs) {\n // Floor rows that can touch the view, widened by one so rounding never\n // drops a row; the exact test is per run below.\n const rows = -floorH;\n const lowest = Math.floor((ground - viewH) / rows);\n const highest = Math.ceil(ground / rows) + 1;\n for (let i = firstRunAtOrAbove(runs, lowest); i < runs.length && runs[i] <= highest; i += RUN_STRIDE) {\n const top = ground + runs[i] * floorH;\n const bottom = top - floorH;\n if (bottom <= 0 || top >= viewH) continue; // off screen\n const left = x0 + runs[i + 1] * tileW;\n const right = x0 + runs[i + 2] * tileW;\n if (right <= 0 || left >= viewW) continue;\n ctx.rect(left, top, right - left, bottom - top);\n }\n }\n // Each run lies inside the sky rect on screen, so even-odd cuts it out.\n ctx.clip(\"evenodd\");\n return true;\n}\n\n/** Index of the first run on floor `floor` or above, by binary search over the\n * floor-sorted shelter array (its length when every run is lower). */\nexport function firstRunAtOrAbove(runs: Int32Array, floor: number): number {\n let lo = 0;\n let hi = runs.length / RUN_STRIDE;\n while (lo < hi) {\n const mid = (lo + hi) >>> 1;\n if (runs[mid * RUN_STRIDE] < floor) lo = mid + 1;\n else hi = mid;\n }\n return lo * RUN_STRIDE;\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UnitView } from "../../simport/view";
|
|
2
|
+
/** The scene inputs a settled room's bake reads beyond the unit itself. */
|
|
3
|
+
export interface RoomSigScene {
|
|
4
|
+
hour: number;
|
|
5
|
+
lit: boolean;
|
|
6
|
+
/** This unit is missing from the tower's functional-parking set. Only a
|
|
7
|
+
* settled parking space reads it (see {@link isDeadParking}). */
|
|
8
|
+
unchained: boolean;
|
|
9
|
+
/** 0..1, the garage display fraction. */
|
|
10
|
+
parkingUse: number;
|
|
11
|
+
/** 0..1, the recycling display fraction. */
|
|
12
|
+
recycleFill: number;
|
|
13
|
+
}
|
|
14
|
+
/** A parking space draws the red X when no ramp chain reaches it. Only a
|
|
15
|
+
* SETTLED space counts: a mid-build (or burning) space is left out of the
|
|
16
|
+
* functional set for other reasons and is not a connectivity fault. */
|
|
17
|
+
export declare function isDeadParking(u: UnitView, unchained: boolean): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The re-bake signature of a room: a settled room repaints exactly when this
|
|
20
|
+
* string changes, so it must capture every input the room sprite draws from.
|
|
21
|
+
* The reconcile records it for burning and mid-build rooms too; only a
|
|
22
|
+
* settled room's repaint check reads it.
|
|
23
|
+
* That includes the hour-dependent bits, a commercial unit's open/closed
|
|
24
|
+
* shutter and a home's late-night "asleep" look, otherwise a shop baked closed
|
|
25
|
+
* at dawn would wrongly stay shuttered all day until the next lighting flip.
|
|
26
|
+
* The late-night bit keys on every kind in `LATE_NIGHT_KINDS` (the condo and
|
|
27
|
+
* both rentals, which share its draw), so a rental baked in the evening drops
|
|
28
|
+
* its residents at 23:00 and gets them back at 06:00.
|
|
29
|
+
*/
|
|
30
|
+
export declare function roomSignature(u: UnitView, s: RoomSigScene): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { hasBusinessHours, isOpenAt } from '../../presentation/viewKinds.js';
|
|
2
|
+
import { LATE_NIGHT_KINDS, isLateHour } from '../lateNight.js';
|
|
3
|
+
|
|
4
|
+
/** A parking space draws the red X when no ramp chain reaches it. Only a
|
|
5
|
+
* SETTLED space counts: a mid-build (or burning) space is left out of the
|
|
6
|
+
* functional set for other reasons and is not a connectivity fault. */
|
|
7
|
+
function isDeadParking(u, unchained) {
|
|
8
|
+
return u.kind === "parking" && u.state !== "construction" && u.state !== "fire" && unchained;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The re-bake signature of a room: a settled room repaints exactly when this
|
|
12
|
+
* string changes, so it must capture every input the room sprite draws from.
|
|
13
|
+
* The reconcile records it for burning and mid-build rooms too; only a
|
|
14
|
+
* settled room's repaint check reads it.
|
|
15
|
+
* That includes the hour-dependent bits, a commercial unit's open/closed
|
|
16
|
+
* shutter and a home's late-night "asleep" look, otherwise a shop baked closed
|
|
17
|
+
* at dawn would wrongly stay shuttered all day until the next lighting flip.
|
|
18
|
+
* The late-night bit keys on every kind in `LATE_NIGHT_KINDS` (the condo and
|
|
19
|
+
* both rentals, which share its draw), so a rental baked in the evening drops
|
|
20
|
+
* its residents at 23:00 and gets them back at 06:00.
|
|
21
|
+
*/
|
|
22
|
+
function roomSignature(u, s) {
|
|
23
|
+
let open = "";
|
|
24
|
+
if (hasBusinessHours(u.kind))
|
|
25
|
+
open = isOpenAt(u.kind, s.hour) ? "o" : "c";
|
|
26
|
+
const lateNight = LATE_NIGHT_KINDS.has(u.kind) && isLateHour(s.hour) ? "s" : "";
|
|
27
|
+
const dead = isDeadParking(u, s.unchained) ? "x" : "";
|
|
28
|
+
// Hour-bucketed live-display bits: how full the garage is (cars) and how
|
|
29
|
+
// full the recycling centers are (garbage pile). The scene reconcile
|
|
30
|
+
// (`towerReconcile.syncScene`) runs on the hour, so these advance at the
|
|
31
|
+
// same cadence as open/lateNight.
|
|
32
|
+
let liveBits = "";
|
|
33
|
+
if (u.kind === "parking")
|
|
34
|
+
liveBits = `:p${Math.round(s.parkingUse * 6)}`;
|
|
35
|
+
else if (u.kind === "recycling")
|
|
36
|
+
liveBits = `:r${Math.round(s.recycleFill * 8)}`;
|
|
37
|
+
// Include `outForMeal` in the key: the room art reads visible occupants
|
|
38
|
+
// via `roomOccupants` (occupants minus outForMeal), so it must
|
|
39
|
+
// re-raster when the visible dip changes even though canonical
|
|
40
|
+
// `u.occupants` did not. Without this, an office bakes at t=0 with six
|
|
41
|
+
// workers and would keep rendering six through the whole meal peak.
|
|
42
|
+
// `subtype` is in the key because retail variants draw differently and the
|
|
43
|
+
// inspector's "Change variety" action swaps it at runtime; without it the
|
|
44
|
+
// reroll would not repaint until another signature bit flips.
|
|
45
|
+
return `${u.state}:${s.lit ? 1 : 0}:${u.width}:${u.occupants}:${u.outForMeal ?? 0}:${u.subtype ?? ""}:${open}${lateNight}${dead}${liveBits}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { isDeadParking, roomSignature };
|
|
49
|
+
//# sourceMappingURL=roomSignature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomSignature.js","sources":["../../../src/render/excalibur/roomSignature.ts"],"sourcesContent":["import { hasBusinessHours, isOpenAt } from \"../../presentation/viewKinds\";\nimport type { UnitView } from \"../../simport/view\";\nimport { LATE_NIGHT_KINDS, isLateHour } from \"../lateNight\";\n\n/** The scene inputs a settled room's bake reads beyond the unit itself. */\nexport interface RoomSigScene {\n hour: number;\n lit: boolean;\n /** This unit is missing from the tower's functional-parking set. Only a\n * settled parking space reads it (see {@link isDeadParking}). */\n unchained: boolean;\n /** 0..1, the garage display fraction. */\n parkingUse: number;\n /** 0..1, the recycling display fraction. */\n recycleFill: number;\n}\n\n/** A parking space draws the red X when no ramp chain reaches it. Only a\n * SETTLED space counts: a mid-build (or burning) space is left out of the\n * functional set for other reasons and is not a connectivity fault. */\nexport function isDeadParking(u: UnitView, unchained: boolean): boolean {\n return u.kind === \"parking\" && u.state !== \"construction\" && u.state !== \"fire\" && unchained;\n}\n\n/**\n * The re-bake signature of a room: a settled room repaints exactly when this\n * string changes, so it must capture every input the room sprite draws from.\n * The reconcile records it for burning and mid-build rooms too; only a\n * settled room's repaint check reads it.\n * That includes the hour-dependent bits, a commercial unit's open/closed\n * shutter and a home's late-night \"asleep\" look, otherwise a shop baked closed\n * at dawn would wrongly stay shuttered all day until the next lighting flip.\n * The late-night bit keys on every kind in `LATE_NIGHT_KINDS` (the condo and\n * both rentals, which share its draw), so a rental baked in the evening drops\n * its residents at 23:00 and gets them back at 06:00.\n */\nexport function roomSignature(u: UnitView, s: RoomSigScene): string {\n let open = \"\";\n if (hasBusinessHours(u.kind)) open = isOpenAt(u.kind, s.hour) ? \"o\" : \"c\";\n const lateNight = LATE_NIGHT_KINDS.has(u.kind) && isLateHour(s.hour) ? \"s\" : \"\";\n const dead = isDeadParking(u, s.unchained) ? \"x\" : \"\";\n // Hour-bucketed live-display bits: how full the garage is (cars) and how\n // full the recycling centers are (garbage pile). The scene reconcile\n // (`towerReconcile.syncScene`) runs on the hour, so these advance at the\n // same cadence as open/lateNight.\n let liveBits = \"\";\n if (u.kind === \"parking\") liveBits = `:p${Math.round(s.parkingUse * 6)}`;\n else if (u.kind === \"recycling\") liveBits = `:r${Math.round(s.recycleFill * 8)}`;\n // Include `outForMeal` in the key: the room art reads visible occupants\n // via `roomOccupants` (occupants minus outForMeal), so it must\n // re-raster when the visible dip changes even though canonical\n // `u.occupants` did not. Without this, an office bakes at t=0 with six\n // workers and would keep rendering six through the whole meal peak.\n // `subtype` is in the key because retail variants draw differently and the\n // inspector's \"Change variety\" action swaps it at runtime; without it the\n // reroll would not repaint until another signature bit flips.\n return `${u.state}:${s.lit ? 1 : 0}:${u.width}:${u.occupants}:${u.outForMeal ?? 0}:${u.subtype ?? \"\"}:${open}${lateNight}${dead}${liveBits}`;\n}\n"],"names":[],"mappings":";;;AAiBA;;AAEwE;AAClE,SAAU,aAAa,CAAC,CAAW,EAAE,SAAkB,EAAA;AAC3D,IAAA,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,cAAc,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,IAAI,SAAS;AAC9F;AAEA;;;;;;;;;;;AAWG;AACG,SAAU,aAAa,CAAC,CAAW,EAAE,CAAe,EAAA;IACxD,IAAI,IAAI,GAAG,EAAE;AACb,IAAA,IAAI,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;AAAE,QAAA,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG;IACzE,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE;AAC/E,IAAA,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,EAAE;;;;;IAKrD,IAAI,QAAQ,GAAG,EAAE;AACjB,IAAA,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;AAAE,QAAA,QAAQ,GAAG,CAAA,EAAA,EAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE;AACnE,SAAA,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW;AAAE,QAAA,QAAQ,GAAG,CAAA,EAAA,EAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;;;;;;;;;IAShF,OAAO,CAAA,EAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAA,CAAA,EAAI,CAAC,CAAC,SAAS,CAAA,CAAA,EAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAA,CAAA,EAAI,CAAC,CAAC,OAAO,IAAI,EAAE,CAAA,CAAA,EAAI,IAAI,CAAA,EAAG,SAAS,GAAG,IAAI,CAAA,EAAG,QAAQ,CAAA,CAAE;AAC9I;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `TowerEngine.builtRev` while the scene has not baked the tower it holds: a
|
|
2
|
+
* new engine, or a `setSim` (another tower, a tooling restore, or a step that
|
|
3
|
+
* did not raise the revision, which rebuilds the scene). The next scene sync
|
|
4
|
+
* is then the initial bake, which leaves every region to the drain. */
|
|
5
|
+
export declare const NOT_BAKED = -1;
|
|
6
|
+
/** Whether the scene has not yet baked the tower it holds (see {@link NOT_BAKED}). */
|
|
7
|
+
export declare function awaitsInitialBake(engine: {
|
|
8
|
+
readonly builtRev: number;
|
|
9
|
+
}): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** `TowerEngine.builtRev` while the scene has not baked the tower it holds: a
|
|
2
|
+
* new engine, or a `setSim` (another tower, a tooling restore, or a step that
|
|
3
|
+
* did not raise the revision, which rebuilds the scene). The next scene sync
|
|
4
|
+
* is then the initial bake, which leaves every region to the drain. */
|
|
5
|
+
const NOT_BAKED = -1;
|
|
6
|
+
/** Whether the scene has not yet baked the tower it holds (see {@link NOT_BAKED}). */
|
|
7
|
+
function awaitsInitialBake(engine) {
|
|
8
|
+
return engine.builtRev === NOT_BAKED;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { NOT_BAKED, awaitsInitialBake };
|
|
12
|
+
//# sourceMappingURL=sceneBake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sceneBake.js","sources":["../../../src/render/excalibur/sceneBake.ts"],"sourcesContent":["/** `TowerEngine.builtRev` while the scene has not baked the tower it holds: a\n * new engine, or a `setSim` (another tower, a tooling restore, or a step that\n * did not raise the revision, which rebuilds the scene). The next scene sync\n * is then the initial bake, which leaves every region to the drain. */\nexport const NOT_BAKED = -1;\n\n/** Whether the scene has not yet baked the tower it holds (see {@link NOT_BAKED}). */\nexport function awaitsInitialBake(engine: { readonly builtRev: number }): boolean {\n return engine.builtRev === NOT_BAKED;\n}\n"],"names":[],"mappings":"AAAA;;;AAGwE;AACjE,MAAM,SAAS,GAAG,CAAC;AAE1B;AACM,SAAU,iBAAiB,CAAC,MAAqC,EAAA;AACrE,IAAA,OAAO,MAAM,CAAC,QAAQ,KAAK,SAAS;AACtC;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UnitView } from "../../simport/view";
|
|
2
|
+
/** The tile span of a floor's rooms: left edge, right edge (exclusive). The
|
|
3
|
+
* run the thief takes across one tower's part of a floor (#1886). */
|
|
4
|
+
export interface ThiefSpan {
|
|
5
|
+
readonly left: number;
|
|
6
|
+
readonly right: number;
|
|
7
|
+
}
|
|
8
|
+
/** The tile span of the rooms on `floor` (left edge, right edge), or null
|
|
9
|
+
* when it has none. Bare floor and lobby tiles do not count, the same span
|
|
10
|
+
* the bomb search's guards walk. Given `x`, only the rooms on the run of
|
|
11
|
+
* floor and lobby tiles holding that tile count: one tower's part of the
|
|
12
|
+
* floor on a lot with several. One pass over the units, made once when a
|
|
13
|
+
* thief appears (at most once a game day), never per frame. */
|
|
14
|
+
export declare function floorRoomSpan(units: ReadonlyArray<Pick<UnitView, "kind" | "floor" | "x" | "width">>, floor: number, x?: number): ThiefSpan | null;
|
|
15
|
+
/** Where the thief is, in tiles, a fraction `p` of the way through his run:
|
|
16
|
+
* he comes off the emergency stairs just left of the floor's rooms (where
|
|
17
|
+
* the guards climb) and runs the rooms to their right edge. */
|
|
18
|
+
export declare function thiefX(span: ThiefSpan, p: number): number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The tile span of the rooms on `floor` (left edge, right edge), or null
|
|
2
|
+
* when it has none. Bare floor and lobby tiles do not count, the same span
|
|
3
|
+
* the bomb search's guards walk. Given `x`, only the rooms on the run of
|
|
4
|
+
* floor and lobby tiles holding that tile count: one tower's part of the
|
|
5
|
+
* floor on a lot with several. One pass over the units, made once when a
|
|
6
|
+
* thief appears (at most once a game day), never per frame. */
|
|
7
|
+
function floorRoomSpan(units, floor, x) {
|
|
8
|
+
const run = x === undefined || !Number.isFinite(x) ? null : structuralRun(units, floor, x);
|
|
9
|
+
let span = null;
|
|
10
|
+
for (const u of units) {
|
|
11
|
+
if (u.floor !== floor || u.kind === "floor" || u.kind === "lobby")
|
|
12
|
+
continue;
|
|
13
|
+
if (run && (u.x > run.right || u.x + u.width <= run.left))
|
|
14
|
+
continue;
|
|
15
|
+
if (!span)
|
|
16
|
+
span = { left: u.x, right: u.x + u.width };
|
|
17
|
+
else
|
|
18
|
+
span = { left: Math.min(span.left, u.x), right: Math.max(span.right, u.x + u.width) };
|
|
19
|
+
}
|
|
20
|
+
return span;
|
|
21
|
+
}
|
|
22
|
+
/** The run of floor and lobby tiles on `floor` that holds tile `x`, as its
|
|
23
|
+
* first and last tiles, or null when no such tile is there. */
|
|
24
|
+
function structuralRun(units, floor, x) {
|
|
25
|
+
const pieces = [];
|
|
26
|
+
for (const u of units) {
|
|
27
|
+
if (u.floor === floor && (u.kind === "floor" || u.kind === "lobby"))
|
|
28
|
+
pieces.push([u.x, u.x + u.width - 1]);
|
|
29
|
+
}
|
|
30
|
+
pieces.sort((a, b) => a[0] - b[0]);
|
|
31
|
+
let run = null;
|
|
32
|
+
for (const [first, last] of pieces) {
|
|
33
|
+
if (run && first <= run.right + 1)
|
|
34
|
+
run = { left: run.left, right: Math.max(run.right, last) };
|
|
35
|
+
else if (run && run.left <= x && x <= run.right)
|
|
36
|
+
return run;
|
|
37
|
+
else
|
|
38
|
+
run = { left: first, right: last };
|
|
39
|
+
}
|
|
40
|
+
return run && run.left <= x && x <= run.right ? run : null;
|
|
41
|
+
}
|
|
42
|
+
/** Where the thief is, in tiles, a fraction `p` of the way through his run:
|
|
43
|
+
* he comes off the emergency stairs just left of the floor's rooms (where
|
|
44
|
+
* the guards climb) and runs the rooms to their right edge. */
|
|
45
|
+
function thiefX(span, p) {
|
|
46
|
+
const from = span.left - 1;
|
|
47
|
+
return from + (span.right - from) * Math.min(1, Math.max(0, p));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { floorRoomSpan, thiefX };
|
|
51
|
+
//# sourceMappingURL=thiefSpan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thiefSpan.js","sources":["../../../src/render/excalibur/thiefSpan.ts"],"sourcesContent":["import type { UnitView } from \"../../simport/view\";\n\n/** The tile span of a floor's rooms: left edge, right edge (exclusive). The\n * run the thief takes across one tower's part of a floor (#1886). */\nexport interface ThiefSpan {\n readonly left: number;\n readonly right: number;\n}\n\n/** The tile span of the rooms on `floor` (left edge, right edge), or null\n * when it has none. Bare floor and lobby tiles do not count, the same span\n * the bomb search's guards walk. Given `x`, only the rooms on the run of\n * floor and lobby tiles holding that tile count: one tower's part of the\n * floor on a lot with several. One pass over the units, made once when a\n * thief appears (at most once a game day), never per frame. */\nexport function floorRoomSpan(\n units: ReadonlyArray<Pick<UnitView, \"kind\" | \"floor\" | \"x\" | \"width\">>,\n floor: number,\n x?: number,\n): ThiefSpan | null {\n const run = x === undefined || !Number.isFinite(x) ? null : structuralRun(units, floor, x);\n let span: ThiefSpan | null = null;\n for (const u of units) {\n if (u.floor !== floor || u.kind === \"floor\" || u.kind === \"lobby\") continue;\n if (run && (u.x > run.right || u.x + u.width <= run.left)) continue;\n if (!span) span = { left: u.x, right: u.x + u.width };\n else span = { left: Math.min(span.left, u.x), right: Math.max(span.right, u.x + u.width) };\n }\n return span;\n}\n\n/** The run of floor and lobby tiles on `floor` that holds tile `x`, as its\n * first and last tiles, or null when no such tile is there. */\nfunction structuralRun(\n units: ReadonlyArray<Pick<UnitView, \"kind\" | \"floor\" | \"x\" | \"width\">>,\n floor: number,\n x: number,\n): ThiefSpan | null {\n const pieces: Array<[number, number]> = [];\n for (const u of units) {\n if (u.floor === floor && (u.kind === \"floor\" || u.kind === \"lobby\")) pieces.push([u.x, u.x + u.width - 1]);\n }\n pieces.sort((a, b) => a[0] - b[0]);\n let run: ThiefSpan | null = null;\n for (const [first, last] of pieces) {\n if (run && first <= run.right + 1) run = { left: run.left, right: Math.max(run.right, last) };\n else if (run && run.left <= x && x <= run.right) return run;\n else run = { left: first, right: last };\n }\n return run && run.left <= x && x <= run.right ? run : null;\n}\n\n/** Where the thief is, in tiles, a fraction `p` of the way through his run:\n * he comes off the emergency stairs just left of the floor's rooms (where\n * the guards climb) and runs the rooms to their right edge. */\nexport function thiefX(span: ThiefSpan, p: number): number {\n const from = span.left - 1;\n return from + (span.right - from) * Math.min(1, Math.max(0, p));\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as ex from "excalibur";
|
|
2
|
+
import type { SkyBridgeView } from "../../simport/view";
|
|
3
|
+
import { type BridgePart } from "../sprites/structure/skyBridge";
|
|
4
|
+
/**
|
|
5
|
+
* The sky bridge tiles of the structure pass (Modern): which lobby cells are a
|
|
6
|
+
* bridge in a drawn look and where each sits on its bridge, and the shared
|
|
7
|
+
* baked canvas for each look, lighting, place and part. Each bridge is drawn
|
|
8
|
+
* as one picture (its art is spaced to the span), so a tile's canvas depends
|
|
9
|
+
* on its place `i` on an `n`-tile bridge. The canvases are pure functions of
|
|
10
|
+
* their key, so one cache serves every tower and every scene; a bridge in the
|
|
11
|
+
* plain lobby look keeps the lobby tile.
|
|
12
|
+
*/
|
|
13
|
+
/** A bridge tile in a drawn look: the look's name, the tile's place on its
|
|
14
|
+
* bridge from the left (0 up) and the bridge's span in tiles. */
|
|
15
|
+
export interface BridgeCell {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly i: number;
|
|
18
|
+
readonly n: number;
|
|
19
|
+
}
|
|
20
|
+
/** The empty look map of a tower that has no bridges to read (Classic). */
|
|
21
|
+
export declare const NO_BRIDGE_LOOKS: ReadonlyMap<number, BridgeCell>;
|
|
22
|
+
/** Each bridge tile drawn in a look, keyed by {@link bridgeCellKey}. Built
|
|
23
|
+
* once per full structure pass from the view's bridges, a handful of runs. */
|
|
24
|
+
export declare function bridgeLookCells(bridges: readonly SkyBridgeView[], looks: readonly string[] | undefined): Map<number, BridgeCell>;
|
|
25
|
+
/** The key of a cell in {@link bridgeLookCells}: a lot is far narrower than
|
|
26
|
+
* the multiplier, so floor and column never collide. */
|
|
27
|
+
export declare function bridgeCellKey(floor: number, x: number): number;
|
|
28
|
+
/** The baked canvas of bridge tile `cell` for this lighting: its own story
|
|
29
|
+
* (`deck`) or the underside in the open-air cell below it (`under`). */
|
|
30
|
+
export declare function bridgeTileGfx(cell: BridgeCell, lit: boolean, part?: BridgePart): ex.Canvas;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as ex from 'excalibur';
|
|
2
|
+
import { TILE, FLOOR } from '../scale.js';
|
|
3
|
+
import { drawsBridgeLook, drawBridgeTile } from '../sprites/structure/skyBridge.js';
|
|
4
|
+
|
|
5
|
+
const baked = new Map();
|
|
6
|
+
/** The empty look map of a tower that has no bridges to read (Classic). */
|
|
7
|
+
const NO_BRIDGE_LOOKS = new Map();
|
|
8
|
+
/** Each bridge tile drawn in a look, keyed by {@link bridgeCellKey}. Built
|
|
9
|
+
* once per full structure pass from the view's bridges, a handful of runs. */
|
|
10
|
+
function bridgeLookCells(bridges, looks) {
|
|
11
|
+
const cells = new Map();
|
|
12
|
+
if (!looks)
|
|
13
|
+
return cells;
|
|
14
|
+
for (const b of bridges) {
|
|
15
|
+
const name = looks[b.look];
|
|
16
|
+
if (name === undefined || !drawsBridgeLook(name))
|
|
17
|
+
continue;
|
|
18
|
+
const n = b.to - b.from;
|
|
19
|
+
for (let x = b.from; x < b.to; x++)
|
|
20
|
+
cells.set(bridgeCellKey(b.floor, x), { name, i: x - b.from, n });
|
|
21
|
+
}
|
|
22
|
+
return cells;
|
|
23
|
+
}
|
|
24
|
+
/** The key of a cell in {@link bridgeLookCells}: a lot is far narrower than
|
|
25
|
+
* the multiplier, so floor and column never collide. */
|
|
26
|
+
function bridgeCellKey(floor, x) {
|
|
27
|
+
return floor * 65536 + x;
|
|
28
|
+
}
|
|
29
|
+
/** The baked canvas of bridge tile `cell` for this lighting: its own story
|
|
30
|
+
* (`deck`) or the underside in the open-air cell below it (`under`). */
|
|
31
|
+
function bridgeTileGfx(cell, lit, part = "deck") {
|
|
32
|
+
const { name, i, n } = cell;
|
|
33
|
+
const key = `${name}|${lit ? 1 : 0}|${i}|${n}|${part}`;
|
|
34
|
+
let gfx = baked.get(key);
|
|
35
|
+
if (!gfx) {
|
|
36
|
+
gfx = new ex.Canvas({ width: TILE, height: FLOOR, cache: true, draw: (ctx) => drawBridgeTile(ctx, name, i, n, lit, TILE, FLOOR, part) });
|
|
37
|
+
baked.set(key, gfx);
|
|
38
|
+
}
|
|
39
|
+
return gfx;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { NO_BRIDGE_LOOKS, bridgeCellKey, bridgeLookCells, bridgeTileGfx };
|
|
43
|
+
//# sourceMappingURL=towerBridgeTiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"towerBridgeTiles.js","sources":["../../../src/render/excalibur/towerBridgeTiles.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport { FLOOR, TILE } from \"../scale\";\nimport type { SkyBridgeView } from \"../../simport/view\";\nimport { drawBridgeTile, drawsBridgeLook, type BridgePart } from \"../sprites/structure/skyBridge\";\n\n/**\n * The sky bridge tiles of the structure pass (Modern): which lobby cells are a\n * bridge in a drawn look and where each sits on its bridge, and the shared\n * baked canvas for each look, lighting, place and part. Each bridge is drawn\n * as one picture (its art is spaced to the span), so a tile's canvas depends\n * on its place `i` on an `n`-tile bridge. The canvases are pure functions of\n * their key, so one cache serves every tower and every scene; a bridge in the\n * plain lobby look keeps the lobby tile.\n */\n\n/** A bridge tile in a drawn look: the look's name, the tile's place on its\n * bridge from the left (0 up) and the bridge's span in tiles. */\nexport interface BridgeCell {\n readonly name: string;\n readonly i: number;\n readonly n: number;\n}\n\nconst baked = new Map<string, ex.Canvas>();\n\n/** The empty look map of a tower that has no bridges to read (Classic). */\nexport const NO_BRIDGE_LOOKS: ReadonlyMap<number, BridgeCell> = new Map();\n\n/** Each bridge tile drawn in a look, keyed by {@link bridgeCellKey}. Built\n * once per full structure pass from the view's bridges, a handful of runs. */\nexport function bridgeLookCells(bridges: readonly SkyBridgeView[], looks: readonly string[] | undefined): Map<number, BridgeCell> {\n const cells = new Map<number, BridgeCell>();\n if (!looks) return cells;\n for (const b of bridges) {\n const name = looks[b.look];\n if (name === undefined || !drawsBridgeLook(name)) continue;\n const n = b.to - b.from;\n for (let x = b.from; x < b.to; x++) cells.set(bridgeCellKey(b.floor, x), { name, i: x - b.from, n });\n }\n return cells;\n}\n\n/** The key of a cell in {@link bridgeLookCells}: a lot is far narrower than\n * the multiplier, so floor and column never collide. */\nexport function bridgeCellKey(floor: number, x: number): number {\n return floor * 65_536 + x;\n}\n\n/** The baked canvas of bridge tile `cell` for this lighting: its own story\n * (`deck`) or the underside in the open-air cell below it (`under`). */\nexport function bridgeTileGfx(cell: BridgeCell, lit: boolean, part: BridgePart = \"deck\"): ex.Canvas {\n const { name, i, n } = cell;\n const key = `${name}|${lit ? 1 : 0}|${i}|${n}|${part}`;\n let gfx = baked.get(key);\n if (!gfx) {\n gfx = new ex.Canvas({ width: TILE, height: FLOOR, cache: true, draw: (ctx) => drawBridgeTile(ctx, name, i, n, lit, TILE, FLOOR, part) });\n baked.set(key, gfx);\n }\n return gfx;\n}\n"],"names":[],"mappings":";;;;AAuBA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAqB;AAE1C;AACO,MAAM,eAAe,GAAoC,IAAI,GAAG;AAEvE;AAC+E;AACzE,SAAU,eAAe,CAAC,OAAiC,EAAE,KAAoC,EAAA;AACrG,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB;AAC3C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,KAAK;AACxB,IAAA,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1B,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAAE;QAClD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI;AACvB,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;YAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;IACtG;AACA,IAAA,OAAO,KAAK;AACd;AAEA;AACyD;AACnD,SAAU,aAAa,CAAC,KAAa,EAAE,CAAS,EAAA;AACpD,IAAA,OAAO,KAAK,GAAG,KAAM,GAAG,CAAC;AAC3B;AAEA;AACyE;AACnE,SAAU,aAAa,CAAC,IAAgB,EAAE,GAAY,EAAE,OAAmB,MAAM,EAAA;IACrF,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI;IAC3B,MAAM,GAAG,GAAG,CAAA,EAAG,IAAI,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA,CAAA,EAAI,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE;IACtD,IAAI,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACxB,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;AACxI,QAAA,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;IACrB;AACA,IAAA,OAAO,GAAG;AACZ;;"}
|