@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,108 @@
|
|
|
1
|
+
import * as ex from 'excalibur';
|
|
2
|
+
import { cabRiderFoot, cabRiderX } from '../sprites/transport.js';
|
|
3
|
+
import { NO_FIGURES, carIndicator, cabFit } from '../carIndicator.js';
|
|
4
|
+
import { loadFigures } from './cabRiders.js';
|
|
5
|
+
import { FLOOR } from '../scale.js';
|
|
6
|
+
import { RIDER_FOOT, cabParts, RIDER_X, RIDER_W, RIDER_H } from './cabParts.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The graphic of one elevator car. It paints nothing of its own: each frame
|
|
10
|
+
* it lays the shared, already painted parts (`cabParts.ts`) on top of each
|
|
11
|
+
* other, the cab's back, each rider's standing figure in their slot and the
|
|
12
|
+
* cab's front, or one picture of the whole cab while it is empty. A cab's riders are real people, so its looks rarely repeat;
|
|
13
|
+
* when they change, the car only points at other parts, with no new canvas,
|
|
14
|
+
* no paint and no texture upload. Each part is painted and uploaded once for
|
|
15
|
+
* the whole tower.
|
|
16
|
+
*/
|
|
17
|
+
/** The empty, idle cab state used to seed a fresh car's graphic. */
|
|
18
|
+
const IDLE_CAR = { riders: 0, figures: NO_FIGURES, cast: "", arrow: null, full: false };
|
|
19
|
+
/**
|
|
20
|
+
* The cab state for this frame's lantern direction, load, capacity and
|
|
21
|
+
* riders. Every frame asks, for every car, but the answer only changes when a
|
|
22
|
+
* step moves one of them, so it is worked out again only then: the frames in
|
|
23
|
+
* between compare four values and allocate nothing.
|
|
24
|
+
*/
|
|
25
|
+
function cabWant(entry, dir, load, cap, riders) {
|
|
26
|
+
const w = entry.want;
|
|
27
|
+
if (w && w.dir === dir && w.load === load && w.cap === cap && w.cast === riders.cast)
|
|
28
|
+
return w;
|
|
29
|
+
// The figures are copied: the crowd's count refills its arrays each step.
|
|
30
|
+
const figures = riders.count > 0 ? loadFigures(riders) : NO_FIGURES;
|
|
31
|
+
const ind = carIndicator(dir, load, cap, cabFit(entry.w), figures.length, figures, riders.cast);
|
|
32
|
+
const next = { dir, load, cap, cast: riders.cast, ind, key: carKey(ind) };
|
|
33
|
+
entry.want = next;
|
|
34
|
+
return next;
|
|
35
|
+
}
|
|
36
|
+
/** Stable key for a cab's indicator state: who rides, the lantern and FULL. */
|
|
37
|
+
function carKey(ind) {
|
|
38
|
+
return `${ind.riders}:${ind.arrow ?? "x"}:${ind.full ? "f" : "e"}:${ind.cast}`;
|
|
39
|
+
}
|
|
40
|
+
class CabGraphic extends ex.Graphic {
|
|
41
|
+
constructor(cab, ind = IDLE_CAR, parts = cabParts()) {
|
|
42
|
+
const cw = Math.max(1, Math.round(cab.w));
|
|
43
|
+
super({ width: cw, height: FLOOR });
|
|
44
|
+
this.foot = Math.round(cabRiderFoot(FLOOR)) - RIDER_FOOT;
|
|
45
|
+
/** The whole cab in one picture while nobody is aboard. */
|
|
46
|
+
this.empty = null;
|
|
47
|
+
/** The riders' pictures and slots; the first `count` entries are drawn.
|
|
48
|
+
* The arrays keep their length, so a new load writes over them. */
|
|
49
|
+
this.riders = [];
|
|
50
|
+
this.slots = [];
|
|
51
|
+
this.count = 0;
|
|
52
|
+
this.parts = parts;
|
|
53
|
+
this.kind = cab.kind;
|
|
54
|
+
this.cabW = cab.w;
|
|
55
|
+
this.cw = cw;
|
|
56
|
+
this.back = parts.back(cab.kind, cab.w);
|
|
57
|
+
this.front = parts.front(cab.w, ind.arrow, ind.full);
|
|
58
|
+
this.ind = ind;
|
|
59
|
+
this.show(ind);
|
|
60
|
+
}
|
|
61
|
+
/** Show state `ind`: its lantern and FULL, and its riders standing in the
|
|
62
|
+
* cab. Looks up kept parts only; nothing is painted here. */
|
|
63
|
+
show(ind) {
|
|
64
|
+
this.ind = ind;
|
|
65
|
+
this.front = this.parts.front(this.cabW, ind.arrow, ind.full);
|
|
66
|
+
const rc = Math.min(ind.riders, ind.figures.length);
|
|
67
|
+
let n = 0;
|
|
68
|
+
for (let p = 0; p < rc; p++) {
|
|
69
|
+
const rx = cabRiderX(this.cw, rc, p);
|
|
70
|
+
if (rx === null)
|
|
71
|
+
break;
|
|
72
|
+
const left = Math.round(rx) - RIDER_X;
|
|
73
|
+
const sx = left < 0 ? -left : 0;
|
|
74
|
+
const w = Math.min(RIDER_W, this.cw - left) - sx;
|
|
75
|
+
if (w <= 0)
|
|
76
|
+
continue;
|
|
77
|
+
this.riders[n] = this.parts.rider(ind.figures[p]);
|
|
78
|
+
const slot = this.slots[n] ?? (this.slots[n] = { sx: 0, dx: 0, w: 0 });
|
|
79
|
+
slot.sx = sx;
|
|
80
|
+
slot.dx = left + sx;
|
|
81
|
+
slot.w = w;
|
|
82
|
+
n++;
|
|
83
|
+
}
|
|
84
|
+
this.count = n;
|
|
85
|
+
this.empty = n === 0 ? this.parts.empty(this.kind, this.cabW, ind.arrow, ind.full) : null;
|
|
86
|
+
}
|
|
87
|
+
_drawImage(ctx, x, y) {
|
|
88
|
+
if (this.empty) {
|
|
89
|
+
ctx.drawImage(this.empty, x, y);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
ctx.drawImage(this.back, x, y);
|
|
93
|
+
for (let p = 0; p < this.count; p++) {
|
|
94
|
+
const s = this.slots[p];
|
|
95
|
+
ctx.drawImage(this.riders[p], s.sx, 0, s.w, RIDER_H, x + s.dx, y + this.foot, s.w, RIDER_H);
|
|
96
|
+
}
|
|
97
|
+
ctx.drawImage(this.front, x, y);
|
|
98
|
+
}
|
|
99
|
+
clone() {
|
|
100
|
+
const copy = new CabGraphic({ w: this.cabW, kind: this.kind }, this.ind, this.parts);
|
|
101
|
+
const options = this.cloneGraphicOptions();
|
|
102
|
+
copy.opacity = options.opacity ?? 1;
|
|
103
|
+
return copy;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { CabGraphic, IDLE_CAR, cabWant, carKey };
|
|
108
|
+
//# sourceMappingURL=cabGraphics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cabGraphics.js","sources":["../../../src/render/excalibur/cabGraphics.ts"],"sourcesContent":["import * as ex from \"excalibur\";\nimport type { FacilityKind } from \"../../shared/types\";\nimport type { TransportView } from \"../../simport/view\";\nimport { cabRiderFoot, cabRiderX } from \"../sprites/transport\";\nimport { cabFit, carIndicator, NO_FIGURES, type CarIndicator } from \"../carIndicator\";\nimport { loadFigures, type CabLoad } from \"./cabRiders\";\nimport { FLOOR } from \"../scale\";\nimport { cabParts, RIDER_FOOT, RIDER_H, RIDER_W, RIDER_X, type CabParts } from \"./cabParts\";\n\n/**\n * The graphic of one elevator car. It paints nothing of its own: each frame\n * it lays the shared, already painted parts (`cabParts.ts`) on top of each\n * other, the cab's back, each rider's standing figure in their slot and the\n * cab's front, or one picture of the whole cab while it is empty. A cab's riders are real people, so its looks rarely repeat;\n * when they change, the car only points at other parts, with no new canvas,\n * no paint and no texture upload. Each part is painted and uploaded once for\n * the whole tower.\n */\n\n/** The empty, idle cab state used to seed a fresh car's graphic. */\nexport const IDLE_CAR: CarIndicator = { riders: 0, figures: NO_FIGURES, cast: \"\", arrow: null, full: false };\n\n/** What a car's cab state reads of the car. */\nexport interface CabGfxEntry {\n readonly w: number;\n /** Elevator kind, so each cab wears its type's look (`cabParts.ts`). */\n readonly kind: FacilityKind;\n /** The state the car's inputs last asked for (`cabWant`). */\n want?: CabWant;\n}\n\n/** One drawn elevator car: car `i` of shaft `t`, moved along it each frame\n * and drawing the state it shows (`shown`, a `carKey`) with `cab`. */\nexport interface CabActor extends CabGfxEntry {\n readonly actor: ex.Actor;\n readonly t: TransportView;\n readonly i: number;\n readonly cab: CabGraphic;\n shown: string;\n}\n\n/** The cab state a car's inputs ask for, kept with the inputs it came from. */\nexport interface CabWant {\n dir: number;\n load: number;\n cap: number;\n cast: string;\n ind: CarIndicator;\n key: string;\n}\n\n/**\n * The cab state for this frame's lantern direction, load, capacity and\n * riders. Every frame asks, for every car, but the answer only changes when a\n * step moves one of them, so it is worked out again only then: the frames in\n * between compare four values and allocate nothing.\n */\nexport function cabWant(entry: CabGfxEntry, dir: number, load: number, cap: number, riders: CabLoad): CabWant {\n const w = entry.want;\n if (w && w.dir === dir && w.load === load && w.cap === cap && w.cast === riders.cast) return w;\n // The figures are copied: the crowd's count refills its arrays each step.\n const figures = riders.count > 0 ? loadFigures(riders) : NO_FIGURES;\n const ind = carIndicator(dir, load, cap, cabFit(entry.w), figures.length, figures, riders.cast);\n const next: CabWant = { dir, load, cap, cast: riders.cast, ind, key: carKey(ind) };\n entry.want = next;\n return next;\n}\n\n/** Stable key for a cab's indicator state: who rides, the lantern and FULL. */\nexport function carKey(ind: CarIndicator): string {\n return `${ind.riders}:${ind.arrow ?? \"x\"}:${ind.full ? \"f\" : \"e\"}:${ind.cast}`;\n}\n\n/** Where a rider's picture lands in the cab and how much of it shows: the\n * slot `drawCar` uses (`cabRiderX`), cut to the cab's walls the way a\n * painted cab cut it. */\ninterface RiderSlot {\n sx: number;\n dx: number;\n w: number;\n}\n\nexport class CabGraphic extends ex.Graphic {\n private readonly parts: CabParts;\n private readonly kind: FacilityKind;\n private readonly cabW: number;\n private readonly cw: number;\n private readonly foot = Math.round(cabRiderFoot(FLOOR)) - RIDER_FOOT;\n private readonly back: HTMLCanvasElement;\n private front: HTMLCanvasElement;\n /** The whole cab in one picture while nobody is aboard. */\n private empty: HTMLCanvasElement | null = null;\n /** The riders' pictures and slots; the first `count` entries are drawn.\n * The arrays keep their length, so a new load writes over them. */\n private readonly riders: HTMLCanvasElement[] = [];\n private readonly slots: RiderSlot[] = [];\n private count = 0;\n private ind: CarIndicator;\n\n constructor(cab: Pick<CabGfxEntry, \"w\" | \"kind\">, ind: CarIndicator = IDLE_CAR, parts: CabParts = cabParts()) {\n const cw = Math.max(1, Math.round(cab.w));\n super({ width: cw, height: FLOOR });\n this.parts = parts;\n this.kind = cab.kind;\n this.cabW = cab.w;\n this.cw = cw;\n this.back = parts.back(cab.kind, cab.w);\n this.front = parts.front(cab.w, ind.arrow, ind.full);\n this.ind = ind;\n this.show(ind);\n }\n\n /** Show state `ind`: its lantern and FULL, and its riders standing in the\n * cab. Looks up kept parts only; nothing is painted here. */\n show(ind: CarIndicator): void {\n this.ind = ind;\n this.front = this.parts.front(this.cabW, ind.arrow, ind.full);\n const rc = Math.min(ind.riders, ind.figures.length);\n let n = 0;\n for (let p = 0; p < rc; p++) {\n const rx = cabRiderX(this.cw, rc, p);\n if (rx === null) break;\n const left = Math.round(rx) - RIDER_X;\n const sx = left < 0 ? -left : 0;\n const w = Math.min(RIDER_W, this.cw - left) - sx;\n if (w <= 0) continue;\n this.riders[n] = this.parts.rider(ind.figures[p]);\n const slot = this.slots[n] ?? (this.slots[n] = { sx: 0, dx: 0, w: 0 });\n slot.sx = sx;\n slot.dx = left + sx;\n slot.w = w;\n n++;\n }\n this.count = n;\n this.empty = n === 0 ? this.parts.empty(this.kind, this.cabW, ind.arrow, ind.full) : null;\n }\n\n protected _drawImage(ctx: ex.ExcaliburGraphicsContext, x: number, y: number): void {\n if (this.empty) {\n ctx.drawImage(this.empty, x, y);\n return;\n }\n ctx.drawImage(this.back, x, y);\n for (let p = 0; p < this.count; p++) {\n const s = this.slots[p];\n ctx.drawImage(this.riders[p], s.sx, 0, s.w, RIDER_H, x + s.dx, y + this.foot, s.w, RIDER_H);\n }\n ctx.drawImage(this.front, x, y);\n }\n\n clone(): CabGraphic {\n const copy = new CabGraphic({ w: this.cabW, kind: this.kind }, this.ind, this.parts);\n const options = this.cloneGraphicOptions();\n copy.opacity = options.opacity ?? 1;\n return copy;\n }\n}\n"],"names":[],"mappings":";;;;;;;AASA;;;;;;;;AAQG;AAEH;AACO,MAAM,QAAQ,GAAiB,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;AA+B1G;;;;;AAKG;AACG,SAAU,OAAO,CAAC,KA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IAAI,CAAC;AACnC,QAAA,OAAO,IAAI;IACb;AACD;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FacilityKind } from "../../shared/types";
|
|
2
|
+
import type { CarArrow } from "../carIndicator";
|
|
3
|
+
/**
|
|
4
|
+
* The pieces a cab is put together from, each painted once and kept for the
|
|
5
|
+
* whole tower: the cab's back and front for each kind, width, lantern and
|
|
6
|
+
* FULL, and each rider's standing figure. Every cab draws these same pictures
|
|
7
|
+
* (`CabGraphic`), so each is painted and sent to the GPU once, and a car whose
|
|
8
|
+
* riders change paints nothing.
|
|
9
|
+
*/
|
|
10
|
+
export interface CabParts {
|
|
11
|
+
back(kind: FacilityKind, w: number): HTMLCanvasElement;
|
|
12
|
+
front(w: number, arrow: CarArrow, full: boolean): HTMLCanvasElement;
|
|
13
|
+
/** A cab with nobody aboard, its back and front in one picture, so the
|
|
14
|
+
* most common cab costs one image to draw. */
|
|
15
|
+
empty(kind: FacilityKind, w: number, arrow: CarArrow, full: boolean): HTMLCanvasElement;
|
|
16
|
+
rider(figure: number): HTMLCanvasElement;
|
|
17
|
+
}
|
|
18
|
+
/** Where a rider's body starts and their feet stand in their picture: room
|
|
19
|
+
* on the left for the soft shadow, on the right and above for the tallest
|
|
20
|
+
* build. */
|
|
21
|
+
export declare const RIDER_X = 4;
|
|
22
|
+
export declare const RIDER_FOOT = 26;
|
|
23
|
+
export declare const RIDER_W = 16;
|
|
24
|
+
export declare const RIDER_H = 29;
|
|
25
|
+
/** Paint the standing figure `figure` names (`figureKey`) at its spot. */
|
|
26
|
+
export declare function paintRider(ctx: CanvasRenderingContext2D, figure: number): void;
|
|
27
|
+
/** The parts, made on first use. A tower has three cab kinds, a few widths
|
|
28
|
+
* and six lantern states, and the cast stands in three moods, flat or
|
|
29
|
+
* shaded, so each cache stays a few dozen pictures. */
|
|
30
|
+
export declare function canvasCabParts(): CabParts;
|
|
31
|
+
/** The one set of parts every cab in the game shares. */
|
|
32
|
+
export declare function cabParts(): CabParts;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { drawPerson, LOOKS } from '../pixelSprites/people.js';
|
|
2
|
+
import { drawCarBack, drawCarFront } from '../sprites/transport.js';
|
|
3
|
+
import { FLOOR } from '../scale.js';
|
|
4
|
+
import { figureOf } from './crowdLook.js';
|
|
5
|
+
|
|
6
|
+
/** Where a rider's body starts and their feet stand in their picture: room
|
|
7
|
+
* on the left for the soft shadow, on the right and above for the tallest
|
|
8
|
+
* build. */
|
|
9
|
+
const RIDER_X = 4;
|
|
10
|
+
const RIDER_FOOT = 26;
|
|
11
|
+
const RIDER_W = 16;
|
|
12
|
+
const RIDER_H = 29;
|
|
13
|
+
/** Paint the standing figure `figure` names (`figureKey`) at its spot. */
|
|
14
|
+
function paintRider(ctx, figure) {
|
|
15
|
+
const f = figureOf(figure);
|
|
16
|
+
drawPerson(ctx, RIDER_X, RIDER_FOOT, LOOKS[f.look], { lit: f.lit, frame: f.frame, pose: f.pose, empty: true, mood: f.mood });
|
|
17
|
+
}
|
|
18
|
+
function picture(w, h, paint) {
|
|
19
|
+
const cv = document.createElement("canvas");
|
|
20
|
+
cv.width = w;
|
|
21
|
+
cv.height = h;
|
|
22
|
+
const ctx = cv.getContext("2d");
|
|
23
|
+
if (ctx)
|
|
24
|
+
paint(ctx);
|
|
25
|
+
return cv;
|
|
26
|
+
}
|
|
27
|
+
/** The parts, made on first use. A tower has three cab kinds, a few widths
|
|
28
|
+
* and six lantern states, and the cast stands in three moods, flat or
|
|
29
|
+
* shaded, so each cache stays a few dozen pictures. */
|
|
30
|
+
function canvasCabParts() {
|
|
31
|
+
const backs = new Map();
|
|
32
|
+
const fronts = new Map();
|
|
33
|
+
const empties = new Map();
|
|
34
|
+
const riders = new Map();
|
|
35
|
+
const cabW = (w) => Math.max(1, Math.round(w));
|
|
36
|
+
return {
|
|
37
|
+
back(kind, w) {
|
|
38
|
+
const key = `${kind}:${w}`;
|
|
39
|
+
let cv = backs.get(key);
|
|
40
|
+
if (!cv)
|
|
41
|
+
backs.set(key, (cv = picture(cabW(w), FLOOR, (ctx) => drawCarBack(ctx, w, FLOOR, kind))));
|
|
42
|
+
return cv;
|
|
43
|
+
},
|
|
44
|
+
front(w, arrow, full) {
|
|
45
|
+
const key = `${w}:${arrow ?? "x"}:${full ? "f" : "e"}`;
|
|
46
|
+
let cv = fronts.get(key);
|
|
47
|
+
if (!cv)
|
|
48
|
+
fronts.set(key, (cv = picture(cabW(w), FLOOR, (ctx) => drawCarFront(ctx, w, FLOOR, arrow, full))));
|
|
49
|
+
return cv;
|
|
50
|
+
},
|
|
51
|
+
empty(kind, w, arrow, full) {
|
|
52
|
+
const key = `${kind}:${w}:${arrow ?? "x"}:${full ? "f" : "e"}`;
|
|
53
|
+
let cv = empties.get(key);
|
|
54
|
+
if (!cv) {
|
|
55
|
+
const paint = (ctx) => {
|
|
56
|
+
drawCarBack(ctx, w, FLOOR, kind);
|
|
57
|
+
drawCarFront(ctx, w, FLOOR, arrow, full);
|
|
58
|
+
};
|
|
59
|
+
empties.set(key, (cv = picture(cabW(w), FLOOR, paint)));
|
|
60
|
+
}
|
|
61
|
+
return cv;
|
|
62
|
+
},
|
|
63
|
+
rider(figure) {
|
|
64
|
+
let cv = riders.get(figure);
|
|
65
|
+
if (!cv)
|
|
66
|
+
riders.set(figure, (cv = picture(RIDER_W, RIDER_H, (ctx) => paintRider(ctx, figure))));
|
|
67
|
+
return cv;
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
let shared;
|
|
72
|
+
/** The one set of parts every cab in the game shares. */
|
|
73
|
+
function cabParts() {
|
|
74
|
+
shared ?? (shared = canvasCabParts());
|
|
75
|
+
return shared;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { RIDER_FOOT, RIDER_H, RIDER_W, RIDER_X, cabParts, canvasCabParts, paintRider };
|
|
79
|
+
//# sourceMappingURL=cabParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cabParts.js","sources":["../../../src/render/excalibur/cabParts.ts"],"sourcesContent":["import type { FacilityKind } from \"../../shared/types\";\nimport { drawPerson, LOOKS } from \"../pixelSprites/people\";\nimport { drawCarBack, drawCarFront } from \"../sprites/transport\";\nimport type { CarArrow } from \"../carIndicator\";\nimport { FLOOR } from \"../scale\";\nimport { figureOf } from \"./crowdLook\";\n\n/**\n * The pieces a cab is put together from, each painted once and kept for the\n * whole tower: the cab's back and front for each kind, width, lantern and\n * FULL, and each rider's standing figure. Every cab draws these same pictures\n * (`CabGraphic`), so each is painted and sent to the GPU once, and a car whose\n * riders change paints nothing.\n */\nexport interface CabParts {\n back(kind: FacilityKind, w: number): HTMLCanvasElement;\n front(w: number, arrow: CarArrow, full: boolean): HTMLCanvasElement;\n /** A cab with nobody aboard, its back and front in one picture, so the\n * most common cab costs one image to draw. */\n empty(kind: FacilityKind, w: number, arrow: CarArrow, full: boolean): HTMLCanvasElement;\n rider(figure: number): HTMLCanvasElement;\n}\n\n/** Where a rider's body starts and their feet stand in their picture: room\n * on the left for the soft shadow, on the right and above for the tallest\n * build. */\nexport const RIDER_X = 4;\nexport const RIDER_FOOT = 26;\nexport const RIDER_W = 16;\nexport const RIDER_H = 29;\n\n/** Paint the standing figure `figure` names (`figureKey`) at its spot. */\nexport function paintRider(ctx: CanvasRenderingContext2D, figure: number): void {\n const f = figureOf(figure);\n drawPerson(ctx, RIDER_X, RIDER_FOOT, LOOKS[f.look], { lit: f.lit, frame: f.frame, pose: f.pose, empty: true, mood: f.mood });\n}\n\nfunction picture(w: number, h: number, paint: (ctx: CanvasRenderingContext2D) => void): HTMLCanvasElement {\n const cv = document.createElement(\"canvas\");\n cv.width = w;\n cv.height = h;\n const ctx = cv.getContext(\"2d\");\n if (ctx) paint(ctx);\n return cv;\n}\n\n/** The parts, made on first use. A tower has three cab kinds, a few widths\n * and six lantern states, and the cast stands in three moods, flat or\n * shaded, so each cache stays a few dozen pictures. */\nexport function canvasCabParts(): CabParts {\n const backs = new Map<string, HTMLCanvasElement>();\n const fronts = new Map<string, HTMLCanvasElement>();\n const empties = new Map<string, HTMLCanvasElement>();\n const riders = new Map<number, HTMLCanvasElement>();\n const cabW = (w: number) => Math.max(1, Math.round(w));\n return {\n back(kind, w) {\n const key = `${kind}:${w}`;\n let cv = backs.get(key);\n if (!cv) backs.set(key, (cv = picture(cabW(w), FLOOR, (ctx) => drawCarBack(ctx, w, FLOOR, kind))));\n return cv;\n },\n front(w, arrow, full) {\n const key = `${w}:${arrow ?? \"x\"}:${full ? \"f\" : \"e\"}`;\n let cv = fronts.get(key);\n if (!cv) fronts.set(key, (cv = picture(cabW(w), FLOOR, (ctx) => drawCarFront(ctx, w, FLOOR, arrow, full))));\n return cv;\n },\n empty(kind, w, arrow, full) {\n const key = `${kind}:${w}:${arrow ?? \"x\"}:${full ? \"f\" : \"e\"}`;\n let cv = empties.get(key);\n if (!cv) {\n const paint = (ctx: CanvasRenderingContext2D) => {\n drawCarBack(ctx, w, FLOOR, kind);\n drawCarFront(ctx, w, FLOOR, arrow, full);\n };\n empties.set(key, (cv = picture(cabW(w), FLOOR, paint)));\n }\n return cv;\n },\n rider(figure) {\n let cv = riders.get(figure);\n if (!cv) riders.set(figure, (cv = picture(RIDER_W, RIDER_H, (ctx) => paintRider(ctx, figure))));\n return cv;\n },\n };\n}\n\nlet shared: CabParts | undefined;\n\n/** The one set of parts every cab in the game shares. */\nexport function cabParts(): CabParts {\n shared ??= canvasCabParts();\n return shared;\n}\n"],"names":[],"mappings":";;;;;AAuBA;;AAEa;AACN,MAAM,OAAO,GAAG;AAChB,MAAM,UAAU,GAAG;AACnB,MAAM,OAAO,GAAG;AAChB,MAAM,OAAO,GAAG;AAEvB;AACM,SAAU,UAAU,CAAC,GAA6B,EAAE,MAAc,EAAA;AACtE,IAAA,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC1B,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,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AG,CAAC,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;YACzD;AACA,YAAA,OAAO,EAAE;QACX,CAAC;AACD,QAAA,KAAK,CAAC,MAAM,EAAA;YACV,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;AAC3B,YAAA,IAAI,CAAC,EAAE;AAAE,gBAAA,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE;AAC/F,YAAA,OAAO,EAAE;QACX,CAAC;KACF;AACH;AAEA,IAAI,MAA4B;AAEhC;SACgB,QAAQ,GAAA;AACtB,IAAA,MAAM,KAAN,MAAM,GAAK,cAAc,EAAE,CAAA;AAC3B,IAAA,OAAO,MAAM;AACf;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PersonView, TransportView } from "../../simport/view";
|
|
2
|
+
/** What `cabRidersOf` reads of the drawn tower. */
|
|
3
|
+
export interface CabSource {
|
|
4
|
+
readonly sim: {
|
|
5
|
+
readonly crowd: {
|
|
6
|
+
readonly people: ReadonlyArray<PersonView>;
|
|
7
|
+
};
|
|
8
|
+
readonly tower: {
|
|
9
|
+
readonly transports: ReadonlyArray<TransportView>;
|
|
10
|
+
readonly elevators?: ReadonlyArray<TransportView>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Who stands inside each elevator cab. The cab draws one figure for each
|
|
16
|
+
* person the crowd hides while they ride: the people who walked into the
|
|
17
|
+
* car from its line and walk off at their floor. The engine's car load is a
|
|
18
|
+
* different number, the traffic model's head count, which boards from a
|
|
19
|
+
* tally, falls by part at each stop and resets when the car parks, so it is
|
|
20
|
+
* never drawn as people (3.7.3).
|
|
21
|
+
*
|
|
22
|
+
* A rider stands at the middle of their shaft at their car's floor (the
|
|
23
|
+
* engine's `Riding` step), so a rider belongs to the shaft whose middle they
|
|
24
|
+
* stand at and whose span holds them, in the car nearest their floor.
|
|
25
|
+
*
|
|
26
|
+
* Each rider is drawn as themselves: the cab stands up the figure the crowd
|
|
27
|
+
* draws for that person on foot (their look from their seed, the mood of
|
|
28
|
+
* their wait, Modern's shading), so nobody changes clothes in the car.
|
|
29
|
+
*/
|
|
30
|
+
/** The riders aboard one car. */
|
|
31
|
+
export interface CabLoad {
|
|
32
|
+
/** How many ride. */
|
|
33
|
+
count: number;
|
|
34
|
+
/** Each rider's standing figure (`figureKey`), in the crowd's order: the
|
|
35
|
+
* first `count` entries. The array keeps its length between counts, so a
|
|
36
|
+
* count writes over it instead of growing it again. */
|
|
37
|
+
figures: number[];
|
|
38
|
+
/** The figures as one string, rebuilt only when the riders change. */
|
|
39
|
+
cast: string;
|
|
40
|
+
/** The last count's figures and how many, to tell whether `cast` is
|
|
41
|
+
* still right. */
|
|
42
|
+
prev: number[];
|
|
43
|
+
prevCount: number;
|
|
44
|
+
}
|
|
45
|
+
/** Boarded riders by shaft id, then by car index. */
|
|
46
|
+
export type CabRiders = Map<number, CabLoad[]>;
|
|
47
|
+
/** What a rider's figure reads beyond the person: the catalog's fed-up line
|
|
48
|
+
* (the mood) and whether Modern shades the figures. */
|
|
49
|
+
export interface RiderLook {
|
|
50
|
+
readonly fedUpWait: number;
|
|
51
|
+
readonly lit: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** The figures of a car's riders, as a new array (on a change only). */
|
|
54
|
+
export declare function loadFigures(load: CabLoad): number[];
|
|
55
|
+
/** The figure a hidden rider stands as in the cab: the crowd's own look for
|
|
56
|
+
* them (`personFigure`: `castIndex` of their seed, `waitMood` of their
|
|
57
|
+
* wait), standing still and facing into the car. Written out here because it
|
|
58
|
+
* runs for every rider on every step. */
|
|
59
|
+
export declare function riderFigure(p: PersonView, look: RiderLook): number;
|
|
60
|
+
/** Count the riders aboard every car into `out`, reusing its arrays. One pass
|
|
61
|
+
* over the people after one over the shafts, then one over the cars: callers
|
|
62
|
+
* run it once per sim step, never per car or per frame. */
|
|
63
|
+
export declare function countCabRiders(people: ReadonlyArray<PersonView>, transports: ReadonlyArray<TransportView>, out: CabRiders, look: RiderLook): CabRiders;
|
|
64
|
+
/** The riders aboard car `car` of shaft `shaft`; an empty load when none are
|
|
65
|
+
* counted. */
|
|
66
|
+
export declare function cabLoad(counts: CabRiders, shaft: number, car: number): CabLoad;
|
|
67
|
+
/** Riders aboard car `car` of shaft `shaft`, 0 when none are counted. */
|
|
68
|
+
export declare function ridersAboard(counts: CabRiders, shaft: number, car: number): number;
|
|
69
|
+
/** The riders aboard every car this frame: recounted when a sim step lands
|
|
70
|
+
* (`stepped`) or the crowd itself was replaced, and reused on the frames
|
|
71
|
+
* between, when nobody can board or leave. */
|
|
72
|
+
export declare function cabRidersOf(engine: CabSource, stepped: boolean, look: RiderLook): CabRiders;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { CAST } from '../pixelSprites/people.js';
|
|
2
|
+
import { ridingHidden } from './crowdFigure.js';
|
|
3
|
+
import { figureKey, IMPATIENT_SHARE } from './crowdLook.js';
|
|
4
|
+
|
|
5
|
+
const EMPTY_LOAD = newLoad();
|
|
6
|
+
function newLoad() {
|
|
7
|
+
return { count: 0, figures: [], cast: "", prev: [], prevCount: 0 };
|
|
8
|
+
}
|
|
9
|
+
/** The figures of a car's riders, as a new array (on a change only). */
|
|
10
|
+
function loadFigures(load) {
|
|
11
|
+
return load.figures.slice(0, load.count);
|
|
12
|
+
}
|
|
13
|
+
/** A figure key grows by the same step per look, so a rider's key is their
|
|
14
|
+
* look times that step plus a part that depends only on the mood and the
|
|
15
|
+
* shading, worked out once here instead of per rider per step: content,
|
|
16
|
+
* impatient and fed up, each flat then shaded. */
|
|
17
|
+
const LOOK_STEP = figureKey(1, "stand", 1, "content", false, false) - figureKey(0, "stand", 1, "content", false, false);
|
|
18
|
+
const STAND = ["content", "impatient", "fedUp"].flatMap((m) => [figureKey(0, "stand", 1, m, false, false), figureKey(0, "stand", 1, m, false, true)]);
|
|
19
|
+
const STAND_FED_UP = 4;
|
|
20
|
+
const STAND_IMPATIENT = 2;
|
|
21
|
+
const STAND_CONTENT = 0;
|
|
22
|
+
const STAND_LIT = 1;
|
|
23
|
+
/** The figure a hidden rider stands as in the cab: the crowd's own look for
|
|
24
|
+
* them (`personFigure`: `castIndex` of their seed, `waitMood` of their
|
|
25
|
+
* wait), standing still and facing into the car. Written out here because it
|
|
26
|
+
* runs for every rider on every step. */
|
|
27
|
+
function riderFigure(p, look) {
|
|
28
|
+
const wait = p.wait;
|
|
29
|
+
let stand = STAND_CONTENT;
|
|
30
|
+
if (wait > look.fedUpWait)
|
|
31
|
+
stand = STAND_FED_UP;
|
|
32
|
+
else if (wait > look.fedUpWait * IMPATIENT_SHARE)
|
|
33
|
+
stand = STAND_IMPATIENT;
|
|
34
|
+
if (look.lit)
|
|
35
|
+
stand += STAND_LIT;
|
|
36
|
+
const seed = p.seed < 0 ? -p.seed : p.seed;
|
|
37
|
+
return (seed % CAST.length) * LOOK_STEP + STAND[stand];
|
|
38
|
+
}
|
|
39
|
+
function sameAsLast(load) {
|
|
40
|
+
if (load.count !== load.prevCount)
|
|
41
|
+
return false;
|
|
42
|
+
const a = load.figures;
|
|
43
|
+
const b = load.prev;
|
|
44
|
+
for (let i = 0; i < load.count; i++)
|
|
45
|
+
if (a[i] !== b[i])
|
|
46
|
+
return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const slots = [];
|
|
50
|
+
/** The shafts standing at the last count, so a gone shaft's cars are dropped. */
|
|
51
|
+
const liveShafts = new Set();
|
|
52
|
+
/** Shafts by the x of their middle, reused by every count: shafts stacked in
|
|
53
|
+
* one column share it. A column no shaft stands in any more keeps an empty
|
|
54
|
+
* list, which finds nobody. */
|
|
55
|
+
const columns = new Map();
|
|
56
|
+
/** The car of `t` nearest floor `fy`. Its distance is left in `nearestGap`,
|
|
57
|
+
* so the per-rider search allocates nothing. */
|
|
58
|
+
let nearestGap = 0;
|
|
59
|
+
function nearestCar(t, fy) {
|
|
60
|
+
const at = t.carPositions;
|
|
61
|
+
let car = 0;
|
|
62
|
+
let gap = Math.abs(at[0] - fy);
|
|
63
|
+
for (let i = 1; i < at.length; i++) {
|
|
64
|
+
const d = Math.abs(at[i] - fy);
|
|
65
|
+
if (d < gap) {
|
|
66
|
+
car = i;
|
|
67
|
+
gap = d;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
nearestGap = gap;
|
|
71
|
+
return car;
|
|
72
|
+
}
|
|
73
|
+
/** Count the riders aboard every car into `out`, reusing its arrays. One pass
|
|
74
|
+
* over the people after one over the shafts, then one over the cars: callers
|
|
75
|
+
* run it once per sim step, never per car or per frame. */
|
|
76
|
+
function countCabRiders(people, transports, out, look) {
|
|
77
|
+
for (const loads of out.values()) {
|
|
78
|
+
for (const load of loads) {
|
|
79
|
+
// The arrays swap, so the last count stays to compare against.
|
|
80
|
+
const last = load.figures;
|
|
81
|
+
load.figures = load.prev;
|
|
82
|
+
load.prev = last;
|
|
83
|
+
load.prevCount = load.count;
|
|
84
|
+
load.count = 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
for (const column of columns.values())
|
|
88
|
+
column.length = 0;
|
|
89
|
+
liveShafts.clear();
|
|
90
|
+
let used = 0;
|
|
91
|
+
for (const t of transports) {
|
|
92
|
+
if (!Array.isArray(t.carPositions) || t.carPositions.length === 0)
|
|
93
|
+
continue;
|
|
94
|
+
liveShafts.add(t.id);
|
|
95
|
+
let loads = out.get(t.id);
|
|
96
|
+
if (!loads || loads.length !== t.carPositions.length)
|
|
97
|
+
out.set(t.id, (loads = Array.from(t.carPositions, newLoad)));
|
|
98
|
+
const slot = slots[used] ?? (slots[used] = { t, loads });
|
|
99
|
+
used++;
|
|
100
|
+
slot.t = t;
|
|
101
|
+
slot.loads = loads;
|
|
102
|
+
const mid = t.x + t.width / 2;
|
|
103
|
+
const column = columns.get(mid);
|
|
104
|
+
if (column)
|
|
105
|
+
column.push(slot);
|
|
106
|
+
else
|
|
107
|
+
columns.set(mid, [slot]);
|
|
108
|
+
}
|
|
109
|
+
for (const p of people) {
|
|
110
|
+
if (!ridingHidden(p))
|
|
111
|
+
continue;
|
|
112
|
+
const column = columns.get(p.x);
|
|
113
|
+
if (!column)
|
|
114
|
+
continue;
|
|
115
|
+
// Two stacked shafts can share their end floor (a sky lobby), so a rider
|
|
116
|
+
// there belongs to the shaft whose car stands nearest them.
|
|
117
|
+
let best;
|
|
118
|
+
let bestCar = 0;
|
|
119
|
+
let bestGap = 0;
|
|
120
|
+
for (const slot of column) {
|
|
121
|
+
const t = slot.t;
|
|
122
|
+
if (p.fy < t.bottom || p.fy > t.top)
|
|
123
|
+
continue;
|
|
124
|
+
const car = nearestCar(t, p.fy);
|
|
125
|
+
if (!best || nearestGap < bestGap) {
|
|
126
|
+
best = slot;
|
|
127
|
+
bestCar = car;
|
|
128
|
+
bestGap = nearestGap;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (!best)
|
|
132
|
+
continue;
|
|
133
|
+
const load = best.loads[bestCar];
|
|
134
|
+
load.figures[load.count++] = riderFigure(p, look);
|
|
135
|
+
}
|
|
136
|
+
// Let go of the shafts the count no longer uses.
|
|
137
|
+
slots.length = used;
|
|
138
|
+
for (const [id, loads] of out) {
|
|
139
|
+
if (!liveShafts.has(id)) {
|
|
140
|
+
out.delete(id);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
for (const load of loads) {
|
|
144
|
+
if (!sameAsLast(load))
|
|
145
|
+
load.cast = loadFigures(load).join(",");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
/** The riders aboard car `car` of shaft `shaft`; an empty load when none are
|
|
151
|
+
* counted. */
|
|
152
|
+
function cabLoad(counts, shaft, car) {
|
|
153
|
+
return counts.get(shaft)?.[car] ?? EMPTY_LOAD;
|
|
154
|
+
}
|
|
155
|
+
/** Riders aboard car `car` of shaft `shaft`, 0 when none are counted. */
|
|
156
|
+
function ridersAboard(counts, shaft, car) {
|
|
157
|
+
return cabLoad(counts, shaft, car).count;
|
|
158
|
+
}
|
|
159
|
+
/** The counts per drawn tower, kept with the crowd they were counted from. */
|
|
160
|
+
const counted = new WeakMap();
|
|
161
|
+
/** The riders aboard every car this frame: recounted when a sim step lands
|
|
162
|
+
* (`stepped`) or the crowd itself was replaced, and reused on the frames
|
|
163
|
+
* between, when nobody can board or leave. */
|
|
164
|
+
function cabRidersOf(engine, stepped, look) {
|
|
165
|
+
const people = engine.sim.crowd.people;
|
|
166
|
+
let c = counted.get(engine);
|
|
167
|
+
if (!c)
|
|
168
|
+
counted.set(engine, (c = { people: undefined, counts: new Map() }));
|
|
169
|
+
if (stepped || c.people !== people)
|
|
170
|
+
countCabRiders(people ?? [], engine.sim.tower.elevators ?? engine.sim.tower.transports ?? [], c.counts, look);
|
|
171
|
+
c.people = people;
|
|
172
|
+
return c.counts;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export { cabLoad, cabRidersOf, countCabRiders, loadFigures, riderFigure, ridersAboard };
|
|
176
|
+
//# sourceMappingURL=cabRiders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cabRiders.js","sources":["../../../src/render/excalibur/cabRiders.ts"],"sourcesContent":["import type { PersonView, TransportView } from \"../../simport/view\";\nimport { CAST } from \"../pixelSprites/people\";\nimport { ridingHidden } from \"./crowdFigure\";\nimport { figureKey, IMPATIENT_SHARE } from \"./crowdLook\";\n\n/** What `cabRidersOf` reads of the drawn tower. */\nexport interface CabSource {\n readonly sim: {\n readonly crowd: { readonly people: ReadonlyArray<PersonView> };\n readonly tower: { readonly transports: ReadonlyArray<TransportView>; readonly elevators?: ReadonlyArray<TransportView> };\n };\n}\n\n/**\n * Who stands inside each elevator cab. The cab draws one figure for each\n * person the crowd hides while they ride: the people who walked into the\n * car from its line and walk off at their floor. The engine's car load is a\n * different number, the traffic model's head count, which boards from a\n * tally, falls by part at each stop and resets when the car parks, so it is\n * never drawn as people (3.7.3).\n *\n * A rider stands at the middle of their shaft at their car's floor (the\n * engine's `Riding` step), so a rider belongs to the shaft whose middle they\n * stand at and whose span holds them, in the car nearest their floor.\n *\n * Each rider is drawn as themselves: the cab stands up the figure the crowd\n * draws for that person on foot (their look from their seed, the mood of\n * their wait, Modern's shading), so nobody changes clothes in the car.\n */\n\n/** The riders aboard one car. */\nexport interface CabLoad {\n /** How many ride. */\n count: number;\n /** Each rider's standing figure (`figureKey`), in the crowd's order: the\n * first `count` entries. The array keeps its length between counts, so a\n * count writes over it instead of growing it again. */\n figures: number[];\n /** The figures as one string, rebuilt only when the riders change. */\n cast: string;\n /** The last count's figures and how many, to tell whether `cast` is\n * still right. */\n prev: number[];\n prevCount: number;\n}\n\n/** Boarded riders by shaft id, then by car index. */\nexport type CabRiders = Map<number, CabLoad[]>;\n\n/** What a rider's figure reads beyond the person: the catalog's fed-up line\n * (the mood) and whether Modern shades the figures. */\nexport interface RiderLook {\n readonly fedUpWait: number;\n readonly lit: boolean;\n}\n\nconst EMPTY_LOAD: CabLoad = newLoad();\n\nfunction newLoad(): CabLoad {\n return { count: 0, figures: [], cast: \"\", prev: [], prevCount: 0 };\n}\n\n/** The figures of a car's riders, as a new array (on a change only). */\nexport function loadFigures(load: CabLoad): number[] {\n return load.figures.slice(0, load.count);\n}\n\n/** A figure key grows by the same step per look, so a rider's key is their\n * look times that step plus a part that depends only on the mood and the\n * shading, worked out once here instead of per rider per step: content,\n * impatient and fed up, each flat then shaded. */\nconst LOOK_STEP = figureKey(1, \"stand\", 1, \"content\", false, false) - figureKey(0, \"stand\", 1, \"content\", false, false);\nconst STAND: readonly number[] = ([\"content\", \"impatient\", \"fedUp\"] as const).flatMap((m) => [figureKey(0, \"stand\", 1, m, false, false), figureKey(0, \"stand\", 1, m, false, true)]);\nconst STAND_FED_UP = 4;\nconst STAND_IMPATIENT = 2;\nconst STAND_CONTENT = 0;\nconst STAND_LIT = 1;\n\n/** The figure a hidden rider stands as in the cab: the crowd's own look for\n * them (`personFigure`: `castIndex` of their seed, `waitMood` of their\n * wait), standing still and facing into the car. Written out here because it\n * runs for every rider on every step. */\nexport function riderFigure(p: PersonView, look: RiderLook): number {\n const wait = p.wait;\n let stand = STAND_CONTENT;\n if (wait > look.fedUpWait) stand = STAND_FED_UP;\n else if (wait > look.fedUpWait * IMPATIENT_SHARE) stand = STAND_IMPATIENT;\n if (look.lit) stand += STAND_LIT;\n const seed = p.seed < 0 ? -p.seed : p.seed;\n return (seed % CAST.length) * LOOK_STEP + STAND[stand];\n}\n\nfunction sameAsLast(load: CabLoad): boolean {\n if (load.count !== load.prevCount) return false;\n const a = load.figures;\n const b = load.prev;\n for (let i = 0; i < load.count; i++) if (a[i] !== b[i]) return false;\n return true;\n}\n\n/** A shaft the count looks in, with its cars' loads, so a rider's car is\n * found without a lookup by id. Kept and reused from count to count. */\ninterface Slot {\n t: TransportView;\n loads: CabLoad[];\n}\nconst slots: Slot[] = [];\n\n/** The shafts standing at the last count, so a gone shaft's cars are dropped. */\nconst liveShafts = new Set<number>();\n\n/** Shafts by the x of their middle, reused by every count: shafts stacked in\n * one column share it. A column no shaft stands in any more keeps an empty\n * list, which finds nobody. */\nconst columns = new Map<number, Slot[]>();\n\n/** The car of `t` nearest floor `fy`. Its distance is left in `nearestGap`,\n * so the per-rider search allocates nothing. */\nlet nearestGap = 0;\nfunction nearestCar(t: TransportView, fy: number): number {\n const at = t.carPositions;\n let car = 0;\n let gap = Math.abs(at[0] - fy);\n for (let i = 1; i < at.length; i++) {\n const d = Math.abs(at[i] - fy);\n if (d < gap) {\n car = i;\n gap = d;\n }\n }\n nearestGap = gap;\n return car;\n}\n\n/** Count the riders aboard every car into `out`, reusing its arrays. One pass\n * over the people after one over the shafts, then one over the cars: callers\n * run it once per sim step, never per car or per frame. */\nexport function countCabRiders(\n people: ReadonlyArray<PersonView>,\n transports: ReadonlyArray<TransportView>,\n out: CabRiders,\n look: RiderLook,\n): CabRiders {\n for (const loads of out.values()) {\n for (const load of loads) {\n // The arrays swap, so the last count stays to compare against.\n const last = load.figures;\n load.figures = load.prev;\n load.prev = last;\n load.prevCount = load.count;\n load.count = 0;\n }\n }\n for (const column of columns.values()) column.length = 0;\n liveShafts.clear();\n let used = 0;\n for (const t of transports) {\n if (!Array.isArray(t.carPositions) || t.carPositions.length === 0) continue;\n liveShafts.add(t.id);\n let loads = out.get(t.id);\n if (!loads || loads.length !== t.carPositions.length) out.set(t.id, (loads = Array.from(t.carPositions, newLoad)));\n const slot = slots[used] ?? (slots[used] = { t, loads });\n used++;\n slot.t = t;\n slot.loads = loads;\n const mid = t.x + t.width / 2;\n const column = columns.get(mid);\n if (column) column.push(slot);\n else columns.set(mid, [slot]);\n }\n for (const p of people) {\n if (!ridingHidden(p)) continue;\n const column = columns.get(p.x);\n if (!column) continue;\n // Two stacked shafts can share their end floor (a sky lobby), so a rider\n // there belongs to the shaft whose car stands nearest them.\n let best: Slot | undefined;\n let bestCar = 0;\n let bestGap = 0;\n for (const slot of column) {\n const t = slot.t;\n if (p.fy < t.bottom || p.fy > t.top) continue;\n const car = nearestCar(t, p.fy);\n if (!best || nearestGap < bestGap) {\n best = slot;\n bestCar = car;\n bestGap = nearestGap;\n }\n }\n if (!best) continue;\n const load = best.loads[bestCar];\n load.figures[load.count++] = riderFigure(p, look);\n }\n // Let go of the shafts the count no longer uses.\n slots.length = used;\n for (const [id, loads] of out) {\n if (!liveShafts.has(id)) {\n out.delete(id);\n continue;\n }\n for (const load of loads) {\n if (!sameAsLast(load)) load.cast = loadFigures(load).join(\",\");\n }\n }\n return out;\n}\n\n/** The riders aboard car `car` of shaft `shaft`; an empty load when none are\n * counted. */\nexport function cabLoad(counts: CabRiders, shaft: number, car: number): CabLoad {\n return counts.get(shaft)?.[car] ?? EMPTY_LOAD;\n}\n\n/** Riders aboard car `car` of shaft `shaft`, 0 when none are counted. */\nexport function ridersAboard(counts: CabRiders, shaft: number, car: number): number {\n return cabLoad(counts, shaft, car).count;\n}\n\n/** The counts per drawn tower, kept with the crowd they were counted from. */\nconst counted = new WeakMap<CabSource, { people: unknown; counts: CabRiders }>();\n\n/** The riders aboard every car this frame: recounted when a sim step lands\n * (`stepped`) or the crowd itself was replaced, and reused on the frames\n * between, when nobody can board or leave. */\nexport function cabRidersOf(engine: CabSource, stepped: boolean, look: RiderLook): CabRiders {\n const people = engine.sim.crowd.people;\n let c = counted.get(engine);\n if (!c) counted.set(engine, (c = { people: undefined, counts: new Map() }));\n if (stepped || c.people !== people) countCabRiders(people ?? [], engine.sim.tower.elevators ?? engine.sim.tower.transports ?? [], c.counts, look);\n c.people = people;\n return c.counts;\n}\n"],"names":[],"mappings":";;;;AAwDA,MAAM,UAAU,GAAY,OAAO,EAAE;AAErC,SAAS,OAAO,GAAA;IACd,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;AACpE;AAEA;AACM,SAAU,WAAW,CAAC,IAAa,EAAA;AACvC,IAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;AAC1C;AAEA;;;AAGmD;AACnD,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;AACvH,MAAM,KAAK,GAAuB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAW,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,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@
|
|
|
1
|
+
import type { TowerEngine } from "./TowerEngine";
|
|
2
|
+
/**
|
|
3
|
+
* Zoom-gated culling of the moving layer (CAP-1 of the mobile render-perf
|
|
4
|
+
* spec, `_bmad-output/specs/spec-render-perf-mobile-zoom/`): people, ambient
|
|
5
|
+
* walkers, elevator cars, the metro train, garbage trucks, and garage cars
|
|
6
|
+
* stop being drawn AND their per-frame update loops are skipped once the
|
|
7
|
+
* camera zooms out past the sub-legible threshold. Friend-module of
|
|
8
|
+
* towerCrowd, which calls {@link applyCrowdCull} at the top of its per-frame
|
|
9
|
+
* passes and {@link reassertCrowdCull} after a structural rebuild.
|
|
10
|
+
*/
|
|
11
|
+
/** Camera zoom below which the crowd/vehicle layer culls (CAP-1). A person
|
|
12
|
+
* figure is ~24 world px tall, so under this zoom it renders below ~3 screen
|
|
13
|
+
* px: sub-legible, pure per-frame cost. Rooms and structure stay drawn at
|
|
14
|
+
* every zoom; only the moving layer (people, walkers, elevator cars, train,
|
|
15
|
+
* trucks, garage cars) culls. */
|
|
16
|
+
export declare const CROWD_CULL_ZOOM = 0.125;
|
|
17
|
+
/** Re-show at a strictly higher zoom than the hide threshold (hysteresis), so
|
|
18
|
+
* a pinch sweeping across the boundary never strobes the crowd. */
|
|
19
|
+
export declare const CROWD_SHOW_ZOOM = 0.16;
|
|
20
|
+
/** Pure hysteresis step for the crowd cull: hide strictly below
|
|
21
|
+
* {@link CROWD_CULL_ZOOM}, stay hidden until the zoom climbs back to
|
|
22
|
+
* {@link CROWD_SHOW_ZOOM} or above (the re-show threshold is inclusive). */
|
|
23
|
+
export declare function crowdCullNext(zoom: number, wasCulled: boolean): boolean;
|
|
24
|
+
/** Apply the zoom cull for this frame. Returns true when the moving layer is
|
|
25
|
+
* culled and the caller should skip its per-frame work entirely. */
|
|
26
|
+
export declare function applyCrowdCull(engine: TowerEngine): boolean;
|
|
27
|
+
/** Re-assert the cull after a structural rebuild: {@link syncMotion} recreates
|
|
28
|
+
* car/walker/vehicle actors visible, so a rebuild while zoomed out must hide
|
|
29
|
+
* the fresh layer before it can flash for a frame. Runs the hysteresis step
|
|
30
|
+
* itself (not just the latch) so a rebuild that lands before the first
|
|
31
|
+
* per-frame pass, e.g. on boot with the camera already zoomed out, still
|
|
32
|
+
* hides the fresh actors; the explicit hide covers the already-latched case
|
|
33
|
+
* the step's flip branch does not touch. */
|
|
34
|
+
export declare function reassertCrowdCull(engine: TowerEngine): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoom-gated culling of the moving layer (CAP-1 of the mobile render-perf
|
|
3
|
+
* spec, `_bmad-output/specs/spec-render-perf-mobile-zoom/`): people, ambient
|
|
4
|
+
* walkers, elevator cars, the metro train, garbage trucks, and garage cars
|
|
5
|
+
* stop being drawn AND their per-frame update loops are skipped once the
|
|
6
|
+
* camera zooms out past the sub-legible threshold. Friend-module of
|
|
7
|
+
* towerCrowd, which calls {@link applyCrowdCull} at the top of its per-frame
|
|
8
|
+
* passes and {@link reassertCrowdCull} after a structural rebuild.
|
|
9
|
+
*/
|
|
10
|
+
/** Camera zoom below which the crowd/vehicle layer culls (CAP-1). A person
|
|
11
|
+
* figure is ~24 world px tall, so under this zoom it renders below ~3 screen
|
|
12
|
+
* px: sub-legible, pure per-frame cost. Rooms and structure stay drawn at
|
|
13
|
+
* every zoom; only the moving layer (people, walkers, elevator cars, train,
|
|
14
|
+
* trucks, garage cars) culls. */
|
|
15
|
+
const CROWD_CULL_ZOOM = 0.125;
|
|
16
|
+
/** Re-show at a strictly higher zoom than the hide threshold (hysteresis), so
|
|
17
|
+
* a pinch sweeping across the boundary never strobes the crowd. */
|
|
18
|
+
const CROWD_SHOW_ZOOM = 0.16;
|
|
19
|
+
/** Pure hysteresis step for the crowd cull: hide strictly below
|
|
20
|
+
* {@link CROWD_CULL_ZOOM}, stay hidden until the zoom climbs back to
|
|
21
|
+
* {@link CROWD_SHOW_ZOOM} or above (the re-show threshold is inclusive). */
|
|
22
|
+
function crowdCullNext(zoom, wasCulled) {
|
|
23
|
+
return wasCulled ? zoom < CROWD_SHOW_ZOOM : zoom < CROWD_CULL_ZOOM;
|
|
24
|
+
}
|
|
25
|
+
/** One pass over every crowd/vehicle actor, setting graphics visibility. On
|
|
26
|
+
* cull it hides the whole moving layer; on re-show it restores the vehicle
|
|
27
|
+
* groups and the regular per-frame gates (walker rank, truck hour, garage
|
|
28
|
+
* rush) immediately re-refine on the next {@link updateMotion} pass. */
|
|
29
|
+
function setCrowdLayerVisible(engine, visible) {
|
|
30
|
+
for (const c of engine.carActors)
|
|
31
|
+
c.actor.graphics.isVisible = visible;
|
|
32
|
+
for (const tr of engine.trainActors)
|
|
33
|
+
tr.actor.graphics.isVisible = visible;
|
|
34
|
+
for (const tk of engine.truckActors)
|
|
35
|
+
tk.actor.graphics.isVisible = visible;
|
|
36
|
+
for (const g of engine.garageCars)
|
|
37
|
+
g.actor.graphics.isVisible = visible;
|
|
38
|
+
for (const w of engine.walkers)
|
|
39
|
+
w.actor.graphics.isVisible = visible;
|
|
40
|
+
// The routed people are only ever force-hidden here. On re-show they stay
|
|
41
|
+
// hidden for the moment: the same tick's reconcileCrowd (which runs before
|
|
42
|
+
// the frame draws) shows every live non-rider via positionPerson, keeps
|
|
43
|
+
// riders hidden, and reaps anyone who departed while culled, so a stale
|
|
44
|
+
// figure never flashes at a minutes-old position.
|
|
45
|
+
if (!visible)
|
|
46
|
+
for (const rec of engine.crowdActors.values())
|
|
47
|
+
rec.actor.graphics.isVisible = false;
|
|
48
|
+
}
|
|
49
|
+
/** Apply the zoom cull for this frame. Returns true when the moving layer is
|
|
50
|
+
* culled and the caller should skip its per-frame work entirely. */
|
|
51
|
+
function applyCrowdCull(engine) {
|
|
52
|
+
const culled = crowdCullNext(engine.cam.zoom, engine.crowdCulled);
|
|
53
|
+
if (culled !== engine.crowdCulled) {
|
|
54
|
+
engine.crowdCulled = culled;
|
|
55
|
+
setCrowdLayerVisible(engine, !culled);
|
|
56
|
+
}
|
|
57
|
+
return culled;
|
|
58
|
+
}
|
|
59
|
+
/** Re-assert the cull after a structural rebuild: {@link syncMotion} recreates
|
|
60
|
+
* car/walker/vehicle actors visible, so a rebuild while zoomed out must hide
|
|
61
|
+
* the fresh layer before it can flash for a frame. Runs the hysteresis step
|
|
62
|
+
* itself (not just the latch) so a rebuild that lands before the first
|
|
63
|
+
* per-frame pass, e.g. on boot with the camera already zoomed out, still
|
|
64
|
+
* hides the fresh actors; the explicit hide covers the already-latched case
|
|
65
|
+
* the step's flip branch does not touch. */
|
|
66
|
+
function reassertCrowdCull(engine) {
|
|
67
|
+
if (applyCrowdCull(engine))
|
|
68
|
+
setCrowdLayerVisible(engine, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { CROWD_CULL_ZOOM, CROWD_SHOW_ZOOM, applyCrowdCull, crowdCullNext, reassertCrowdCull };
|
|
72
|
+
//# sourceMappingURL=crowdCull.js.map
|