@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 @@
|
|
|
1
|
+
{"version":3,"file":"paint.js","sources":["../../../src/render/overviewMap/paint.ts"],"sourcesContent":["/**\n * Paints a draw list onto a 2D canvas context (#343). Nothing here reads the\n * simulation: it takes the marks, looks each kind's style up, and fills\n * rectangles. A pattern is one cached tile per fill and pattern, so a repaint\n * is one `fillRect` per mark, with the style resolved once per run of\n * same-kind marks (the draw list groups them) and the fill style changing only\n * when the style does.\n *\n * Units are device pixels: the caller sizes the canvas's backing store to the\n * layout (CSS size times `devicePixelRatio`) and applies no context scale, so\n * a pattern tile's 1-pixel marks stay crisp at any ratio. Use one pattern source\n * per canvas: a repeating fill is created on one context and cached by fill\n * and pattern only.\n */\nimport { mapStyleFor, patternInk, type MapPattern } from \"./style\";\nimport type { MapMark } from \"./drawList\";\nimport type { MapRect } from \"./geometry\";\n\n/** The slice of a 2D context the painter uses. */\nexport interface MapPaintContext {\n fillStyle: string | CanvasGradient | CanvasPattern;\n fillRect(x: number, y: number, w: number, h: number): void;\n clearRect(x: number, y: number, w: number, h: number): void;\n}\n\n/** Hands back what to assign to `fillStyle` for a fill and pattern: the plain\n * color for `solid`, a repeating tile otherwise. */\nexport interface PatternSource {\n get(fill: string, pattern: MapPattern): string | CanvasPattern;\n}\n\n/** Side of a pattern tile in device pixels. */\nexport const PATTERN_TILE = 4;\n\n/** The ink marks inside a pattern tile, as `[x, y]` tile pixels. The rest of\n * the tile is the fill. */\nexport function patternCells(pattern: MapPattern): ReadonlyArray<readonly [number, number]> {\n const n = PATTERN_TILE;\n const cells: Array<readonly [number, number]> = [];\n switch (pattern) {\n case \"solid\":\n break;\n case \"dots\":\n cells.push([1, 1]);\n break;\n case \"diagonal\":\n for (let i = 0; i < n; i++) cells.push([i, i]);\n break;\n case \"horizontal\":\n for (let x = 0; x < n; x++) cells.push([x, 1]);\n break;\n case \"grid\":\n for (let i = 0; i < n; i++) {\n cells.push([i, 0]);\n if (i > 0) cells.push([0, i]);\n }\n break;\n case \"checker\":\n for (let y = 0; y < n; y++) for (let x = 0; x < n; x++) if (Math.floor(x / 2) % 2 === Math.floor(y / 2) % 2) cells.push([x, y]);\n break;\n case \"outline\":\n for (let i = 0; i < n; i++) {\n cells.push([i, 0]);\n cells.push([i, n - 1]);\n if (i > 0 && i < n - 1) {\n cells.push([0, i]);\n cells.push([n - 1, i]);\n }\n }\n break;\n }\n return cells;\n}\n\n/** What turns a tile into a repeating fill: the paint target's `createPattern`.\n * A real `CanvasRenderingContext2D` fits. */\nexport type PatternTarget = Pick<CanvasRenderingContext2D, \"createPattern\">;\n\n/**\n * A pattern source over a scratch-canvas factory (`document.createElement('canvas')`\n * in the page, a fake in tests) and the context the patterns are used on.\n * `solid` is the plain color. A tile that cannot be built right now (no 2D\n * context, no pattern) answers the plain fill for this call and is not cached,\n * so a later call tries again.\n */\nexport function createPatternSource(makeCanvas: () => HTMLCanvasElement, target: PatternTarget): PatternSource {\n const cache = new Map<string, CanvasPattern>();\n return {\n get(fill, pattern) {\n if (pattern === \"solid\") return fill;\n const key = `${pattern}|${fill}`;\n const hit = cache.get(key);\n if (hit !== undefined) return hit;\n const tile = makeCanvas();\n tile.width = PATTERN_TILE;\n tile.height = PATTERN_TILE;\n const ctx = tile.getContext(\"2d\");\n if (!ctx) return fill;\n ctx.fillStyle = fill;\n ctx.fillRect(0, 0, PATTERN_TILE, PATTERN_TILE);\n ctx.fillStyle = patternInk(fill);\n for (const [x, y] of patternCells(pattern)) ctx.fillRect(x, y, 1, 1);\n const made = target.createPattern(tile, \"repeat\");\n if (!made) return fill;\n cache.set(key, made);\n return made;\n },\n };\n}\n\n/** A mark smaller than this on either side (map pixels) paints as a plain\n * fill: a pattern needs room to read, and a thin mark would only look noisy. */\nexport const MIN_PATTERN_SIDE = PATTERN_TILE;\n\n/**\n * Clear the map and paint `marks` in order, with the gaps between buildings\n * (`buildMapGaps`) cleared again after the rooms and before the shafts, so\n * the backdrop shows through them and a shaft beside one draws whole.\n * Returns how many `fillRect` calls the marks took, which the budget tests\n * read.\n */\nexport function paintMapMarks(\n ctx: MapPaintContext,\n width: number,\n height: number,\n marks: ReadonlyArray<MapMark>,\n gaps: ReadonlyArray<MapRect>,\n patterns: PatternSource,\n): number {\n ctx.clearRect(0, 0, width, height);\n const shafts = transportStart(marks);\n const fills = paintMarkRange(ctx, marks, 0, shafts, patterns);\n clearGaps(ctx, gaps);\n return fills + paintMarkRange(ctx, marks, shafts, marks.length, patterns);\n}\n\n/**\n * Clear the gaps between buildings and paint the draw list's transport marks\n * again, over what a view painted on the rooms, so the gaps and the shafts\n * stay as the Edit view draws them. The draw list puts the transports last,\n * so this walks back over them alone. Returns how many `fillRect` calls it\n * took.\n */\nexport function paintGapsAndShafts(ctx: MapPaintContext, marks: ReadonlyArray<MapMark>, gaps: ReadonlyArray<MapRect>, patterns: PatternSource): number {\n clearGaps(ctx, gaps);\n return paintMarkRange(ctx, marks, transportStart(marks), marks.length, patterns);\n}\n\n/** Where the trailing run of transport marks starts (`marks.length` for none). */\nfunction transportStart(marks: ReadonlyArray<MapMark>): number {\n let start = marks.length;\n while (start > 0 && marks[start - 1].layer === \"transport\") start--;\n return start;\n}\n\nfunction clearGaps(ctx: MapPaintContext, gaps: ReadonlyArray<MapRect>): void {\n for (const gap of gaps) ctx.clearRect(gap.x, gap.y, gap.w, gap.h);\n}\n\n/** Paint `marks[from]` up to `marks[to - 1]` in order. */\nfunction paintMarkRange(ctx: MapPaintContext, marks: ReadonlyArray<MapMark>, from: number, to: number, patterns: PatternSource): number {\n let last: string | CanvasPattern | null = null;\n let kind: MapMark[\"kind\"] | null = null;\n let styled: string | CanvasPattern = \"\";\n let plain: string | CanvasPattern = \"\";\n let fills = 0;\n for (let i = from; i < to; i++) {\n const mark = marks[i];\n if (mark.kind !== kind) {\n // The draw list groups same-kind marks, so this resolves about once per kind.\n kind = mark.kind;\n const style = mapStyleFor(kind);\n styled = patterns.get(style.fill, style.pattern);\n plain = patterns.get(style.fill, \"solid\");\n }\n const small = mark.rect.w < MIN_PATTERN_SIDE || mark.rect.h < MIN_PATTERN_SIDE;\n const fillStyle = small ? plain : styled;\n if (fillStyle !== last) {\n ctx.fillStyle = fillStyle;\n last = fillStyle;\n }\n ctx.fillRect(mark.rect.x, mark.rect.y, mark.rect.w, mark.rect.h);\n fills++;\n }\n return fills;\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAaG;AAkBH;AACO,MAAM,YAAY,GAAG;AAE5B;AAC4B;AACtB,SAAU,YAAY,CAAC,OAAmB,EAAA;IAC9C,MAAM,CAAC,GAAG,YAAY;IACtB,MAAM,KAAK,GAAqC,EAAE;IAClD,QAAQ,OAAO;AACb,QAAA,KAAK,OAAO;YACV;AACF,QAAA,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClB;AACF,QAAA,KAAK,UAAU;YACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC9C;AACF,QAAA,KAAK,YAAY;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC9C;AACF,QAAA,KAAK,MAAM;AACT,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC1B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAClB,IAAI,CAAC,GAAG,CAAC;oBAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/B;YACA;A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;IACtC,IAAI,KAAK,GAAG,CAAC;AACb,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;AAC9B,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACrB,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE;;AAEtB,YAAA,IAAI,GAAG,IAAI,CAAC,IAAI;AAChB,YAAA,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;AAC/B,YAAA,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YAChD,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;QAC3C;AACA,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,gBAAgB,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,gBAAgB;QAC9E,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM;AACxC,QAAA,IAAI,SAAS,KAAK,IAAI,EAAE;AACtB,YAAA,GAAG,CAAC,SAAS,GAAG,SAAS;YACzB,IAAI,GAAG,SAAS;QAClB;QACA,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,QAAA,KAAK,EAAE;IACT;AACA,IAAA,OAAO,KAAK;AACd;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How each kind looks on the overview MAP window (#343): a fill and a pattern
|
|
3
|
+
* per kind. Presentation only: no rule lives here, so it sits with the
|
|
4
|
+
* renderer, like `FACILITY_PRESENTATION`. The map has one look in both game
|
|
5
|
+
* modes (owner, 2026-11-04).
|
|
6
|
+
*
|
|
7
|
+
* Kinds are grouped by what they are to the player (work, homes, hotels, food
|
|
8
|
+
* and retail, entertainment, amenities, services, shafts). The room groups
|
|
9
|
+
* each get their own pattern as an accessibility addition, the three elevator
|
|
10
|
+
* kinds get one each, and the plain solid groups (floor, lobby, offices) differ
|
|
11
|
+
* in lightness by a wide margin, so the tower reads without color vision. The
|
|
12
|
+
* room fills are the facility colors the sprites and palette already use,
|
|
13
|
+
* except where one is too dark for the map's backdrop (`MAP_ROOM_FILL`). A
|
|
14
|
+
* kind with no group is a compile error (`KIND_GROUP` is an exhaustive record).
|
|
15
|
+
* A kind the table has never heard of at run time (a forged save, a newer
|
|
16
|
+
* engine) paints as a loud placeholder.
|
|
17
|
+
*/
|
|
18
|
+
import type { FacilityKind } from "../../shared/types";
|
|
19
|
+
/** The marks a pattern tile is built from. `solid` is a plain fill. */
|
|
20
|
+
export type MapPattern = "solid" | "dots" | "diagonal" | "horizontal" | "grid" | "checker" | "outline";
|
|
21
|
+
/** What a kind is to the player, for the patterns and for picking the shafts out. */
|
|
22
|
+
export type MapGroup = "ground" | "lobby" | "work" | "homes" | "hotels" | "foodAndRetail" | "entertainment" | "amenities" | "services" | "stairs" | "elevatorStandard" | "elevatorService" | "elevatorExpress";
|
|
23
|
+
export declare const KIND_GROUP: Readonly<Record<FacilityKind, MapGroup>>;
|
|
24
|
+
export declare const GROUP_PATTERN: Readonly<Record<MapGroup, MapPattern>>;
|
|
25
|
+
/** Relative luminance of a `#rrggbb` color (0 to 1), or null for any other
|
|
26
|
+
* string. */
|
|
27
|
+
export declare function hexLuminance(color: string): number | null;
|
|
28
|
+
/** Contrast ratio between two relative luminances, 1 to 21. */
|
|
29
|
+
export declare function contrastRatio(a: number, b: number): number;
|
|
30
|
+
/** The color of a pattern's marks on a fill: dark on a light fill and light on
|
|
31
|
+
* a dark one, so the pattern shows whatever the fill. A fill that is not a
|
|
32
|
+
* `#rrggbb` color gets dark ink. */
|
|
33
|
+
export declare function patternInk(fill: string): string;
|
|
34
|
+
/** The shaft fills, kept clear of every room color (style.test.ts measures
|
|
35
|
+
* each pair) and at least 3:1 against the backdrop's sky and ground, since a
|
|
36
|
+
* shaft can run past the top floor or over the lot's edge onto them. */
|
|
37
|
+
export declare const SHAFT_FILL: Readonly<Partial<Record<MapGroup, string>>>;
|
|
38
|
+
export interface MapKindStyle {
|
|
39
|
+
readonly fill: string;
|
|
40
|
+
readonly pattern: MapPattern;
|
|
41
|
+
}
|
|
42
|
+
/** What a kind the table does not know paints as. */
|
|
43
|
+
export declare const UNKNOWN_KIND_STYLE: MapKindStyle;
|
|
44
|
+
/** The fill and pattern for a kind. An unknown kind at run time reads as the
|
|
45
|
+
* placeholder, never throws. */
|
|
46
|
+
export declare function mapStyleFor(kind: FacilityKind): MapKindStyle;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { FACILITY_PRESENTATION } from '../../presentation/facilityPresentation.js';
|
|
2
|
+
|
|
3
|
+
const KIND_GROUP = {
|
|
4
|
+
floor: "ground",
|
|
5
|
+
lobby: "lobby",
|
|
6
|
+
office: "work",
|
|
7
|
+
condo: "homes",
|
|
8
|
+
rentalStudio: "homes",
|
|
9
|
+
rentalApartment: "homes",
|
|
10
|
+
hotelSingle: "hotels",
|
|
11
|
+
hotelDouble: "hotels",
|
|
12
|
+
hotelSuite: "hotels",
|
|
13
|
+
fastFood: "foodAndRetail",
|
|
14
|
+
restaurant: "foodAndRetail",
|
|
15
|
+
foodHall: "foodAndRetail",
|
|
16
|
+
shop: "foodAndRetail",
|
|
17
|
+
boutiqueBay: "foodAndRetail",
|
|
18
|
+
skyBar: "foodAndRetail",
|
|
19
|
+
cinema: "entertainment",
|
|
20
|
+
partyHall: "entertainment",
|
|
21
|
+
amusements: "entertainment",
|
|
22
|
+
nightclub: "entertainment",
|
|
23
|
+
aquaticCenter: "entertainment",
|
|
24
|
+
weddingHall: "entertainment",
|
|
25
|
+
fitnessClub: "amenities",
|
|
26
|
+
clinic: "amenities",
|
|
27
|
+
spa: "amenities",
|
|
28
|
+
daycare: "amenities",
|
|
29
|
+
parking: "services",
|
|
30
|
+
parkingRamp: "services",
|
|
31
|
+
security: "services",
|
|
32
|
+
medical: "services",
|
|
33
|
+
housekeeping: "services",
|
|
34
|
+
recycling: "services",
|
|
35
|
+
metro: "services",
|
|
36
|
+
stairs: "stairs",
|
|
37
|
+
escalator: "stairs",
|
|
38
|
+
elevatorStandard: "elevatorStandard",
|
|
39
|
+
elevatorService: "elevatorService",
|
|
40
|
+
elevatorExpress: "elevatorExpress",
|
|
41
|
+
};
|
|
42
|
+
const GROUP_PATTERN = {
|
|
43
|
+
ground: "solid",
|
|
44
|
+
lobby: "solid",
|
|
45
|
+
work: "solid",
|
|
46
|
+
homes: "dots",
|
|
47
|
+
hotels: "diagonal",
|
|
48
|
+
foodAndRetail: "horizontal",
|
|
49
|
+
entertainment: "grid",
|
|
50
|
+
amenities: "checker",
|
|
51
|
+
services: "outline",
|
|
52
|
+
stairs: "diagonal",
|
|
53
|
+
elevatorStandard: "solid",
|
|
54
|
+
elevatorService: "dots",
|
|
55
|
+
elevatorExpress: "grid",
|
|
56
|
+
};
|
|
57
|
+
/** Relative luminance of a `#rrggbb` color (0 to 1), or null for any other
|
|
58
|
+
* string. */
|
|
59
|
+
function hexLuminance(color) {
|
|
60
|
+
const m = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);
|
|
61
|
+
if (!m)
|
|
62
|
+
return null;
|
|
63
|
+
const [r, g, b] = [m[1], m[2], m[3]].map((h) => {
|
|
64
|
+
const c = parseInt(h, 16) / 255;
|
|
65
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
66
|
+
});
|
|
67
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
68
|
+
}
|
|
69
|
+
/** Contrast ratio between two relative luminances, 1 to 21. */
|
|
70
|
+
function contrastRatio(a, b) {
|
|
71
|
+
const [hi, lo] = a >= b ? [a, b] : [b, a];
|
|
72
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
73
|
+
}
|
|
74
|
+
const INK_DARK = "#1c1c1c";
|
|
75
|
+
const INK_LIGHT = "#f2f2f2";
|
|
76
|
+
/** The color of a pattern's marks on a fill: dark on a light fill and light on
|
|
77
|
+
* a dark one, so the pattern shows whatever the fill. A fill that is not a
|
|
78
|
+
* `#rrggbb` color gets dark ink. */
|
|
79
|
+
function patternInk(fill) {
|
|
80
|
+
const lum = hexLuminance(fill);
|
|
81
|
+
if (lum === null)
|
|
82
|
+
return INK_DARK;
|
|
83
|
+
const dark = hexLuminance(INK_DARK);
|
|
84
|
+
const light = hexLuminance(INK_LIGHT);
|
|
85
|
+
return contrastRatio(lum, light) > contrastRatio(lum, dark) ? INK_LIGHT : INK_DARK;
|
|
86
|
+
}
|
|
87
|
+
/** The shaft fills, kept clear of every room color (style.test.ts measures
|
|
88
|
+
* each pair) and at least 3:1 against the backdrop's sky and ground, since a
|
|
89
|
+
* shaft can run past the top floor or over the lot's edge onto them. */
|
|
90
|
+
const SHAFT_FILL = {
|
|
91
|
+
stairs: "#6c7484",
|
|
92
|
+
elevatorStandard: "#9aa3b2",
|
|
93
|
+
elevatorService: "#f05458",
|
|
94
|
+
elevatorExpress: "#4a8cf0",
|
|
95
|
+
};
|
|
96
|
+
/** The map's own fill for a room whose facility color falls under 3:1 against
|
|
97
|
+
* the backdrop (#1803). Each stays close to its facility color, so the room
|
|
98
|
+
* reads as the same thing it is in the main view. The main view keeps the
|
|
99
|
+
* facility colors: its backdrop is not the map's. */
|
|
100
|
+
const MAP_ROOM_FILL = {
|
|
101
|
+
parkingRamp: "#7c706c",
|
|
102
|
+
security: "#5474a4",
|
|
103
|
+
};
|
|
104
|
+
/** What a kind the table does not know paints as. */
|
|
105
|
+
const UNKNOWN_KIND_STYLE = { fill: "#ff00ff", pattern: "outline" };
|
|
106
|
+
/** The fill and pattern for a kind. An unknown kind at run time reads as the
|
|
107
|
+
* placeholder, never throws. */
|
|
108
|
+
function mapStyleFor(kind) {
|
|
109
|
+
if (!Object.prototype.hasOwnProperty.call(KIND_GROUP, kind))
|
|
110
|
+
return UNKNOWN_KIND_STYLE;
|
|
111
|
+
const group = KIND_GROUP[kind];
|
|
112
|
+
const shaft = SHAFT_FILL[group];
|
|
113
|
+
return { fill: shaft ?? MAP_ROOM_FILL[kind] ?? FACILITY_PRESENTATION[kind].color, pattern: GROUP_PATTERN[group] };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { GROUP_PATTERN, KIND_GROUP, SHAFT_FILL, UNKNOWN_KIND_STYLE, contrastRatio, hexLuminance, mapStyleFor, patternInk };
|
|
117
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/render/overviewMap/style.ts"],"sourcesContent":["/**\n * How each kind looks on the overview MAP window (#343): a fill and a pattern\n * per kind. Presentation only: no rule lives here, so it sits with the\n * renderer, like `FACILITY_PRESENTATION`. The map has one look in both game\n * modes (owner, 2026-11-04).\n *\n * Kinds are grouped by what they are to the player (work, homes, hotels, food\n * and retail, entertainment, amenities, services, shafts). The room groups\n * each get their own pattern as an accessibility addition, the three elevator\n * kinds get one each, and the plain solid groups (floor, lobby, offices) differ\n * in lightness by a wide margin, so the tower reads without color vision. The\n * room fills are the facility colors the sprites and palette already use,\n * except where one is too dark for the map's backdrop (`MAP_ROOM_FILL`). A\n * kind with no group is a compile error (`KIND_GROUP` is an exhaustive record).\n * A kind the table has never heard of at run time (a forged save, a newer\n * engine) paints as a loud placeholder.\n */\nimport type { FacilityKind } from \"../../shared/types\";\nimport { FACILITY_PRESENTATION } from \"../../presentation/facilityPresentation\";\n\n/** The marks a pattern tile is built from. `solid` is a plain fill. */\nexport type MapPattern = \"solid\" | \"dots\" | \"diagonal\" | \"horizontal\" | \"grid\" | \"checker\" | \"outline\";\n\n/** What a kind is to the player, for the patterns and for picking the shafts out. */\nexport type MapGroup =\n | \"ground\"\n | \"lobby\"\n | \"work\"\n | \"homes\"\n | \"hotels\"\n | \"foodAndRetail\"\n | \"entertainment\"\n | \"amenities\"\n | \"services\"\n | \"stairs\"\n | \"elevatorStandard\"\n | \"elevatorService\"\n | \"elevatorExpress\";\n\nexport const KIND_GROUP: Readonly<Record<FacilityKind, MapGroup>> = {\n floor: \"ground\",\n lobby: \"lobby\",\n office: \"work\",\n condo: \"homes\",\n rentalStudio: \"homes\",\n rentalApartment: \"homes\",\n hotelSingle: \"hotels\",\n hotelDouble: \"hotels\",\n hotelSuite: \"hotels\",\n fastFood: \"foodAndRetail\",\n restaurant: \"foodAndRetail\",\n foodHall: \"foodAndRetail\",\n shop: \"foodAndRetail\",\n boutiqueBay: \"foodAndRetail\",\n skyBar: \"foodAndRetail\",\n cinema: \"entertainment\",\n partyHall: \"entertainment\",\n amusements: \"entertainment\",\n nightclub: \"entertainment\",\n aquaticCenter: \"entertainment\",\n weddingHall: \"entertainment\",\n fitnessClub: \"amenities\",\n clinic: \"amenities\",\n spa: \"amenities\",\n daycare: \"amenities\",\n parking: \"services\",\n parkingRamp: \"services\",\n security: \"services\",\n medical: \"services\",\n housekeeping: \"services\",\n recycling: \"services\",\n metro: \"services\",\n stairs: \"stairs\",\n escalator: \"stairs\",\n elevatorStandard: \"elevatorStandard\",\n elevatorService: \"elevatorService\",\n elevatorExpress: \"elevatorExpress\",\n};\n\nexport const GROUP_PATTERN: Readonly<Record<MapGroup, MapPattern>> = {\n ground: \"solid\",\n lobby: \"solid\",\n work: \"solid\",\n homes: \"dots\",\n hotels: \"diagonal\",\n foodAndRetail: \"horizontal\",\n entertainment: \"grid\",\n amenities: \"checker\",\n services: \"outline\",\n stairs: \"diagonal\",\n elevatorStandard: \"solid\",\n elevatorService: \"dots\",\n elevatorExpress: \"grid\",\n};\n\n/** Relative luminance of a `#rrggbb` color (0 to 1), or null for any other\n * string. */\nexport function hexLuminance(color: string): number | null {\n const m = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);\n if (!m) return null;\n const [r, g, b] = [m[1], m[2], m[3]].map((h) => {\n const c = parseInt(h, 16) / 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** Contrast ratio between two relative luminances, 1 to 21. */\nexport function contrastRatio(a: number, b: number): number {\n const [hi, lo] = a >= b ? [a, b] : [b, a];\n return (hi + 0.05) / (lo + 0.05);\n}\n\nconst INK_DARK = \"#1c1c1c\";\nconst INK_LIGHT = \"#f2f2f2\";\n\n/** The color of a pattern's marks on a fill: dark on a light fill and light on\n * a dark one, so the pattern shows whatever the fill. A fill that is not a\n * `#rrggbb` color gets dark ink. */\nexport function patternInk(fill: string): string {\n const lum = hexLuminance(fill);\n if (lum === null) return INK_DARK;\n const dark = hexLuminance(INK_DARK)!;\n const light = hexLuminance(INK_LIGHT)!;\n return contrastRatio(lum, light) > contrastRatio(lum, dark) ? INK_LIGHT : INK_DARK;\n}\n\n/** The shaft fills, kept clear of every room color (style.test.ts measures\n * each pair) and at least 3:1 against the backdrop's sky and ground, since a\n * shaft can run past the top floor or over the lot's edge onto them. */\nexport const SHAFT_FILL: Readonly<Partial<Record<MapGroup, string>>> = {\n stairs: \"#6c7484\",\n elevatorStandard: \"#9aa3b2\",\n elevatorService: \"#f05458\",\n elevatorExpress: \"#4a8cf0\",\n};\n\n/** The map's own fill for a room whose facility color falls under 3:1 against\n * the backdrop (#1803). Each stays close to its facility color, so the room\n * reads as the same thing it is in the main view. The main view keeps the\n * facility colors: its backdrop is not the map's. */\nconst MAP_ROOM_FILL: Readonly<Partial<Record<FacilityKind, string>>> = {\n parkingRamp: \"#7c706c\",\n security: \"#5474a4\",\n};\n\nexport interface MapKindStyle {\n readonly fill: string;\n readonly pattern: MapPattern;\n}\n\n/** What a kind the table does not know paints as. */\nexport const UNKNOWN_KIND_STYLE: MapKindStyle = { fill: \"#ff00ff\", pattern: \"outline\" };\n\n/** The fill and pattern for a kind. An unknown kind at run time reads as the\n * placeholder, never throws. */\nexport function mapStyleFor(kind: FacilityKind): MapKindStyle {\n if (!Object.prototype.hasOwnProperty.call(KIND_GROUP, kind)) return UNKNOWN_KIND_STYLE;\n const group = KIND_GROUP[kind];\n const shaft = SHAFT_FILL[group];\n return { fill: shaft ?? MAP_ROOM_FILL[kind] ?? FACILITY_PRESENTATION[kind].color, pattern: GROUP_PATTERN[group] };\n}\n"],"names":[],"mappings":";;AAuCO,MAAM,UAAU,GAA6C;AAClE,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,eAAe,EAAE,OAAO;AACxB,IAAA,WAAW,EAAE,QAAQ;AACrB,IAAA,WAAW,EAAE,QAAQ;AACrB,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,WAAW,EAAE,eAAe;AAC5B,IAAA,MAAM,EAAE,eAAe;AACvB,IAAA,MAAM,EAAE,eAAe;AACvB,IAAA,SAAS,EAAE,eAAe;AAC1B,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,SAAS,EAAE,eAAe;AAC1B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,WAAW,EAAE,eAAe;AAC5B,IAAA,WAAW,EAAE,WAAW;AACxB,IAAA,MAAM,EAAE,WAAW;AACnB,IAAA,GAAG,EAAE,WAAW;AAChB,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,WAAW,EAAE,UAAU;AACvB,IAAA,QAAQ,EAAE,UAAU;A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WAAW,CAAC,IAAkB,EAAA;AAC5C,IAAA,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC;AAAE,QAAA,OAAO,kBAAkB;AACtF,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAC/B,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE;AACnH;;"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The overview MAP window's Eval and Pricing views (#343 S8, #1618, #1619):
|
|
3
|
+
* each room the engine rates paints over the Edit map in its tier's color, as
|
|
4
|
+
* the original's tinted tabs do. The engine decides every tier (`roomTiers`,
|
|
5
|
+
* read through `RoomTierReader`), so nothing here compares a score or a
|
|
6
|
+
* price: it matches the engine's rows to the view's rooms, places them on the
|
|
7
|
+
* map and paints them.
|
|
8
|
+
*
|
|
9
|
+
* One read carries both views, so a switch between Eval and Pricing reads
|
|
10
|
+
* nothing. `TierMarks.take` copies a read's rows (one pass over the rows) and
|
|
11
|
+
* `TierMarks.place` matches them to the rooms and finds their rectangles (one
|
|
12
|
+
* pass over the rooms); both run only on the triggers the window's views
|
|
13
|
+
* controller names, never on a steady frame.
|
|
14
|
+
*
|
|
15
|
+
* Both game modes use the same look (owner, 2026-11-04). Color is not the only
|
|
16
|
+
* cue: the tiers of one view differ in pattern too, a room big enough to carry
|
|
17
|
+
* a pattern gets it, and the legend counts the rooms in words. A room the
|
|
18
|
+
* engine lists with no evaluation (Eval) or with no rent level or No Rate
|
|
19
|
+
* (Pricing) keeps its Edit look.
|
|
20
|
+
*/
|
|
21
|
+
import type { FacilityKind } from "../../shared/types";
|
|
22
|
+
import type { EvalTier, RentTier, RoomTiers } from "../../simport/roomTiers";
|
|
23
|
+
import type { UnitView } from "../../simport/view";
|
|
24
|
+
import { type MapLayout, type MapRect } from "./geometry";
|
|
25
|
+
import { type MapPaintContext, type PatternSource } from "./paint";
|
|
26
|
+
import type { MapKindStyle } from "./style";
|
|
27
|
+
/** The views this file paints. */
|
|
28
|
+
export type TierViewId = "eval" | "pricing";
|
|
29
|
+
/** How the Eval view paints each evaluation, after the original's three
|
|
30
|
+
* swatches (Excellent cyan, Good olive yellow, Terrible red). An unrated room
|
|
31
|
+
* is not painted. */
|
|
32
|
+
export declare const EVAL_VIEW_STYLE: Readonly<Record<EvalTier, MapKindStyle | null>>;
|
|
33
|
+
/** How the Pricing view paints each rent level, after the original's four
|
|
34
|
+
* swatches (High red, Average olive, Low green, Very Low cyan). A room with
|
|
35
|
+
* no rent level, or one taken off the market (No Rate), is not painted. */
|
|
36
|
+
export declare const RENT_VIEW_STYLE: Readonly<Record<RentTier, MapKindStyle | null>>;
|
|
37
|
+
/** One legend entry: its label and the tier it counts. */
|
|
38
|
+
export interface TierLegendEntry<T extends string> {
|
|
39
|
+
readonly label: string;
|
|
40
|
+
readonly tier: T;
|
|
41
|
+
readonly style: MapKindStyle;
|
|
42
|
+
}
|
|
43
|
+
/** The Eval legend, best first, as in the original. */
|
|
44
|
+
export declare const EVAL_LEGEND: ReadonlyArray<TierLegendEntry<EvalTier>>;
|
|
45
|
+
/** The Pricing legend, highest first, as in the original. */
|
|
46
|
+
export declare const PRICING_LEGEND: ReadonlyArray<TierLegendEntry<RentTier>>;
|
|
47
|
+
/** The room fields the tier views read. */
|
|
48
|
+
export type TierRoom = Pick<UnitView, "id" | "kind" | "floor" | "x" | "width">;
|
|
49
|
+
/**
|
|
50
|
+
* The rows of the last read, and where each matched room sits on the map.
|
|
51
|
+
* The rows are the engine's; the rectangles are found again whenever the
|
|
52
|
+
* rooms or the layout change, so a room removed since the read drops out
|
|
53
|
+
* and a moved layout moves the marks.
|
|
54
|
+
*/
|
|
55
|
+
export declare class TierMarks {
|
|
56
|
+
private ids;
|
|
57
|
+
private floors;
|
|
58
|
+
private xs;
|
|
59
|
+
private evals;
|
|
60
|
+
private rents;
|
|
61
|
+
/** Matched rows: their rectangles and their row numbers, in room order. */
|
|
62
|
+
private rects;
|
|
63
|
+
private rows;
|
|
64
|
+
private readonly evalCount;
|
|
65
|
+
private readonly rentCount;
|
|
66
|
+
/** Keep a read's rows (one pass over them). The read itself may be let go.
|
|
67
|
+
* True when the rows differ from the ones kept before, so a read that
|
|
68
|
+
* found nothing new needs no repaint. */
|
|
69
|
+
take(tiers: RoomTiers): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Match the kept rows to `rooms` and place each matched room on `layout`.
|
|
72
|
+
* The rows are a subsequence of the rooms, in their order, so the walk goes
|
|
73
|
+
* in lockstep; a row whose id the walk does not find before the rooms run
|
|
74
|
+
* out (a revision number can repeat, #1296) stops it there, and that row
|
|
75
|
+
* and the rest match through `byId`, the view's own id index for these
|
|
76
|
+
* rooms (`SimView.tower.getUnit`). A row no room has, or
|
|
77
|
+
* whose room now stands somewhere else (a kept read placed on rooms that
|
|
78
|
+
* moved since), is dropped and keeps its Edit look until the next read.
|
|
79
|
+
* One pass over the rooms at most.
|
|
80
|
+
*/
|
|
81
|
+
place(layout: MapLayout, rooms: ReadonlyArray<TierRoom>, byId: (id: number) => TierRoom | undefined, floorsOf: (kind: FacilityKind) => number): void;
|
|
82
|
+
/** How many placed rooms show `tier` in the Eval view. */
|
|
83
|
+
evalRooms(tier: EvalTier): number;
|
|
84
|
+
/** How many placed rooms show `tier` in the Pricing view. */
|
|
85
|
+
rentRooms(tier: RentTier): number;
|
|
86
|
+
/** How many rows the last read kept. */
|
|
87
|
+
get rowCount(): number;
|
|
88
|
+
/** How many rooms are placed on the map. */
|
|
89
|
+
get size(): number;
|
|
90
|
+
/** The style the placed room at `i` paints with in `view`, or null. */
|
|
91
|
+
styleAt(i: number, view: TierViewId): MapKindStyle | null;
|
|
92
|
+
/** The placed room's rectangle at `i`. */
|
|
93
|
+
rectAt(i: number): MapRect;
|
|
94
|
+
/** Forget the rows and the rooms (the window closed or another view is
|
|
95
|
+
* shown). */
|
|
96
|
+
clear(): void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Paint the placed rooms over the tower layer in `view`'s styles. A room too
|
|
100
|
+
* small for a pattern paints plain, and a room the view does not rate keeps
|
|
101
|
+
* its Edit look. Returns how many `fillRect` calls it took.
|
|
102
|
+
*/
|
|
103
|
+
export declare function paintTierMarks(ctx: MapPaintContext, marks: TierMarks, view: TierViewId, patterns: PatternSource): number;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { floorsFor } from './drawList.js';
|
|
2
|
+
import { snappedBlock } from './geometry.js';
|
|
3
|
+
import { MIN_PATTERN_SIDE } from './paint.js';
|
|
4
|
+
|
|
5
|
+
/** How the Eval view paints each evaluation, after the original's three
|
|
6
|
+
* swatches (Excellent cyan, Good olive yellow, Terrible red). An unrated room
|
|
7
|
+
* is not painted. */
|
|
8
|
+
const EVAL_VIEW_STYLE = {
|
|
9
|
+
unrated: null,
|
|
10
|
+
terrible: { fill: "#b01818", pattern: "grid" },
|
|
11
|
+
good: { fill: "#9a9a1c", pattern: "diagonal" },
|
|
12
|
+
excellent: { fill: "#1aa6b8", pattern: "solid" },
|
|
13
|
+
};
|
|
14
|
+
/** How the Pricing view paints each rent level, after the original's four
|
|
15
|
+
* swatches (High red, Average olive, Low green, Very Low cyan). A room with
|
|
16
|
+
* no rent level, or one taken off the market (No Rate), is not painted. */
|
|
17
|
+
const RENT_VIEW_STYLE = {
|
|
18
|
+
unpriced: null,
|
|
19
|
+
noRate: null,
|
|
20
|
+
veryLow: { fill: "#1aa6b8", pattern: "checker" },
|
|
21
|
+
low: { fill: "#2a8a3a", pattern: "diagonal" },
|
|
22
|
+
average: { fill: "#7a7a24", pattern: "solid" },
|
|
23
|
+
high: { fill: "#b01818", pattern: "grid" },
|
|
24
|
+
};
|
|
25
|
+
function entry(label, tier, styles) {
|
|
26
|
+
const style = styles[tier];
|
|
27
|
+
if (!style)
|
|
28
|
+
throw new Error(`the ${tier} tier has no style`);
|
|
29
|
+
return { label, tier, style };
|
|
30
|
+
}
|
|
31
|
+
/** The Eval legend, best first, as in the original. */
|
|
32
|
+
const EVAL_LEGEND = [
|
|
33
|
+
entry("Excellent", "excellent", EVAL_VIEW_STYLE),
|
|
34
|
+
entry("Good", "good", EVAL_VIEW_STYLE),
|
|
35
|
+
entry("Terrible", "terrible", EVAL_VIEW_STYLE),
|
|
36
|
+
];
|
|
37
|
+
/** The Pricing legend, highest first, as in the original. */
|
|
38
|
+
const PRICING_LEGEND = [
|
|
39
|
+
entry("High", "high", RENT_VIEW_STYLE),
|
|
40
|
+
entry("Average", "average", RENT_VIEW_STYLE),
|
|
41
|
+
entry("Low", "low", RENT_VIEW_STYLE),
|
|
42
|
+
entry("Very Low", "veryLow", RENT_VIEW_STYLE),
|
|
43
|
+
];
|
|
44
|
+
/**
|
|
45
|
+
* The rows of the last read, and where each matched room sits on the map.
|
|
46
|
+
* The rows are the engine's; the rectangles are found again whenever the
|
|
47
|
+
* rooms or the layout change, so a room removed since the read drops out
|
|
48
|
+
* and a moved layout moves the marks.
|
|
49
|
+
*/
|
|
50
|
+
class TierMarks {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.ids = [];
|
|
53
|
+
this.floors = [];
|
|
54
|
+
this.xs = [];
|
|
55
|
+
this.evals = [];
|
|
56
|
+
this.rents = [];
|
|
57
|
+
/** Matched rows: their rectangles and their row numbers, in room order. */
|
|
58
|
+
this.rects = [];
|
|
59
|
+
this.rows = [];
|
|
60
|
+
this.evalCount = new Map();
|
|
61
|
+
this.rentCount = new Map();
|
|
62
|
+
}
|
|
63
|
+
/** Keep a read's rows (one pass over them). The read itself may be let go.
|
|
64
|
+
* True when the rows differ from the ones kept before, so a read that
|
|
65
|
+
* found nothing new needs no repaint. */
|
|
66
|
+
take(tiers) {
|
|
67
|
+
const n = tiers.size;
|
|
68
|
+
let changed = n !== this.ids.length;
|
|
69
|
+
if (changed) {
|
|
70
|
+
this.ids = new Array(n);
|
|
71
|
+
this.floors = new Array(n);
|
|
72
|
+
this.xs = new Array(n);
|
|
73
|
+
this.evals = new Array(n);
|
|
74
|
+
this.rents = new Array(n);
|
|
75
|
+
}
|
|
76
|
+
for (let i = 0; i < n; i++) {
|
|
77
|
+
const id = tiers.id(i);
|
|
78
|
+
const floor = tiers.floor(i);
|
|
79
|
+
const x = tiers.x(i);
|
|
80
|
+
const evalTier = tiers.evalTier(i);
|
|
81
|
+
const rentTier = tiers.rentTier(i);
|
|
82
|
+
if (!changed && this.ids[i] === id && this.floors[i] === floor && this.xs[i] === x && this.evals[i] === evalTier && this.rents[i] === rentTier)
|
|
83
|
+
continue;
|
|
84
|
+
changed = true;
|
|
85
|
+
this.ids[i] = id;
|
|
86
|
+
this.floors[i] = floor;
|
|
87
|
+
this.xs[i] = x;
|
|
88
|
+
this.evals[i] = evalTier;
|
|
89
|
+
this.rents[i] = rentTier;
|
|
90
|
+
}
|
|
91
|
+
return changed;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Match the kept rows to `rooms` and place each matched room on `layout`.
|
|
95
|
+
* The rows are a subsequence of the rooms, in their order, so the walk goes
|
|
96
|
+
* in lockstep; a row whose id the walk does not find before the rooms run
|
|
97
|
+
* out (a revision number can repeat, #1296) stops it there, and that row
|
|
98
|
+
* and the rest match through `byId`, the view's own id index for these
|
|
99
|
+
* rooms (`SimView.tower.getUnit`). A row no room has, or
|
|
100
|
+
* whose room now stands somewhere else (a kept read placed on rooms that
|
|
101
|
+
* moved since), is dropped and keeps its Edit look until the next read.
|
|
102
|
+
* One pass over the rooms at most.
|
|
103
|
+
*/
|
|
104
|
+
place(layout, rooms, byId, floorsOf) {
|
|
105
|
+
const heights = new Map();
|
|
106
|
+
const source = { floorsOf };
|
|
107
|
+
this.rects = [];
|
|
108
|
+
this.rows = [];
|
|
109
|
+
this.evalCount.clear();
|
|
110
|
+
this.rentCount.clear();
|
|
111
|
+
let next = 0;
|
|
112
|
+
let inStep = true;
|
|
113
|
+
for (let row = 0; row < this.ids.length; row++) {
|
|
114
|
+
const id = this.ids[row];
|
|
115
|
+
let room;
|
|
116
|
+
if (inStep) {
|
|
117
|
+
while (next < rooms.length && rooms[next].id !== id)
|
|
118
|
+
next++;
|
|
119
|
+
if (next < rooms.length)
|
|
120
|
+
room = rooms[next++];
|
|
121
|
+
else
|
|
122
|
+
inStep = false;
|
|
123
|
+
}
|
|
124
|
+
if (!inStep)
|
|
125
|
+
room = byId(id);
|
|
126
|
+
if (!room || room.floor !== this.floors[row] || room.x !== this.xs[row])
|
|
127
|
+
continue;
|
|
128
|
+
const rect = snappedBlock(layout, room.x, room.width, room.floor, floorsFor(source, room.kind, heights));
|
|
129
|
+
if (!rect)
|
|
130
|
+
continue;
|
|
131
|
+
this.rects.push(rect);
|
|
132
|
+
this.rows.push(row);
|
|
133
|
+
this.evalCount.set(this.evals[row], (this.evalCount.get(this.evals[row]) ?? 0) + 1);
|
|
134
|
+
this.rentCount.set(this.rents[row], (this.rentCount.get(this.rents[row]) ?? 0) + 1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** How many placed rooms show `tier` in the Eval view. */
|
|
138
|
+
evalRooms(tier) {
|
|
139
|
+
return this.evalCount.get(tier) ?? 0;
|
|
140
|
+
}
|
|
141
|
+
/** How many placed rooms show `tier` in the Pricing view. */
|
|
142
|
+
rentRooms(tier) {
|
|
143
|
+
return this.rentCount.get(tier) ?? 0;
|
|
144
|
+
}
|
|
145
|
+
/** How many rows the last read kept. */
|
|
146
|
+
get rowCount() {
|
|
147
|
+
return this.ids.length;
|
|
148
|
+
}
|
|
149
|
+
/** How many rooms are placed on the map. */
|
|
150
|
+
get size() {
|
|
151
|
+
return this.rects.length;
|
|
152
|
+
}
|
|
153
|
+
/** The style the placed room at `i` paints with in `view`, or null. */
|
|
154
|
+
styleAt(i, view) {
|
|
155
|
+
const row = this.rows[i];
|
|
156
|
+
return view === "eval" ? EVAL_VIEW_STYLE[this.evals[row]] : RENT_VIEW_STYLE[this.rents[row]];
|
|
157
|
+
}
|
|
158
|
+
/** The placed room's rectangle at `i`. */
|
|
159
|
+
rectAt(i) {
|
|
160
|
+
return this.rects[i];
|
|
161
|
+
}
|
|
162
|
+
/** Forget the rows and the rooms (the window closed or another view is
|
|
163
|
+
* shown). */
|
|
164
|
+
clear() {
|
|
165
|
+
this.ids = [];
|
|
166
|
+
this.floors = [];
|
|
167
|
+
this.xs = [];
|
|
168
|
+
this.evals = [];
|
|
169
|
+
this.rents = [];
|
|
170
|
+
this.rects = [];
|
|
171
|
+
this.rows = [];
|
|
172
|
+
this.evalCount.clear();
|
|
173
|
+
this.rentCount.clear();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Paint the placed rooms over the tower layer in `view`'s styles. A room too
|
|
178
|
+
* small for a pattern paints plain, and a room the view does not rate keeps
|
|
179
|
+
* its Edit look. Returns how many `fillRect` calls it took.
|
|
180
|
+
*/
|
|
181
|
+
function paintTierMarks(ctx, marks, view, patterns) {
|
|
182
|
+
let fills = 0;
|
|
183
|
+
let last = null;
|
|
184
|
+
// Each style's two fills, asked of the pattern source once per repaint.
|
|
185
|
+
const resolved = new Map();
|
|
186
|
+
for (let i = 0; i < marks.size; i++) {
|
|
187
|
+
const style = marks.styleAt(i, view);
|
|
188
|
+
if (!style)
|
|
189
|
+
continue;
|
|
190
|
+
let pair = resolved.get(style);
|
|
191
|
+
if (!pair) {
|
|
192
|
+
pair = [patterns.get(style.fill, style.pattern), patterns.get(style.fill, "solid")];
|
|
193
|
+
resolved.set(style, pair);
|
|
194
|
+
}
|
|
195
|
+
const rect = marks.rectAt(i);
|
|
196
|
+
const small = rect.w < MIN_PATTERN_SIDE || rect.h < MIN_PATTERN_SIDE;
|
|
197
|
+
const fill = small ? pair[1] : pair[0];
|
|
198
|
+
if (fill !== last) {
|
|
199
|
+
ctx.fillStyle = fill;
|
|
200
|
+
last = fill;
|
|
201
|
+
}
|
|
202
|
+
ctx.fillRect(rect.x, rect.y, rect.w, rect.h);
|
|
203
|
+
fills++;
|
|
204
|
+
}
|
|
205
|
+
return fills;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { EVAL_LEGEND, EVAL_VIEW_STYLE, PRICING_LEGEND, RENT_VIEW_STYLE, TierMarks, paintTierMarks };
|
|
209
|
+
//# sourceMappingURL=tierView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tierView.js","sources":["../../../src/render/overviewMap/tierView.ts"],"sourcesContent":["/**\n * The overview MAP window's Eval and Pricing views (#343 S8, #1618, #1619):\n * each room the engine rates paints over the Edit map in its tier's color, as\n * the original's tinted tabs do. The engine decides every tier (`roomTiers`,\n * read through `RoomTierReader`), so nothing here compares a score or a\n * price: it matches the engine's rows to the view's rooms, places them on the\n * map and paints them.\n *\n * One read carries both views, so a switch between Eval and Pricing reads\n * nothing. `TierMarks.take` copies a read's rows (one pass over the rows) and\n * `TierMarks.place` matches them to the rooms and finds their rectangles (one\n * pass over the rooms); both run only on the triggers the window's views\n * controller names, never on a steady frame.\n *\n * Both game modes use the same look (owner, 2026-11-04). Color is not the only\n * cue: the tiers of one view differ in pattern too, a room big enough to carry\n * a pattern gets it, and the legend counts the rooms in words. A room the\n * engine lists with no evaluation (Eval) or with no rent level or No Rate\n * (Pricing) keeps its Edit look.\n */\nimport type { FacilityKind } from \"../../shared/types\";\nimport type { EvalTier, RentTier, RoomTiers } from \"../../simport/roomTiers\";\nimport type { UnitView } from \"../../simport/view\";\nimport { floorsFor } from \"./drawList\";\nimport { snappedBlock, type MapLayout, type MapRect } from \"./geometry\";\nimport { MIN_PATTERN_SIDE, type MapPaintContext, type PatternSource } from \"./paint\";\nimport type { MapKindStyle } from \"./style\";\n\n/** The views this file paints. */\nexport type TierViewId = \"eval\" | \"pricing\";\n\n/** How the Eval view paints each evaluation, after the original's three\n * swatches (Excellent cyan, Good olive yellow, Terrible red). An unrated room\n * is not painted. */\nexport const EVAL_VIEW_STYLE: Readonly<Record<EvalTier, MapKindStyle | null>> = {\n unrated: null,\n terrible: { fill: \"#b01818\", pattern: \"grid\" },\n good: { fill: \"#9a9a1c\", pattern: \"diagonal\" },\n excellent: { fill: \"#1aa6b8\", pattern: \"solid\" },\n};\n\n/** How the Pricing view paints each rent level, after the original's four\n * swatches (High red, Average olive, Low green, Very Low cyan). A room with\n * no rent level, or one taken off the market (No Rate), is not painted. */\nexport const RENT_VIEW_STYLE: Readonly<Record<RentTier, MapKindStyle | null>> = {\n unpriced: null,\n noRate: null,\n veryLow: { fill: \"#1aa6b8\", pattern: \"checker\" },\n low: { fill: \"#2a8a3a\", pattern: \"diagonal\" },\n average: { fill: \"#7a7a24\", pattern: \"solid\" },\n high: { fill: \"#b01818\", pattern: \"grid\" },\n};\n\n/** One legend entry: its label and the tier it counts. */\nexport interface TierLegendEntry<T extends string> {\n readonly label: string;\n readonly tier: T;\n readonly style: MapKindStyle;\n}\n\nfunction entry<T extends string>(label: string, tier: T, styles: Readonly<Record<T, MapKindStyle | null>>): TierLegendEntry<T> {\n const style = styles[tier];\n if (!style) throw new Error(`the ${tier} tier has no style`);\n return { label, tier, style };\n}\n\n/** The Eval legend, best first, as in the original. */\nexport const EVAL_LEGEND: ReadonlyArray<TierLegendEntry<EvalTier>> = [\n entry(\"Excellent\", \"excellent\", EVAL_VIEW_STYLE),\n entry(\"Good\", \"good\", EVAL_VIEW_STYLE),\n entry(\"Terrible\", \"terrible\", EVAL_VIEW_STYLE),\n];\n\n/** The Pricing legend, highest first, as in the original. */\nexport const PRICING_LEGEND: ReadonlyArray<TierLegendEntry<RentTier>> = [\n entry(\"High\", \"high\", RENT_VIEW_STYLE),\n entry(\"Average\", \"average\", RENT_VIEW_STYLE),\n entry(\"Low\", \"low\", RENT_VIEW_STYLE),\n entry(\"Very Low\", \"veryLow\", RENT_VIEW_STYLE),\n];\n\n/** The room fields the tier views read. */\nexport type TierRoom = Pick<UnitView, \"id\" | \"kind\" | \"floor\" | \"x\" | \"width\">;\n\n/**\n * The rows of the last read, and where each matched room sits on the map.\n * The rows are the engine's; the rectangles are found again whenever the\n * rooms or the layout change, so a room removed since the read drops out\n * and a moved layout moves the marks.\n */\nexport class TierMarks {\n private ids: number[] = [];\n private floors: number[] = [];\n private xs: number[] = [];\n private evals: EvalTier[] = [];\n private rents: RentTier[] = [];\n /** Matched rows: their rectangles and their row numbers, in room order. */\n private rects: MapRect[] = [];\n private rows: number[] = [];\n private readonly evalCount = new Map<EvalTier, number>();\n private readonly rentCount = new Map<RentTier, number>();\n\n /** Keep a read's rows (one pass over them). The read itself may be let go.\n * True when the rows differ from the ones kept before, so a read that\n * found nothing new needs no repaint. */\n take(tiers: RoomTiers): boolean {\n const n = tiers.size;\n let changed = n !== this.ids.length;\n if (changed) {\n this.ids = new Array<number>(n);\n this.floors = new Array<number>(n);\n this.xs = new Array<number>(n);\n this.evals = new Array<EvalTier>(n);\n this.rents = new Array<RentTier>(n);\n }\n for (let i = 0; i < n; i++) {\n const id = tiers.id(i);\n const floor = tiers.floor(i);\n const x = tiers.x(i);\n const evalTier = tiers.evalTier(i);\n const rentTier = tiers.rentTier(i);\n if (!changed && this.ids[i] === id && this.floors[i] === floor && this.xs[i] === x && this.evals[i] === evalTier && this.rents[i] === rentTier) continue;\n changed = true;\n this.ids[i] = id;\n this.floors[i] = floor;\n this.xs[i] = x;\n this.evals[i] = evalTier;\n this.rents[i] = rentTier;\n }\n return changed;\n }\n\n /**\n * Match the kept rows to `rooms` and place each matched room on `layout`.\n * The rows are a subsequence of the rooms, in their order, so the walk goes\n * in lockstep; a row whose id the walk does not find before the rooms run\n * out (a revision number can repeat, #1296) stops it there, and that row\n * and the rest match through `byId`, the view's own id index for these\n * rooms (`SimView.tower.getUnit`). A row no room has, or\n * whose room now stands somewhere else (a kept read placed on rooms that\n * moved since), is dropped and keeps its Edit look until the next read.\n * One pass over the rooms at most.\n */\n place(\n layout: MapLayout,\n rooms: ReadonlyArray<TierRoom>,\n byId: (id: number) => TierRoom | undefined,\n floorsOf: (kind: FacilityKind) => number,\n ): void {\n const heights = new Map<FacilityKind, number>();\n const source = { floorsOf };\n this.rects = [];\n this.rows = [];\n this.evalCount.clear();\n this.rentCount.clear();\n let next = 0;\n let inStep = true;\n for (let row = 0; row < this.ids.length; row++) {\n const id = this.ids[row];\n let room: TierRoom | undefined;\n if (inStep) {\n while (next < rooms.length && rooms[next].id !== id) next++;\n if (next < rooms.length) room = rooms[next++];\n else inStep = false;\n }\n if (!inStep) room = byId(id);\n if (!room || room.floor !== this.floors[row] || room.x !== this.xs[row]) continue;\n const rect = snappedBlock(layout, room.x, room.width, room.floor, floorsFor(source, room.kind, heights));\n if (!rect) continue;\n this.rects.push(rect);\n this.rows.push(row);\n this.evalCount.set(this.evals[row], (this.evalCount.get(this.evals[row]) ?? 0) + 1);\n this.rentCount.set(this.rents[row], (this.rentCount.get(this.rents[row]) ?? 0) + 1);\n }\n }\n\n /** How many placed rooms show `tier` in the Eval view. */\n evalRooms(tier: EvalTier): number {\n return this.evalCount.get(tier) ?? 0;\n }\n\n /** How many placed rooms show `tier` in the Pricing view. */\n rentRooms(tier: RentTier): number {\n return this.rentCount.get(tier) ?? 0;\n }\n\n /** How many rows the last read kept. */\n get rowCount(): number {\n return this.ids.length;\n }\n\n /** How many rooms are placed on the map. */\n get size(): number {\n return this.rects.length;\n }\n\n /** The style the placed room at `i` paints with in `view`, or null. */\n styleAt(i: number, view: TierViewId): MapKindStyle | null {\n const row = this.rows[i];\n return view === \"eval\" ? EVAL_VIEW_STYLE[this.evals[row]] : RENT_VIEW_STYLE[this.rents[row]];\n }\n\n /** The placed room's rectangle at `i`. */\n rectAt(i: number): MapRect {\n return this.rects[i];\n }\n\n /** Forget the rows and the rooms (the window closed or another view is\n * shown). */\n clear(): void {\n this.ids = [];\n this.floors = [];\n this.xs = [];\n this.evals = [];\n this.rents = [];\n this.rects = [];\n this.rows = [];\n this.evalCount.clear();\n this.rentCount.clear();\n }\n}\n\n/**\n * Paint the placed rooms over the tower layer in `view`'s styles. A room too\n * small for a pattern paints plain, and a room the view does not rate keeps\n * its Edit look. Returns how many `fillRect` calls it took.\n */\nexport function paintTierMarks(ctx: MapPaintContext, marks: TierMarks, view: TierViewId, patterns: PatternSource): number {\n let fills = 0;\n let last: string | CanvasPattern | null = null;\n // Each style's two fills, asked of the pattern source once per repaint.\n const resolved = new Map<MapKindStyle, readonly [string | CanvasPattern, string | CanvasPattern]>();\n for (let i = 0; i < marks.size; i++) {\n const style = marks.styleAt(i, view);\n if (!style) continue;\n let pair = resolved.get(style);\n if (!pair) {\n pair = [patterns.get(style.fill, style.pattern), patterns.get(style.fill, \"solid\")];\n resolved.set(style, pair);\n }\n const rect = marks.rectAt(i);\n const small = rect.w < MIN_PATTERN_SIDE || rect.h < MIN_PATTERN_SIDE;\n const fill = small ? pair[1] : pair[0];\n if (fill !== last) {\n ctx.fillStyle = fill;\n last = fill;\n }\n ctx.fillRect(rect.x, rect.y, rect.w, rect.h);\n fills++;\n }\n return fills;\n}\n"],"names":[],"mappings":";;;;AA+BA;;AAEsB;AACf,MAAM,eAAe,GAAoD;AAC9E,IAAA,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE;IAC9C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE;IAC9C,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;;AAGlD;;AAE4E;AACrE,MAAM,eAAe,GAAoD;AAC9E,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IAChD,GAA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A,IAAA,OAAO,KAAK;AACd;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The overview MAP window's backdrop and its view mark (#343): the sky and
|
|
3
|
+
* ground behind the tower, and the outline of what the main view shows, or
|
|
4
|
+
* the edge band and chevron when the view sits past the map's edge. Like
|
|
5
|
+
* `paint.ts`, it reads no simulation and takes a slice of a 2D context, so
|
|
6
|
+
* the tests drive it with a recording stub.
|
|
7
|
+
*
|
|
8
|
+
* Units are map (device) pixels; `px` is how many of them make one CSS pixel
|
|
9
|
+
* (the device pixel ratio), so lines keep their CSS width on any screen.
|
|
10
|
+
*/
|
|
11
|
+
import { type ViewPlacement } from "./extent";
|
|
12
|
+
import { type MapLayout, type MapRect } from "./geometry";
|
|
13
|
+
/** The sky and the ground behind the tower: a dark sky and earth, so the room
|
|
14
|
+
* colors read against them (the retail sky follows the time of day; v1 keeps
|
|
15
|
+
* one fixed color). */
|
|
16
|
+
export declare const MAP_BACKDROP: {
|
|
17
|
+
readonly sky: "#1d2838";
|
|
18
|
+
readonly ground: "#2e2418";
|
|
19
|
+
};
|
|
20
|
+
/** The floor line the street sits on: floor 1 (the ground floor) stands on it,
|
|
21
|
+
* and the basements are under it. */
|
|
22
|
+
export declare const GROUND_LINE = 0;
|
|
23
|
+
/** The ground's top edge as a share of the map's height, 0 at the top and 1
|
|
24
|
+
* at the bottom, held to the map. The window turns it into the backdrop's
|
|
25
|
+
* color stop. */
|
|
26
|
+
export declare function groundShare(layout: MapLayout): number;
|
|
27
|
+
/** The view mark's ink: a solid white outline over a dark halo, so it reads
|
|
28
|
+
* over the room colors and over the dark sky. */
|
|
29
|
+
export declare const VIEW_MARK: {
|
|
30
|
+
readonly ink: "#ffffff";
|
|
31
|
+
readonly halo: "rgba(0, 0, 0, 0.65)";
|
|
32
|
+
};
|
|
33
|
+
/** The outline's width and the edge band's thickness, in CSS pixels. */
|
|
34
|
+
export declare const VIEW_MARK_CSS: {
|
|
35
|
+
readonly line: 1;
|
|
36
|
+
readonly haloLine: 3;
|
|
37
|
+
readonly band: 3;
|
|
38
|
+
readonly bandMinWidth: 12;
|
|
39
|
+
readonly chevron: 5;
|
|
40
|
+
readonly minSide: 4;
|
|
41
|
+
};
|
|
42
|
+
/** The slice of a 2D context the view mark uses. */
|
|
43
|
+
export interface ViewMarkContext {
|
|
44
|
+
fillStyle: string | CanvasGradient | CanvasPattern;
|
|
45
|
+
strokeStyle: string | CanvasGradient | CanvasPattern;
|
|
46
|
+
lineWidth: number;
|
|
47
|
+
clearRect(x: number, y: number, w: number, h: number): void;
|
|
48
|
+
fillRect(x: number, y: number, w: number, h: number): void;
|
|
49
|
+
strokeRect(x: number, y: number, w: number, h: number): void;
|
|
50
|
+
beginPath(): void;
|
|
51
|
+
moveTo(x: number, y: number): void;
|
|
52
|
+
lineTo(x: number, y: number): void;
|
|
53
|
+
closePath(): void;
|
|
54
|
+
fill(): void;
|
|
55
|
+
}
|
|
56
|
+
/** The edge band drawn for a view past the map's edge, in the same whole
|
|
57
|
+
* device pixels the painter uses, so the window grabs exactly what it drew.
|
|
58
|
+
* Null when the view is on the map. */
|
|
59
|
+
export declare function viewMarkBand(layout: MapLayout, placement: ViewPlacement, px: number): MapRect | null;
|
|
60
|
+
/** The rectangle grown about its center to at least `side` each way and kept
|
|
61
|
+
* on the map, so a zoomed-in view still shows as a visible mark. */
|
|
62
|
+
export declare function visibleRect(layout: MapLayout, rect: MapRect, side: number): MapRect;
|
|
63
|
+
/**
|
|
64
|
+
* Clear the overlay and draw the view mark for `placement`: the outline of the
|
|
65
|
+
* visible area when it is on the map, or the edge band with a chevron
|
|
66
|
+
* pointing past the edge when the whole view lies beyond it. Returns what was
|
|
67
|
+
* drawn, which the tests read.
|
|
68
|
+
*/
|
|
69
|
+
export declare function paintViewMark(ctx: ViewMarkContext, layout: MapLayout, placement: ViewPlacement, px: number): "outline" | "band" | "none";
|