@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,126 @@
|
|
|
1
|
+
import * as ex from 'excalibur';
|
|
2
|
+
import { castIndex } from '../pixelSprites/people.js';
|
|
3
|
+
import { FIGURE_ANCHOR, FIGURE_H, FIGURE_W } from './peopleGfx.js';
|
|
4
|
+
import { Z } from '../depthPlanes.js';
|
|
5
|
+
import { coveredUpperStories, trafficLots, lotCovered } from './towerCrowdLayout.js';
|
|
6
|
+
import { FLOOR } from '../scale.js';
|
|
7
|
+
import { towerCatalog } from '../../catalog/towerCatalog.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Construction of the decorative passers-by: figures that loiter in a short
|
|
11
|
+
* stretch of corridor for life, but are not people the engine knows about.
|
|
12
|
+
* Split out of `towerCrowd.ts` so the per-frame motion path and this
|
|
13
|
+
* build-once path stay separately readable.
|
|
14
|
+
*
|
|
15
|
+
* What they may do is set by #2091, after a player said they hid the traffic:
|
|
16
|
+
* - A Classic tower builds none, because SimTower had none. The catalog says
|
|
17
|
+
* so (`rules.decorativePassersBy`), and nothing is built and then hidden.
|
|
18
|
+
* - A Modern tower builds them only in corridors, never in a lobby or on a
|
|
19
|
+
* stair or escalator, and never on a lot where a player reads traffic
|
|
20
|
+
* (an elevator landing, a flight's landing, a shop's front; see
|
|
21
|
+
* `trafficLots`). There are half as many as the old corridor rule.
|
|
22
|
+
* - `updateMotion` next door shows a floor's figures only while that floor has
|
|
23
|
+
* live occupants, and hides them all when the Settings switch is off or
|
|
24
|
+
* reduced motion is on.
|
|
25
|
+
*
|
|
26
|
+
* This runs once per rebuild, not per frame: it reads the tower's layout and
|
|
27
|
+
* gives each figure a cast look; the frame loop picks its walk frame.
|
|
28
|
+
* Baking none of its own means it runs under happy-dom, so it is unit-tested in
|
|
29
|
+
* `towerWalkerBuild.test.ts`.
|
|
30
|
+
*/
|
|
31
|
+
/** The most figures one corridor run gets, and how many per tile of run. Half
|
|
32
|
+
* of the old 8 and 0.14 (#2091). */
|
|
33
|
+
const PASSERS_PER_RUN_CAP = 4;
|
|
34
|
+
const PASSERS_PER_TILE = 0.07;
|
|
35
|
+
/** The most figures a whole tower gets. */
|
|
36
|
+
const PASSERS_BUDGET = 200;
|
|
37
|
+
function buildWalkers(engine) {
|
|
38
|
+
const catalog = towerCatalog(engine.sim);
|
|
39
|
+
if (!catalog.rules.decorativePassersBy)
|
|
40
|
+
return;
|
|
41
|
+
const tower = engine.sim.tower;
|
|
42
|
+
const coveredRows = coveredUpperStories(tower.units, catalog);
|
|
43
|
+
const traffic = trafficLots(tower.transports, tower.units, catalog);
|
|
44
|
+
const byFloor = new Map();
|
|
45
|
+
for (const u of tower.units) {
|
|
46
|
+
// Corridors only: the bare floor lots between rooms. A lobby is where the
|
|
47
|
+
// engine's own commuters cross, so it gets no decorative figure.
|
|
48
|
+
if (u.kind !== "floor")
|
|
49
|
+
continue;
|
|
50
|
+
if (lotCovered(coveredRows, u.floor, u.x))
|
|
51
|
+
continue; // upper story of a multi-floor facility
|
|
52
|
+
if (traffic.get(u.floor)?.has(u.x))
|
|
53
|
+
continue;
|
|
54
|
+
let row = byFloor.get(u.floor);
|
|
55
|
+
if (!row)
|
|
56
|
+
byFloor.set(u.floor, (row = new Set()));
|
|
57
|
+
row.add(u.x);
|
|
58
|
+
}
|
|
59
|
+
let budget = PASSERS_BUDGET;
|
|
60
|
+
for (const [floor, row] of byFloor) {
|
|
61
|
+
for (const run of mergeRuns(floor, row)) {
|
|
62
|
+
if (budget <= 0)
|
|
63
|
+
return;
|
|
64
|
+
const wTiles = run.x1 - run.x0 + 1;
|
|
65
|
+
const count = Math.min(PASSERS_PER_RUN_CAP, Math.floor(wTiles * PASSERS_PER_TILE));
|
|
66
|
+
const foot = engine.worldYTop(floor) + FLOOR - 3;
|
|
67
|
+
const x0w = engine.worldX(run.x0) + 3;
|
|
68
|
+
const x1w = engine.worldX(run.x1 + 1) - 3;
|
|
69
|
+
const runW = x1w - x0w;
|
|
70
|
+
for (let i = 0; i < count && budget > 0; i++, budget--) {
|
|
71
|
+
const seed = (floor * 131 + run.x0 * 7 + i * 53) | 0;
|
|
72
|
+
const rank = (i + 0.5) / count; // only the first few show until the floor fills
|
|
73
|
+
// Loiter in a short stretch around a spread-out anchor, so a lone
|
|
74
|
+
// figure shuffles in place instead of sprinting the whole floor. The
|
|
75
|
+
// span is clamped to the run, so a figure never paces past its ends
|
|
76
|
+
// onto a traffic lot.
|
|
77
|
+
const anchor = x0w + rank * runW;
|
|
78
|
+
const half = Math.min(14, runW / 2);
|
|
79
|
+
spawnWalker(engine, Math.max(x0w, anchor - half), Math.min(x1w, anchor + half), foot, seed, 7 + (Math.abs(seed) % 6), rank, floor);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function spawnWalker(engine, x0w, x1w, yw, seed, speed, rank, floor) {
|
|
85
|
+
// Actor bounds track the shared figure canvas (see reconcileCrowd); the
|
|
86
|
+
// frame loop picks the bake, since the walk frame moves every beat.
|
|
87
|
+
const a = new ex.Actor({ pos: ex.vec(x0w, yw), width: FIGURE_W, height: FIGURE_H, anchor: FIGURE_ANCHOR, z: Z.walker });
|
|
88
|
+
engine.engine.add(a);
|
|
89
|
+
engine.walkers.push({
|
|
90
|
+
actor: a,
|
|
91
|
+
look: castIndex(seed),
|
|
92
|
+
key: -1,
|
|
93
|
+
x0w,
|
|
94
|
+
x1w,
|
|
95
|
+
yw,
|
|
96
|
+
speed,
|
|
97
|
+
dir: seed % 2 === 0 ? 1 : -1,
|
|
98
|
+
phase: (Math.abs(seed) % 100) / 100,
|
|
99
|
+
rank,
|
|
100
|
+
floor,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** The contiguous runs of a floor's corridor lots. */
|
|
104
|
+
function mergeRuns(floor, row) {
|
|
105
|
+
const xs = [...row].sort((a, b) => a - b);
|
|
106
|
+
const runs = [];
|
|
107
|
+
if (xs.length === 0)
|
|
108
|
+
return runs;
|
|
109
|
+
let start = xs[0];
|
|
110
|
+
let prev = xs[0];
|
|
111
|
+
for (let i = 1; i < xs.length; i++) {
|
|
112
|
+
const x = xs[i];
|
|
113
|
+
if (x === prev + 1) {
|
|
114
|
+
prev = x;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
runs.push({ floor, x0: start, x1: prev });
|
|
118
|
+
start = prev = x;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
runs.push({ floor, x0: start, x1: prev });
|
|
122
|
+
return runs;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { PASSERS_BUDGET, PASSERS_PER_RUN_CAP, PASSERS_PER_TILE, buildWalkers };
|
|
126
|
+
//# sourceMappingURL=towerWalkerBuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"towerWalkerBuild.js","sources":["../../../src/render/excalibur/towerWalkerBuild.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport { castIndex } from \"../pixelSprites/people\";\nimport { FIGURE_ANCHOR, FIGURE_H, FIGURE_W } from \"./peopleGfx\";\nimport { Z } from \"../depthPlanes\";\nimport { coveredUpperStories, lotCovered, trafficLots } from \"./towerCrowdLayout\";\nimport { FLOOR } from \"../scale\";\nimport type { TowerEngine } from \"./TowerEngine\";\nimport { towerCatalog } from \"../../catalog/towerCatalog\";\n\n/**\n * Construction of the decorative passers-by: figures that loiter in a short\n * stretch of corridor for life, but are not people the engine knows about.\n * Split out of `towerCrowd.ts` so the per-frame motion path and this\n * build-once path stay separately readable.\n *\n * What they may do is set by #2091, after a player said they hid the traffic:\n * - A Classic tower builds none, because SimTower had none. The catalog says\n * so (`rules.decorativePassersBy`), and nothing is built and then hidden.\n * - A Modern tower builds them only in corridors, never in a lobby or on a\n * stair or escalator, and never on a lot where a player reads traffic\n * (an elevator landing, a flight's landing, a shop's front; see\n * `trafficLots`). There are half as many as the old corridor rule.\n * - `updateMotion` next door shows a floor's figures only while that floor has\n * live occupants, and hides them all when the Settings switch is off or\n * reduced motion is on.\n *\n * This runs once per rebuild, not per frame: it reads the tower's layout and\n * gives each figure a cast look; the frame loop picks its walk frame.\n * Baking none of its own means it runs under happy-dom, so it is unit-tested in\n * `towerWalkerBuild.test.ts`.\n */\n\n/** The most figures one corridor run gets, and how many per tile of run. Half\n * of the old 8 and 0.14 (#2091). */\nexport const PASSERS_PER_RUN_CAP = 4;\nexport const PASSERS_PER_TILE = 0.07;\n/** The most figures a whole tower gets. */\nexport const PASSERS_BUDGET = 200;\n\n/** One contiguous corridor stretch on a floor, in tiles (inclusive). */\ninterface Run {\n floor: number;\n x0: number;\n x1: number;\n}\n\nexport function buildWalkers(engine: TowerEngine): void {\n const catalog = towerCatalog(engine.sim);\n if (!catalog.rules.decorativePassersBy) return;\n const tower = engine.sim.tower;\n const coveredRows = coveredUpperStories(tower.units, catalog);\n const traffic = trafficLots(tower.transports, tower.units, catalog);\n const byFloor = new Map<number, Set<number>>();\n for (const u of tower.units) {\n // Corridors only: the bare floor lots between rooms. A lobby is where the\n // engine's own commuters cross, so it gets no decorative figure.\n if (u.kind !== \"floor\") continue;\n if (lotCovered(coveredRows, u.floor, u.x)) continue; // upper story of a multi-floor facility\n if (traffic.get(u.floor)?.has(u.x)) continue;\n let row = byFloor.get(u.floor);\n if (!row) byFloor.set(u.floor, (row = new Set()));\n row.add(u.x);\n }\n let budget = PASSERS_BUDGET;\n for (const [floor, row] of byFloor) {\n for (const run of mergeRuns(floor, row)) {\n if (budget <= 0) return;\n const wTiles = run.x1 - run.x0 + 1;\n const count = Math.min(PASSERS_PER_RUN_CAP, Math.floor(wTiles * PASSERS_PER_TILE));\n const foot = engine.worldYTop(floor) + FLOOR - 3;\n const x0w = engine.worldX(run.x0) + 3;\n const x1w = engine.worldX(run.x1 + 1) - 3;\n const runW = x1w - x0w;\n for (let i = 0; i < count && budget > 0; i++, budget--) {\n const seed = (floor * 131 + run.x0 * 7 + i * 53) | 0;\n const rank = (i + 0.5) / count; // only the first few show until the floor fills\n // Loiter in a short stretch around a spread-out anchor, so a lone\n // figure shuffles in place instead of sprinting the whole floor. The\n // span is clamped to the run, so a figure never paces past its ends\n // onto a traffic lot.\n const anchor = x0w + rank * runW;\n const half = Math.min(14, runW / 2);\n spawnWalker(engine, Math.max(x0w, anchor - half), Math.min(x1w, anchor + half), foot, seed, 7 + (Math.abs(seed) % 6), rank, floor);\n }\n }\n }\n}\n\nfunction spawnWalker(engine: TowerEngine, x0w: number, x1w: number, yw: number, seed: number, speed: number, rank: number, floor: number): void {\n // Actor bounds track the shared figure canvas (see reconcileCrowd); the\n // frame loop picks the bake, since the walk frame moves every beat.\n const a = new ex.Actor({ pos: ex.vec(x0w, yw), width: FIGURE_W, height: FIGURE_H, anchor: FIGURE_ANCHOR, z: Z.walker });\n engine.engine.add(a);\n engine.walkers.push({\n actor: a,\n look: castIndex(seed),\n key: -1,\n x0w,\n x1w,\n yw,\n speed,\n dir: seed % 2 === 0 ? 1 : -1,\n phase: (Math.abs(seed) % 100) / 100,\n rank,\n floor,\n });\n}\n\n/** The contiguous runs of a floor's corridor lots. */\nfunction mergeRuns(floor: number, row: Set<number>): Run[] {\n const xs = [...row].sort((a, b) => a - b);\n const runs: Run[] = [];\n if (xs.length === 0) return runs;\n let start = xs[0];\n let prev = xs[0];\n for (let i = 1; i < xs.length; i++) {\n const x = xs[i];\n if (x === prev + 1) {\n prev = x;\n } else {\n runs.push({ floor, x0: start, x1: prev });\n start = prev = x;\n }\n }\n runs.push({ floor, x0: start, x1: prev });\n return runs;\n}\n"],"names":[],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAEH;AACqC;AAC9B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,gBAAgB,GAAG;AAChC;AACO,MAAM,cAAc,GAAG;AASxB,SAAU,YAAY,CAAC,MAAmB,EAAA;IAC9C,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,C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GAAG,EAAE,CAAC,CAAC,CAAC;AAChB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClC,QAAA,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACf,QAAA,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE;YAClB,IAAI,GAAG,CAAC;QACV;aAAO;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACzC,YAAA,KAAK,GAAG,IAAI,GAAG,CAAC;QAClB;IACF;AACA,IAAA,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACzC,IAAA,OAAO,IAAI;AACb;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TowerEngine } from "./TowerEngine";
|
|
2
|
+
/**
|
|
3
|
+
* The Traffic readout's spotlight: after a tap on the HUD's "Backed up · B2",
|
|
4
|
+
* the waiting line it names is marked for a few seconds: its stretch of the
|
|
5
|
+
* floor banded red, and its elevator outlined in yellow on that floor only.
|
|
6
|
+
* Never the whole floor or the whole shaft (owner, 2026-11-17: the old band
|
|
7
|
+
* across the lot "highlighted the whole floor, not where the jam is"). The
|
|
8
|
+
* state lives here, keyed by engine, so `TowerEngine` stays a thin shell.
|
|
9
|
+
* Drawing it costs nothing while no spotlight is up: one map lookup per
|
|
10
|
+
* frame.
|
|
11
|
+
*/
|
|
12
|
+
/** A stretch of one floor, in tiles. */
|
|
13
|
+
export interface SpotSpan {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly width: number;
|
|
16
|
+
}
|
|
17
|
+
/** How long the spotlight stays up, in page milliseconds. */
|
|
18
|
+
export declare const SPOTLIGHT_MS = 4000;
|
|
19
|
+
/** Put the spotlight on the line over `span` on `floor`, waiting for the
|
|
20
|
+
* elevator over `shaft`, replacing any still up. */
|
|
21
|
+
export declare function spotlightTraffic(engine: TowerEngine, floor: number, span: SpotSpan, shaft: SpotSpan, nowMs?: number): void;
|
|
22
|
+
/** The floor the spotlight is on, or null when none is up. */
|
|
23
|
+
export declare function trafficSpotlightFloor(engine: TowerEngine): number | null;
|
|
24
|
+
/** How strongly the spotlight shows `ageMs` after it went up: a pulse
|
|
25
|
+
* between 0.6 and 1 (steady at 1 under reduced motion), faded out over its
|
|
26
|
+
* last {@link FADE_MS}; 0 once it is over. */
|
|
27
|
+
export declare function spotlightAlpha(ageMs: number, reducedMotion: boolean): number;
|
|
28
|
+
/** Paint the spotlight, if one is up, and drop it once it is over. */
|
|
29
|
+
export declare function drawTrafficSpotlight(engine: TowerEngine, ctx: CanvasRenderingContext2D, nowMs?: number): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FLOOR, TILE } from '../scale.js';
|
|
2
|
+
|
|
3
|
+
const spots = new WeakMap();
|
|
4
|
+
/** How long the spotlight stays up, in page milliseconds. */
|
|
5
|
+
const SPOTLIGHT_MS = 4000;
|
|
6
|
+
/** The last stretch of it, over which it fades out. */
|
|
7
|
+
const FADE_MS = 600;
|
|
8
|
+
/** Pulses per second while it is up (none under reduced motion). */
|
|
9
|
+
const PULSE_HZ = 1.5;
|
|
10
|
+
/** The line's band: the Map's Jammed red, so the two read as one signal. */
|
|
11
|
+
const BAND_FILL = "rgba(210, 60, 60, 0.18)";
|
|
12
|
+
const BAND_EDGE = "#d23c3c";
|
|
13
|
+
/** The elevator's outline: the selection's yellow. */
|
|
14
|
+
const SHAFT_EDGE = "#ffd24a";
|
|
15
|
+
/** Put the spotlight on the line over `span` on `floor`, waiting for the
|
|
16
|
+
* elevator over `shaft`, replacing any still up. */
|
|
17
|
+
function spotlightTraffic(engine, floor, span, shaft, nowMs = performance.now()) {
|
|
18
|
+
spots.set(engine, { floor, span, shaft, startMs: nowMs });
|
|
19
|
+
}
|
|
20
|
+
/** The floor the spotlight is on, or null when none is up. */
|
|
21
|
+
function trafficSpotlightFloor(engine) {
|
|
22
|
+
return spots.get(engine)?.floor ?? null;
|
|
23
|
+
}
|
|
24
|
+
/** How strongly the spotlight shows `ageMs` after it went up: a pulse
|
|
25
|
+
* between 0.6 and 1 (steady at 1 under reduced motion), faded out over its
|
|
26
|
+
* last {@link FADE_MS}; 0 once it is over. */
|
|
27
|
+
function spotlightAlpha(ageMs, reducedMotion) {
|
|
28
|
+
if (ageMs < 0 || ageMs > SPOTLIGHT_MS)
|
|
29
|
+
return 0;
|
|
30
|
+
const pulse = reducedMotion ? 1 : 0.8 + 0.2 * Math.cos((ageMs / 1000) * 2 * Math.PI * PULSE_HZ);
|
|
31
|
+
return pulse * Math.min(1, (SPOTLIGHT_MS - ageMs) / FADE_MS);
|
|
32
|
+
}
|
|
33
|
+
/** Paint the spotlight, if one is up, and drop it once it is over. */
|
|
34
|
+
function drawTrafficSpotlight(engine, ctx, nowMs = performance.now()) {
|
|
35
|
+
const spot = spots.get(engine);
|
|
36
|
+
if (!spot)
|
|
37
|
+
return;
|
|
38
|
+
const alpha = spotlightAlpha(nowMs - spot.startMs, engine.reducedMotion);
|
|
39
|
+
if (alpha <= 0) {
|
|
40
|
+
spots.delete(engine);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const z = engine.cam.zoom;
|
|
44
|
+
const rowY = engine.worldToScreenY(spot.floor);
|
|
45
|
+
const rowH = FLOOR * z;
|
|
46
|
+
const left = engine.worldToScreenX(spot.span.x);
|
|
47
|
+
const width = spot.span.width * TILE * z;
|
|
48
|
+
ctx.save();
|
|
49
|
+
ctx.globalAlpha = alpha;
|
|
50
|
+
ctx.fillStyle = BAND_FILL;
|
|
51
|
+
ctx.fillRect(left, rowY, width, rowH);
|
|
52
|
+
ctx.setLineDash([6, 4]);
|
|
53
|
+
ctx.strokeStyle = BAND_EDGE;
|
|
54
|
+
ctx.lineWidth = 2;
|
|
55
|
+
ctx.strokeRect(left + 1, rowY + 1, width - 2, rowH - 2);
|
|
56
|
+
ctx.setLineDash([]);
|
|
57
|
+
ctx.strokeStyle = SHAFT_EDGE;
|
|
58
|
+
ctx.lineWidth = 3;
|
|
59
|
+
ctx.strokeRect(engine.worldToScreenX(spot.shaft.x) - 2, rowY - 2, spot.shaft.width * TILE * z + 4, rowH + 4);
|
|
60
|
+
ctx.restore();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { SPOTLIGHT_MS, drawTrafficSpotlight, spotlightAlpha, spotlightTraffic, trafficSpotlightFloor };
|
|
64
|
+
//# sourceMappingURL=trafficSpotlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trafficSpotlight.js","sources":["../../../src/render/excalibur/trafficSpotlight.ts"],"sourcesContent":["import { FLOOR, TILE } from \"../scale\";\nimport type { TowerEngine } from \"./TowerEngine\";\n\n/**\n * The Traffic readout's spotlight: after a tap on the HUD's \"Backed up · B2\",\n * the waiting line it names is marked for a few seconds: its stretch of the\n * floor banded red, and its elevator outlined in yellow on that floor only.\n * Never the whole floor or the whole shaft (owner, 2026-11-17: the old band\n * across the lot \"highlighted the whole floor, not where the jam is\"). The\n * state lives here, keyed by engine, so `TowerEngine` stays a thin shell.\n * Drawing it costs nothing while no spotlight is up: one map lookup per\n * frame.\n */\n\n/** A stretch of one floor, in tiles. */\nexport interface SpotSpan {\n readonly x: number;\n readonly width: number;\n}\n\ninterface Spot {\n readonly floor: number;\n /** The line and its elevator together. */\n readonly span: SpotSpan;\n /** The elevator the line waits for. */\n readonly shaft: SpotSpan;\n readonly startMs: number;\n}\n\nconst spots = new WeakMap<TowerEngine, Spot>();\n\n/** How long the spotlight stays up, in page milliseconds. */\nexport const SPOTLIGHT_MS = 4000;\n/** The last stretch of it, over which it fades out. */\nconst FADE_MS = 600;\n/** Pulses per second while it is up (none under reduced motion). */\nconst PULSE_HZ = 1.5;\n/** The line's band: the Map's Jammed red, so the two read as one signal. */\nconst BAND_FILL = \"rgba(210, 60, 60, 0.18)\";\nconst BAND_EDGE = \"#d23c3c\";\n/** The elevator's outline: the selection's yellow. */\nconst SHAFT_EDGE = \"#ffd24a\";\n\n/** Put the spotlight on the line over `span` on `floor`, waiting for the\n * elevator over `shaft`, replacing any still up. */\nexport function spotlightTraffic(engine: TowerEngine, floor: number, span: SpotSpan, shaft: SpotSpan, nowMs = performance.now()): void {\n spots.set(engine, { floor, span, shaft, startMs: nowMs });\n}\n\n/** The floor the spotlight is on, or null when none is up. */\nexport function trafficSpotlightFloor(engine: TowerEngine): number | null {\n return spots.get(engine)?.floor ?? null;\n}\n\n/** How strongly the spotlight shows `ageMs` after it went up: a pulse\n * between 0.6 and 1 (steady at 1 under reduced motion), faded out over its\n * last {@link FADE_MS}; 0 once it is over. */\nexport function spotlightAlpha(ageMs: number, reducedMotion: boolean): number {\n if (ageMs < 0 || ageMs > SPOTLIGHT_MS) return 0;\n const pulse = reducedMotion ? 1 : 0.8 + 0.2 * Math.cos((ageMs / 1000) * 2 * Math.PI * PULSE_HZ);\n return pulse * Math.min(1, (SPOTLIGHT_MS - ageMs) / FADE_MS);\n}\n\n/** Paint the spotlight, if one is up, and drop it once it is over. */\nexport function drawTrafficSpotlight(engine: TowerEngine, ctx: CanvasRenderingContext2D, nowMs = performance.now()): void {\n const spot = spots.get(engine);\n if (!spot) return;\n const alpha = spotlightAlpha(nowMs - spot.startMs, engine.reducedMotion);\n if (alpha <= 0) {\n spots.delete(engine);\n return;\n }\n const z = engine.cam.zoom;\n const rowY = engine.worldToScreenY(spot.floor);\n const rowH = FLOOR * z;\n const left = engine.worldToScreenX(spot.span.x);\n const width = spot.span.width * TILE * z;\n ctx.save();\n ctx.globalAlpha = alpha;\n ctx.fillStyle = BAND_FILL;\n ctx.fillRect(left, rowY, width, rowH);\n ctx.setLineDash([6, 4]);\n ctx.strokeStyle = BAND_EDGE;\n ctx.lineWidth = 2;\n ctx.strokeRect(left + 1, rowY + 1, width - 2, rowH - 2);\n ctx.setLineDash([]);\n ctx.strokeStyle = SHAFT_EDGE;\n ctx.lineWidth = 3;\n ctx.strokeRect(engine.worldToScreenX(spot.shaft.x) - 2, rowY - 2, spot.shaft.width * TILE * z + 4, rowH + 4);\n ctx.restore();\n}\n"],"names":[],"mappings":";;AA6BA,MAAM,KAAK,GAAG,IAAI,OAAO,EAAqB;AAE9C;AACO,MAAM,YAAY,GAAG;AAC5B;AACA,MAAM,OAAO,GAAG,GAAG;AACnB;AACA,MAAM,QAAQ,GAAG,GAAG;AACpB;AACA,MAAM,SAAS,GAAG,yBAAyB;AAC3C,MAAM,SAAS,GAAG,SAAS;AAC3B;AACA,MAAM,UAAU,GAAG,SAAS;AAE5B;AACqD;SACrC,gBAAgB,CAAC,MAAmB,EAAE,KAAa,EAAE,IAAc,EAAE,KAAe,EAAE,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,EAAA;AAC7H,IAAA,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC3D;AAEA;AACM,SAAU,qBAAqB,CAAC,MAAmB,EAAA;IACvD,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,IAAI;AACzC;AAEA;;AAE+C;AACzC,SAAU,cAAc,CAAC,KAAa,EAAE,aAAsB,EAAA;AAClE,IAAA,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,YAAY;AAAE,QAAA,OAAO,CAAC;AAC/C,IAAA,MAAM,KAAK,GAAG,aAAa,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC;AAC/F,IAAA,OAAO,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,YAA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C,EAAE,IAAI,GAAG,CAAC,CAAC;AACvD,IAAA,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACnB,IAAA,GAAG,CAAC,WAAW,GAAG,UAAU;AAC5B,IAAA,GAAG,CAAC,SAAS,GAAG,CAAC;AACjB,IAAA,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAC5G,GAAG,CAAC,OAAO,EAAE;AACf;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Catalog } from "../catalog/catalogTypes";
|
|
2
|
+
import type { UnitView } from "../simport/view";
|
|
3
|
+
import { type LobbyHalls } from "./lobbyHalls";
|
|
4
|
+
/** Left/right built extent of one above-ground floor row, in tile columns
|
|
5
|
+
* (`min` = leftmost tile, `max` = exclusive right edge). */
|
|
6
|
+
export interface FloorEdge {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The tower's exterior silhouette, derived from its units in a SINGLE pass —
|
|
12
|
+
* consumed by the escape stairs (per-floor edges) and the rooftop crane
|
|
13
|
+
* (top-floor tiles). Pure and free of any Excalibur/canvas dependency (it reads
|
|
14
|
+
* only unit data + the catalog's unit heights) so it is unit-testable without standing up
|
|
15
|
+
* the render engine, and computed once so a structural change doesn't scan the
|
|
16
|
+
* (potentially thousands of) units more than necessary.
|
|
17
|
+
*
|
|
18
|
+
* Every story of a multi-floor room counts on each row it occupies, so a
|
|
19
|
+
* two-story cinema at the edge still dresses its upper row. A lobby tile in a
|
|
20
|
+
* hall taller than one story (#308, #2068) counts on every story the hall
|
|
21
|
+
* rises through, so the escape stairs climb past its raised stories the way
|
|
22
|
+
* they climb past a normal floor's. Basement rows are
|
|
23
|
+
* excluded (edges clamp to floor ≥ 1), matching the above-ground facade. The one
|
|
24
|
+
* exception is the wedding hall's garden: its upper stories stand in the open
|
|
25
|
+
* sky above the last floor, so they get no escape stairs and no crane perch.
|
|
26
|
+
*/
|
|
27
|
+
export interface FacadeGeometry {
|
|
28
|
+
/** Leftmost/rightmost built tile per above-ground floor row. */
|
|
29
|
+
edges: Map<number, FloorEdge>;
|
|
30
|
+
/** Each above-ground floor row's runs of built tiles, left to right: one
|
|
31
|
+
* per tower on a lot whose towers stand apart, so each tower hangs its own
|
|
32
|
+
* escape stairs on both of its sides. */
|
|
33
|
+
runs: Map<number, FloorEdge[]>;
|
|
34
|
+
/** The highest row that holds structure: `highestFloor`, or the top story
|
|
35
|
+
* of a taller room or lobby hall that rises past it. The crane stands on
|
|
36
|
+
* this row's roof. */
|
|
37
|
+
topFloor: number;
|
|
38
|
+
/** Built tile columns on `topFloor`, where the crane perches. Empty
|
|
39
|
+
* when the top floor carries no above-ground structure (basement-only or
|
|
40
|
+
* empty lot), which is exactly when no crane should be shown. */
|
|
41
|
+
topTiles: Set<number>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build {@link FacadeGeometry} for `units`. `highestFloor` is the tower's
|
|
45
|
+
* top occupied floor (the lowest row the crane may stand on; a story rising
|
|
46
|
+
* past it moves the crane up to that story's roof). `halls` holds the
|
|
47
|
+
* lobby halls taller than one story; a lobby unit's height comes from it,
|
|
48
|
+
* since the catalog gives every lobby one story.
|
|
49
|
+
*/
|
|
50
|
+
export declare function facadeGeometry(units: readonly UnitView[], highestFloor: number, catalog: Catalog, halls?: LobbyHalls): FacadeGeometry;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { catalogFacility } from '../catalog/catalogTypes.js';
|
|
2
|
+
import { NO_TALL_HALLS } from './lobbyHalls.js';
|
|
3
|
+
|
|
4
|
+
/** Whether story `floor` of `u` is part of the wedding hall's garden crown (every
|
|
5
|
+
* story above the hall's ground story), which is not a building row. */
|
|
6
|
+
function isGardenCrownStory(u, floor) {
|
|
7
|
+
return u.kind === "weddingHall" && floor > u.floor;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build {@link FacadeGeometry} for `units`. `highestFloor` is the tower's
|
|
11
|
+
* top occupied floor (the lowest row the crane may stand on; a story rising
|
|
12
|
+
* past it moves the crane up to that story's roof). `halls` holds the
|
|
13
|
+
* lobby halls taller than one story; a lobby unit's height comes from it,
|
|
14
|
+
* since the catalog gives every lobby one story.
|
|
15
|
+
*/
|
|
16
|
+
function facadeGeometry(units, highestFloor, catalog, halls = NO_TALL_HALLS) {
|
|
17
|
+
const edges = new Map();
|
|
18
|
+
const spans = new Map();
|
|
19
|
+
const topTiles = new Set();
|
|
20
|
+
// The engine's highest floor counts each unit's base floor, so a tall hall
|
|
21
|
+
// or a two-story room on the top floor rises past it; the crane follows
|
|
22
|
+
// the highest row actually seen.
|
|
23
|
+
let topFloor = highestFloor;
|
|
24
|
+
for (const u of units) {
|
|
25
|
+
const right = u.x + u.width;
|
|
26
|
+
const stories = u.kind === "lobby" ? halls.heightAt(u.floor, u.x) : catalogFacility(catalog, u.kind).floors;
|
|
27
|
+
const top = u.floor + stories;
|
|
28
|
+
for (let f = Math.max(1, u.floor); f < top; f++) {
|
|
29
|
+
if (isGardenCrownStory(u, f))
|
|
30
|
+
continue;
|
|
31
|
+
const e = edges.get(f);
|
|
32
|
+
if (!e)
|
|
33
|
+
edges.set(f, { min: u.x, max: right });
|
|
34
|
+
else {
|
|
35
|
+
if (u.x < e.min)
|
|
36
|
+
e.min = u.x;
|
|
37
|
+
if (right > e.max)
|
|
38
|
+
e.max = right;
|
|
39
|
+
}
|
|
40
|
+
const row = spans.get(f);
|
|
41
|
+
if (row)
|
|
42
|
+
row.push({ min: u.x, max: right });
|
|
43
|
+
else
|
|
44
|
+
spans.set(f, [{ min: u.x, max: right }]);
|
|
45
|
+
// Same scan feeds the crane: remember the top row's built columns so
|
|
46
|
+
// syncCrane needn't re-traverse every unit to find them. A higher row
|
|
47
|
+
// replaces the columns kept so far.
|
|
48
|
+
if (f > topFloor) {
|
|
49
|
+
topFloor = f;
|
|
50
|
+
topTiles.clear();
|
|
51
|
+
}
|
|
52
|
+
if (f === topFloor)
|
|
53
|
+
for (let x = u.x; x < right; x++)
|
|
54
|
+
topTiles.add(x);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { edges, runs: joinRuns(spans), topFloor, topTiles };
|
|
58
|
+
}
|
|
59
|
+
/** Each row's spans joined into runs: spans that touch or overlap are one
|
|
60
|
+
* run. One sort per row, made only when the layout changes. */
|
|
61
|
+
function joinRuns(spans) {
|
|
62
|
+
const runs = new Map();
|
|
63
|
+
for (const [floor, row] of spans) {
|
|
64
|
+
row.sort((a, b) => a.min - b.min);
|
|
65
|
+
const joined = [];
|
|
66
|
+
for (const s of row) {
|
|
67
|
+
const last = joined[joined.length - 1];
|
|
68
|
+
if (last && s.min <= last.max)
|
|
69
|
+
last.max = Math.max(last.max, s.max);
|
|
70
|
+
else
|
|
71
|
+
joined.push({ ...s });
|
|
72
|
+
}
|
|
73
|
+
runs.set(floor, joined);
|
|
74
|
+
}
|
|
75
|
+
return runs;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { facadeGeometry };
|
|
79
|
+
//# sourceMappingURL=facadeGeometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facadeGeometry.js","sources":["../../src/render/facadeGeometry.ts"],"sourcesContent":["import { catalogFacility, type Catalog } from \"../catalog/catalogTypes\";\nimport type { UnitView } from \"../simport/view\";\nimport { NO_TALL_HALLS, type LobbyHalls } from \"./lobbyHalls\";\n\n/** Left/right built extent of one above-ground floor row, in tile columns\n * (`min` = leftmost tile, `max` = exclusive right edge). */\nexport interface FloorEdge {\n min: number;\n max: number;\n}\n\n/**\n * The tower's exterior silhouette, derived from its units in a SINGLE pass —\n * consumed by the escape stairs (per-floor edges) and the rooftop crane\n * (top-floor tiles). Pure and free of any Excalibur/canvas dependency (it reads\n * only unit data + the catalog's unit heights) so it is unit-testable without standing up\n * the render engine, and computed once so a structural change doesn't scan the\n * (potentially thousands of) units more than necessary.\n *\n * Every story of a multi-floor room counts on each row it occupies, so a\n * two-story cinema at the edge still dresses its upper row. A lobby tile in a\n * hall taller than one story (#308, #2068) counts on every story the hall\n * rises through, so the escape stairs climb past its raised stories the way\n * they climb past a normal floor's. Basement rows are\n * excluded (edges clamp to floor ≥ 1), matching the above-ground facade. The one\n * exception is the wedding hall's garden: its upper stories stand in the open\n * sky above the last floor, so they get no escape stairs and no crane perch.\n */\nexport interface FacadeGeometry {\n /** Leftmost/rightmost built tile per above-ground floor row. */\n edges: Map<number, FloorEdge>;\n /** Each above-ground floor row's runs of built tiles, left to right: one\n * per tower on a lot whose towers stand apart, so each tower hangs its own\n * escape stairs on both of its sides. */\n runs: Map<number, FloorEdge[]>;\n /** The highest row that holds structure: `highestFloor`, or the top story\n * of a taller room or lobby hall that rises past it. The crane stands on\n * this row's roof. */\n topFloor: number;\n /** Built tile columns on `topFloor`, where the crane perches. Empty\n * when the top floor carries no above-ground structure (basement-only or\n * empty lot), which is exactly when no crane should be shown. */\n topTiles: Set<number>;\n}\n\n/** Whether story `floor` of `u` is part of the wedding hall's garden crown (every\n * story above the hall's ground story), which is not a building row. */\nfunction isGardenCrownStory(u: UnitView, floor: number): boolean {\n return u.kind === \"weddingHall\" && floor > u.floor;\n}\n\n/**\n * Build {@link FacadeGeometry} for `units`. `highestFloor` is the tower's\n * top occupied floor (the lowest row the crane may stand on; a story rising\n * past it moves the crane up to that story's roof). `halls` holds the\n * lobby halls taller than one story; a lobby unit's height comes from it,\n * since the catalog gives every lobby one story.\n */\nexport function facadeGeometry(\n units: readonly UnitView[],\n highestFloor: number,\n catalog: Catalog,\n halls: LobbyHalls = NO_TALL_HALLS,\n): FacadeGeometry {\n const edges = new Map<number, FloorEdge>();\n const spans = new Map<number, FloorEdge[]>();\n const topTiles = new Set<number>();\n // The engine's highest floor counts each unit's base floor, so a tall hall\n // or a two-story room on the top floor rises past it; the crane follows\n // the highest row actually seen.\n let topFloor = highestFloor;\n for (const u of units) {\n const right = u.x + u.width;\n const stories = u.kind === \"lobby\" ? halls.heightAt(u.floor, u.x) : catalogFacility(catalog, u.kind).floors;\n const top = u.floor + stories;\n for (let f = Math.max(1, u.floor); f < top; f++) {\n if (isGardenCrownStory(u, f)) continue;\n const e = edges.get(f);\n if (!e) edges.set(f, { min: u.x, max: right });\n else {\n if (u.x < e.min) e.min = u.x;\n if (right > e.max) e.max = right;\n }\n const row = spans.get(f);\n if (row) row.push({ min: u.x, max: right });\n else spans.set(f, [{ min: u.x, max: right }]);\n // Same scan feeds the crane: remember the top row's built columns so\n // syncCrane needn't re-traverse every unit to find them. A higher row\n // replaces the columns kept so far.\n if (f > topFloor) {\n topFloor = f;\n topTiles.clear();\n }\n if (f === topFloor) for (let x = u.x; x < right; x++) topTiles.add(x);\n }\n }\n return { edges, runs: joinRuns(spans), topFloor, topTiles };\n}\n\n/** Each row's spans joined into runs: spans that touch or overlap are one\n * run. One sort per row, made only when the layout changes. */\nfunction joinRuns(spans: Map<number, FloorEdge[]>): Map<number, FloorEdge[]> {\n const runs = new Map<number, FloorEdge[]>();\n for (const [floor, row] of spans) {\n row.sort((a, b) => a.min - b.min);\n const joined: FloorEdge[] = [];\n for (const s of row) {\n const last = joined[joined.length - 1];\n if (last && s.min <= last.max) last.max = Math.max(last.max, s.max);\n else joined.push({ ...s });\n }\n runs.set(floor, joined);\n }\n return runs;\n}\n"],"names":[],"mappings":";;;AA6CA;AACyE;AACzE,SAAS,kBAAkB,CAAC,CAAW,EAAE,KAAa,EAAA;IACpD,OAAO,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,KAAK,GAAG,CAAC,CAAC,KAAK;AACpD;AAEA;;;;;;AAMG;AACG,SAAU,cAAc,CAC5B,KAA0B,EAC1B,YAAoB,EACpB,OAAgB,EACh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IAAI,CAAC,GAAG;AAAE,gBAAA,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;;gBAC9D,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QAC5B;AACA,QAAA,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IACzB;AACA,IAAA,OAAO,IAAI;AACb;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { EntranceKind } from "./sprites/structure/lobby";
|
|
2
|
+
/**
|
|
3
|
+
* Where the ground floor's front doors stand: which floor-1 lobby tiles draw
|
|
4
|
+
* the grand entrance (with its doorman) and which draws the service door.
|
|
5
|
+
* Pure, so the rule is testable without the render engine; the structure
|
|
6
|
+
* pass (`excalibur/towerStructTiles.ts`) calls it once per full tile pass.
|
|
7
|
+
*
|
|
8
|
+
* One building gets one grand entrance, on the left end of its leftmost run
|
|
9
|
+
* of lobby, and one service door, on the right end of its rightmost run.
|
|
10
|
+
* Stamping per contiguous run (rather than at the global min and max) keeps
|
|
11
|
+
* every entrance anchored to real neighboring tiles, so a gap in the middle
|
|
12
|
+
* of a lobby (a mid-remodel bulldoze) cannot leave an orphan half-facade.
|
|
13
|
+
*
|
|
14
|
+
* - Leftmost run of width >= 2: its first tile -> grand-left, the next -> grand-right.
|
|
15
|
+
* - Leftmost run of width 1 (a toy tower): grand-solo.
|
|
16
|
+
* - Rightmost run's rightmost tile -> service, if the grand entrance has not
|
|
17
|
+
* claimed it and there is room past it. When the rightmost run is the
|
|
18
|
+
* leftmost run, that means the run is wider than the grand entrance (a 1-
|
|
19
|
+
* or 2-tile lobby is all grand). A distinct rightmost run always has room,
|
|
20
|
+
* so it takes the service door even at width 1.
|
|
21
|
+
*
|
|
22
|
+
* When the catalog gives each tower its own front door (`frontDoorPerTower`,
|
|
23
|
+
* Modern, where ground lobbies may stand apart), every building on the lot is
|
|
24
|
+
* stamped on its own. A building is a contiguous run of ground-floor tiles,
|
|
25
|
+
* lobby or room, so open ground between two lobbies parts two towers. That
|
|
26
|
+
* matches the floor-1 runs that hang the entrance awnings (`facadeGeometry`)
|
|
27
|
+
* except for a taller room rising onto floor 1 from a basement, which those
|
|
28
|
+
* count and this does not. Without it, the whole ground floor is one
|
|
29
|
+
* building, as in the 1994 game.
|
|
30
|
+
*/
|
|
31
|
+
/** Stamp the entrances into `out` (cleared first). `lobbyTiles` are the
|
|
32
|
+
* floor-1 lobby columns, sorted ascending with no repeats. `buildings` is
|
|
33
|
+
* null for one building on the lot, or the floor-1 columns every ground-floor
|
|
34
|
+
* unit covers (lobby and rooms, any order, repeats allowed) to stamp each
|
|
35
|
+
* contiguous run of them as its own building. `towers` (cleared first)
|
|
36
|
+
* receives each stamped building's first and last column, left to right, as
|
|
37
|
+
* flat pairs; one building on the lot spans every column. */
|
|
38
|
+
export declare function stampGroundEntrances(out: Map<number, EntranceKind>, lobbyTiles: readonly number[], buildings: number[] | null, towers: number[]): void;
|
|
39
|
+
/** The tower (an index into the pairs {@link stampGroundEntrances} wrote to
|
|
40
|
+
* `towers`) that a unit on columns `x` to `x + width - 1` belongs to: the
|
|
41
|
+
* first whose ground floor it overlaps, else the nearest, so a floor that
|
|
42
|
+
* overhangs its lobby still counts for its own tower. -1 when the lot has
|
|
43
|
+
* no tower. A lot holds a handful of towers, so this walks them. */
|
|
44
|
+
export declare function towerOfSpan(towers: readonly number[], x: number, width: number): number;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the ground floor's front doors stand: which floor-1 lobby tiles draw
|
|
3
|
+
* the grand entrance (with its doorman) and which draws the service door.
|
|
4
|
+
* Pure, so the rule is testable without the render engine; the structure
|
|
5
|
+
* pass (`excalibur/towerStructTiles.ts`) calls it once per full tile pass.
|
|
6
|
+
*
|
|
7
|
+
* One building gets one grand entrance, on the left end of its leftmost run
|
|
8
|
+
* of lobby, and one service door, on the right end of its rightmost run.
|
|
9
|
+
* Stamping per contiguous run (rather than at the global min and max) keeps
|
|
10
|
+
* every entrance anchored to real neighboring tiles, so a gap in the middle
|
|
11
|
+
* of a lobby (a mid-remodel bulldoze) cannot leave an orphan half-facade.
|
|
12
|
+
*
|
|
13
|
+
* - Leftmost run of width >= 2: its first tile -> grand-left, the next -> grand-right.
|
|
14
|
+
* - Leftmost run of width 1 (a toy tower): grand-solo.
|
|
15
|
+
* - Rightmost run's rightmost tile -> service, if the grand entrance has not
|
|
16
|
+
* claimed it and there is room past it. When the rightmost run is the
|
|
17
|
+
* leftmost run, that means the run is wider than the grand entrance (a 1-
|
|
18
|
+
* or 2-tile lobby is all grand). A distinct rightmost run always has room,
|
|
19
|
+
* so it takes the service door even at width 1.
|
|
20
|
+
*
|
|
21
|
+
* When the catalog gives each tower its own front door (`frontDoorPerTower`,
|
|
22
|
+
* Modern, where ground lobbies may stand apart), every building on the lot is
|
|
23
|
+
* stamped on its own. A building is a contiguous run of ground-floor tiles,
|
|
24
|
+
* lobby or room, so open ground between two lobbies parts two towers. That
|
|
25
|
+
* matches the floor-1 runs that hang the entrance awnings (`facadeGeometry`)
|
|
26
|
+
* except for a taller room rising onto floor 1 from a basement, which those
|
|
27
|
+
* count and this does not. Without it, the whole ground floor is one
|
|
28
|
+
* building, as in the 1994 game.
|
|
29
|
+
*/
|
|
30
|
+
/** Stamp the entrances into `out` (cleared first). `lobbyTiles` are the
|
|
31
|
+
* floor-1 lobby columns, sorted ascending with no repeats. `buildings` is
|
|
32
|
+
* null for one building on the lot, or the floor-1 columns every ground-floor
|
|
33
|
+
* unit covers (lobby and rooms, any order, repeats allowed) to stamp each
|
|
34
|
+
* contiguous run of them as its own building. `towers` (cleared first)
|
|
35
|
+
* receives each stamped building's first and last column, left to right, as
|
|
36
|
+
* flat pairs; one building on the lot spans every column. */
|
|
37
|
+
function stampGroundEntrances(out, lobbyTiles, buildings, towers) {
|
|
38
|
+
out.clear();
|
|
39
|
+
towers.length = 0;
|
|
40
|
+
if (lobbyTiles.length === 0)
|
|
41
|
+
return;
|
|
42
|
+
if (buildings === null) {
|
|
43
|
+
stampBuilding(out, lobbyTiles, 0, lobbyTiles.length);
|
|
44
|
+
towers.push(-Infinity, Infinity);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
buildings.sort((a, b) => a - b);
|
|
48
|
+
// Walk the buildings' runs and the lobby tiles together: each run claims
|
|
49
|
+
// the lobby tiles inside it. Every lobby tile is a building tile, so each
|
|
50
|
+
// falls inside exactly one run.
|
|
51
|
+
let lo = 0;
|
|
52
|
+
let i = 0;
|
|
53
|
+
while (i < buildings.length && lo < lobbyTiles.length) {
|
|
54
|
+
let j = i;
|
|
55
|
+
while (j + 1 < buildings.length && buildings[j + 1] - buildings[j] <= 1)
|
|
56
|
+
j++;
|
|
57
|
+
const end = buildings[j]; // inclusive
|
|
58
|
+
let hi = lo;
|
|
59
|
+
while (hi < lobbyTiles.length && lobbyTiles[hi] <= end)
|
|
60
|
+
hi++;
|
|
61
|
+
if (hi > lo)
|
|
62
|
+
towers.push(buildings[i], end);
|
|
63
|
+
stampBuilding(out, lobbyTiles, lo, hi);
|
|
64
|
+
lo = hi;
|
|
65
|
+
i = j + 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Stamp one building whose lobby tiles are `tiles[from..to)`; nothing when
|
|
69
|
+
* it holds no lobby. */
|
|
70
|
+
function stampBuilding(out, tiles, from, to) {
|
|
71
|
+
if (to <= from)
|
|
72
|
+
return;
|
|
73
|
+
// The leftmost run's end and the rightmost run's start, in one list.
|
|
74
|
+
let firstRunEnd = from;
|
|
75
|
+
while (firstRunEnd + 1 < to && tiles[firstRunEnd + 1] === tiles[firstRunEnd] + 1)
|
|
76
|
+
firstRunEnd++;
|
|
77
|
+
let lastRunStart = to - 1;
|
|
78
|
+
while (lastRunStart > from && tiles[lastRunStart - 1] === tiles[lastRunStart] - 1)
|
|
79
|
+
lastRunStart--;
|
|
80
|
+
const firstStart = tiles[from];
|
|
81
|
+
const firstWidth = tiles[firstRunEnd] + 1 - firstStart;
|
|
82
|
+
if (firstWidth >= 2) {
|
|
83
|
+
out.set(firstStart, "grand-left");
|
|
84
|
+
out.set(firstStart + 1, "grand-right");
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
out.set(firstStart, "grand-solo");
|
|
88
|
+
}
|
|
89
|
+
const lastRightX = tiles[to - 1];
|
|
90
|
+
const grandSpan = firstWidth >= 2 ? 2 : 1;
|
|
91
|
+
const sameRunAsFirst = lastRunStart <= firstRunEnd;
|
|
92
|
+
const roomPastGrand = sameRunAsFirst ? firstWidth > grandSpan : true;
|
|
93
|
+
if (roomPastGrand && !out.has(lastRightX))
|
|
94
|
+
out.set(lastRightX, "service");
|
|
95
|
+
}
|
|
96
|
+
/** The tower (an index into the pairs {@link stampGroundEntrances} wrote to
|
|
97
|
+
* `towers`) that a unit on columns `x` to `x + width - 1` belongs to: the
|
|
98
|
+
* first whose ground floor it overlaps, else the nearest, so a floor that
|
|
99
|
+
* overhangs its lobby still counts for its own tower. -1 when the lot has
|
|
100
|
+
* no tower. A lot holds a handful of towers, so this walks them. */
|
|
101
|
+
function towerOfSpan(towers, x, width) {
|
|
102
|
+
const last = x + width - 1;
|
|
103
|
+
let best = -1;
|
|
104
|
+
let bestGap = Infinity;
|
|
105
|
+
for (let t = 0; t < towers.length; t += 2) {
|
|
106
|
+
const gap = Math.max(towers[t] - last, x - towers[t + 1], 0);
|
|
107
|
+
if (gap === 0)
|
|
108
|
+
return t / 2;
|
|
109
|
+
if (gap < bestGap) {
|
|
110
|
+
bestGap = gap;
|
|
111
|
+
best = t / 2;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return best;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { stampGroundEntrances, towerOfSpan };
|
|
118
|
+
//# sourceMappingURL=groundEntrances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groundEntrances.js","sources":["../../src/render/groundEntrances.ts"],"sourcesContent":["import type { EntranceKind } from \"./sprites/structure/lobby\";\n\n/**\n * Where the ground floor's front doors stand: which floor-1 lobby tiles draw\n * the grand entrance (with its doorman) and which draws the service door.\n * Pure, so the rule is testable without the render engine; the structure\n * pass (`excalibur/towerStructTiles.ts`) calls it once per full tile pass.\n *\n * One building gets one grand entrance, on the left end of its leftmost run\n * of lobby, and one service door, on the right end of its rightmost run.\n * Stamping per contiguous run (rather than at the global min and max) keeps\n * every entrance anchored to real neighboring tiles, so a gap in the middle\n * of a lobby (a mid-remodel bulldoze) cannot leave an orphan half-facade.\n *\n * - Leftmost run of width >= 2: its first tile -> grand-left, the next -> grand-right.\n * - Leftmost run of width 1 (a toy tower): grand-solo.\n * - Rightmost run's rightmost tile -> service, if the grand entrance has not\n * claimed it and there is room past it. When the rightmost run is the\n * leftmost run, that means the run is wider than the grand entrance (a 1-\n * or 2-tile lobby is all grand). A distinct rightmost run always has room,\n * so it takes the service door even at width 1.\n *\n * When the catalog gives each tower its own front door (`frontDoorPerTower`,\n * Modern, where ground lobbies may stand apart), every building on the lot is\n * stamped on its own. A building is a contiguous run of ground-floor tiles,\n * lobby or room, so open ground between two lobbies parts two towers. That\n * matches the floor-1 runs that hang the entrance awnings (`facadeGeometry`)\n * except for a taller room rising onto floor 1 from a basement, which those\n * count and this does not. Without it, the whole ground floor is one\n * building, as in the 1994 game.\n */\n\n/** Stamp the entrances into `out` (cleared first). `lobbyTiles` are the\n * floor-1 lobby columns, sorted ascending with no repeats. `buildings` is\n * null for one building on the lot, or the floor-1 columns every ground-floor\n * unit covers (lobby and rooms, any order, repeats allowed) to stamp each\n * contiguous run of them as its own building. `towers` (cleared first)\n * receives each stamped building's first and last column, left to right, as\n * flat pairs; one building on the lot spans every column. */\nexport function stampGroundEntrances(\n out: Map<number, EntranceKind>,\n lobbyTiles: readonly number[],\n buildings: number[] | null,\n towers: number[],\n): void {\n out.clear();\n towers.length = 0;\n if (lobbyTiles.length === 0) return;\n if (buildings === null) {\n stampBuilding(out, lobbyTiles, 0, lobbyTiles.length);\n towers.push(-Infinity, Infinity);\n return;\n }\n buildings.sort((a, b) => a - b);\n // Walk the buildings' runs and the lobby tiles together: each run claims\n // the lobby tiles inside it. Every lobby tile is a building tile, so each\n // falls inside exactly one run.\n let lo = 0;\n let i = 0;\n while (i < buildings.length && lo < lobbyTiles.length) {\n let j = i;\n while (j + 1 < buildings.length && buildings[j + 1] - buildings[j] <= 1) j++;\n const end = buildings[j]; // inclusive\n let hi = lo;\n while (hi < lobbyTiles.length && lobbyTiles[hi] <= end) hi++;\n if (hi > lo) towers.push(buildings[i], end);\n stampBuilding(out, lobbyTiles, lo, hi);\n lo = hi;\n i = j + 1;\n }\n}\n\n/** Stamp one building whose lobby tiles are `tiles[from..to)`; nothing when\n * it holds no lobby. */\nfunction stampBuilding(out: Map<number, EntranceKind>, tiles: readonly number[], from: number, to: number): void {\n if (to <= from) return;\n // The leftmost run's end and the rightmost run's start, in one list.\n let firstRunEnd = from;\n while (firstRunEnd + 1 < to && tiles[firstRunEnd + 1] === tiles[firstRunEnd] + 1) firstRunEnd++;\n let lastRunStart = to - 1;\n while (lastRunStart > from && tiles[lastRunStart - 1] === tiles[lastRunStart] - 1) lastRunStart--;\n const firstStart = tiles[from];\n const firstWidth = tiles[firstRunEnd] + 1 - firstStart;\n if (firstWidth >= 2) {\n out.set(firstStart, \"grand-left\");\n out.set(firstStart + 1, \"grand-right\");\n } else {\n out.set(firstStart, \"grand-solo\");\n }\n const lastRightX = tiles[to - 1];\n const grandSpan = firstWidth >= 2 ? 2 : 1;\n const sameRunAsFirst = lastRunStart <= firstRunEnd;\n const roomPastGrand = sameRunAsFirst ? firstWidth > grandSpan : true;\n if (roomPastGrand && !out.has(lastRightX)) out.set(lastRightX, \"service\");\n}\n\n/** The tower (an index into the pairs {@link stampGroundEntrances} wrote to\n * `towers`) that a unit on columns `x` to `x + width - 1` belongs to: the\n * first whose ground floor it overlaps, else the nearest, so a floor that\n * overhangs its lobby still counts for its own tower. -1 when the lot has\n * no tower. A lot holds a handful of towers, so this walks them. */\nexport function towerOfSpan(towers: readonly number[], x: number, width: number): number {\n const last = x + width - 1;\n let best = -1;\n let bestGap = Infinity;\n for (let t = 0; t < towers.length; t += 2) {\n const gap = Math.max(towers[t] - last, x - towers[t + 1], 0);\n if (gap === 0) return t / 2;\n if (gap < bestGap) {\n bestGap = gap;\n best = t / 2;\n }\n }\n return best;\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AAEH;;;;;;AAM8D;AACxD,SAAU,oBAAoB,CAClC,GAA8B,EAC9B,UAA6B,EAC7B,SAA0B,EAC1B,MAAgB,EAAA;IAEhB,GAAG,CAAC,KAAK,EAAE;AACX,IAAA,MAAM,CAAC,MAAM,GAAG,CAAC;AACjB,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE;AAC7B,IAAA,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAChC;IACF;AACA,IAAA,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;;IAI/B,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,GAAG,CAAC;AACT,IAAA,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE;QACrD,IAAI,CAAC,GAAG,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AAAE,YAAA,CAAC,EAAE;QAC5E,MAAM,GAA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window that changes a home's look, shared by the room art,
|
|
4
|
+
* the web's re-bake signature (`excalibur/roomSignature.ts`) and the sprite
|
|
5
|
+
* atlas (`atlas/catalog.ts`, `atlas/lookup.ts`). One source of truth, so a kind
|
|
6
|
+
* that draws differently late at night also re-bakes when the hour crosses
|
|
7
|
+
* into or out of the window.
|
|
8
|
+
*/
|
|
9
|
+
/** Kinds whose art changes after 23:00 and before 06:00: the condo and the
|
|
10
|
+
* two rentals, which share the condo's draw (`residentialRentalSprites.ts`),
|
|
11
|
+
* its hidden-residents rule and its asleep scrim (`drawRoom`, #1025). */
|
|
12
|
+
export declare const LATE_NIGHT_KINDS: ReadonlySet<FacilityKind>;
|
|
13
|
+
/** True from 23:00 up to (not including) 06:00. */
|
|
14
|
+
export declare function isLateHour(hour: number): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The small-hours window that changes a home's look, shared by the room art,
|
|
3
|
+
* the web's re-bake signature (`excalibur/roomSignature.ts`) and the sprite
|
|
4
|
+
* atlas (`atlas/catalog.ts`, `atlas/lookup.ts`). One source of truth, so a kind
|
|
5
|
+
* that draws differently late at night also re-bakes when the hour crosses
|
|
6
|
+
* into or out of the window.
|
|
7
|
+
*/
|
|
8
|
+
/** Kinds whose art changes after 23:00 and before 06:00: the condo and the
|
|
9
|
+
* two rentals, which share the condo's draw (`residentialRentalSprites.ts`),
|
|
10
|
+
* its hidden-residents rule and its asleep scrim (`drawRoom`, #1025). */
|
|
11
|
+
const LATE_NIGHT_KINDS = new Set(["condo", "rentalStudio", "rentalApartment"]);
|
|
12
|
+
/** True from 23:00 up to (not including) 06:00. */
|
|
13
|
+
function isLateHour(hour) {
|
|
14
|
+
return hour >= 23 || hour < 6;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { LATE_NIGHT_KINDS, isLateHour };
|
|
18
|
+
//# sourceMappingURL=lateNight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lateNight.js","sources":["../../src/render/lateNight.ts"],"sourcesContent":["import type { FacilityKind } from \"../shared/types\";\n\n/**\n * The small-hours window that changes a home's look, shared by the room art,\n * the web's re-bake signature (`excalibur/roomSignature.ts`) and the sprite\n * atlas (`atlas/catalog.ts`, `atlas/lookup.ts`). One source of truth, so a kind\n * that draws differently late at night also re-bakes when the hour crosses\n * into or out of the window.\n */\n\n/** Kinds whose art changes after 23:00 and before 06:00: the condo and the\n * two rentals, which share the condo's draw (`residentialRentalSprites.ts`),\n * its hidden-residents rule and its asleep scrim (`drawRoom`, #1025). */\nexport const LATE_NIGHT_KINDS: ReadonlySet<FacilityKind> = new Set<FacilityKind>([\"condo\", \"rentalStudio\", \"rentalApartment\"]);\n\n/** True from 23:00 up to (not including) 06:00. */\nexport function isLateHour(hour: number): boolean {\n return hour >= 23 || hour < 6;\n}\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;AAEH;;AAE0E;AACnE,MAAM,gBAAgB,GAA8B,IAAI,GAAG,CAAe,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC;AAE7H;AACM,SAAU,UAAU,CAAC,IAAY,EAAA;AACrC,IAAA,OAAO,IAAI,IAAI,EAAE,IAAI,IAAI,GAAG,CAAC;AAC/B;;"}
|