@adatechnology/game-urban 0.4.0 → 0.5.1
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/README.md +10 -2
- package/dist/index.d.ts +3 -29
- package/dist/index.global.js +7 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/networks/index.d.ts +166 -7
- package/dist/networks/index.js +284 -96
- package/dist/networks/index.js.map +1 -1
- package/dist/{types-CYeqw_58.d.ts → types-mY6VwZgN.d.ts} +62 -2
- package/package.json +4 -4
|
@@ -339,6 +339,32 @@ type LightAllowance = {
|
|
|
339
339
|
/** @deprecated Renamed `LightAllowance`: `LightBudget` is the name of the render budget of `@adatechnology/game-render-three`. Removed in the next major. */
|
|
340
340
|
type LightBudget = LightAllowance;
|
|
341
341
|
|
|
342
|
+
/** How the lamps of a street are kept: `lit` is the share of lamps that work, `flicker` the share of all lamps that work badly (a part of `lit`). The rest are burnt out. */
|
|
343
|
+
type LampShares = {
|
|
344
|
+
readonly lit: number;
|
|
345
|
+
readonly flicker: number;
|
|
346
|
+
};
|
|
347
|
+
/** One lamp: `on` for `PoleOptions.on`, `flicker` for `PoleOptions.flicker`. */
|
|
348
|
+
type LampState = {
|
|
349
|
+
readonly on: boolean;
|
|
350
|
+
readonly flicker: boolean;
|
|
351
|
+
};
|
|
352
|
+
type LampStateParams = {
|
|
353
|
+
readonly seed: number;
|
|
354
|
+
readonly x: number;
|
|
355
|
+
readonly z: number;
|
|
356
|
+
readonly shares: LampShares;
|
|
357
|
+
};
|
|
358
|
+
/** The phase (radians, [0, 2π)) a failing lamp at `x, z` flickers on: its lens and its light share it. A drawer may round it: game-urban-three rounds it to 4 groups, so about a quarter of the failing lamps blink in step. */
|
|
359
|
+
declare const flickerPhaseOf: (x: number, z: number) => number;
|
|
360
|
+
/** Throws when the shares are not `0 <= flicker <= lit <= 1`. */
|
|
361
|
+
declare function assertLampShares(shares: LampShares): void;
|
|
362
|
+
/**
|
|
363
|
+
* Whether the lamp standing at `x, z` works, flickers or is burnt out, by a hash of the seed and the spot: the same street with the same seed keeps the same dead and failing lamps,
|
|
364
|
+
* and the choice does not draw from the builder's random, so the scene around it keeps its draw order.
|
|
365
|
+
*/
|
|
366
|
+
declare function lampStateOf({ seed, x, z, shares }: LampStateParams): LampState;
|
|
367
|
+
|
|
342
368
|
type BoxOptions = {
|
|
343
369
|
parent?: number;
|
|
344
370
|
ry?: number;
|
|
@@ -488,9 +514,43 @@ type PoleSlots = {
|
|
|
488
514
|
readonly embedment: number;
|
|
489
515
|
readonly bands: Readonly<Record<PoleSlotBand, readonly [number, number]>>;
|
|
490
516
|
};
|
|
491
|
-
/**
|
|
517
|
+
/**
|
|
518
|
+
* A distribution pole: the single arm pole plus the bands its networks are fixed at and the hardware that fixes them (`distributionHardwareOf`):
|
|
519
|
+
* the crossarm (`reach` its centre toward the road) with its pin insulators (`at` along it), the transformer's bushings (`spread` apart on its lid),
|
|
520
|
+
* the low-voltage cable's clamp and the telecom clamps `out` on the field side, and the guy wire (`reach` from the mast to its anchor).
|
|
521
|
+
*/
|
|
492
522
|
type DistributionSpec = SingleArmSpec & {
|
|
493
523
|
readonly slots: PoleSlots;
|
|
524
|
+
readonly crossarm: {
|
|
525
|
+
readonly reach: number;
|
|
526
|
+
readonly width: number;
|
|
527
|
+
readonly height: number;
|
|
528
|
+
readonly depth: number;
|
|
529
|
+
readonly color: number;
|
|
530
|
+
};
|
|
531
|
+
readonly insulators: {
|
|
532
|
+
readonly at: readonly number[];
|
|
533
|
+
readonly radius: number;
|
|
534
|
+
readonly color: number;
|
|
535
|
+
};
|
|
536
|
+
readonly bushings: {
|
|
537
|
+
readonly spread: number;
|
|
538
|
+
readonly radius: number;
|
|
539
|
+
readonly height: number;
|
|
540
|
+
readonly color: number;
|
|
541
|
+
};
|
|
542
|
+
readonly lowVoltage: {
|
|
543
|
+
readonly out: number;
|
|
544
|
+
readonly color: number;
|
|
545
|
+
};
|
|
546
|
+
readonly telecom: {
|
|
547
|
+
readonly out: number;
|
|
548
|
+
readonly color: number;
|
|
549
|
+
};
|
|
550
|
+
readonly guy: {
|
|
551
|
+
readonly reach: number;
|
|
552
|
+
readonly color: number;
|
|
553
|
+
};
|
|
494
554
|
};
|
|
495
555
|
/** A registry entry of a distribution pole: the `distribution` shape reads a `DistributionSpec`. */
|
|
496
556
|
type DistributionPoleDef = PoleDef & {
|
|
@@ -1024,4 +1084,4 @@ type FillBlockCityOptions = Omit<FillBlockOptions, 'shop'> & {
|
|
|
1024
1084
|
storeyHeight?: number;
|
|
1025
1085
|
};
|
|
1026
1086
|
|
|
1027
|
-
export { type ForestOptions as $, type CrossarmSpec as A, type BlockBuilding as B, type CityPlanInput as C, type DistrictKindDef as D, type CrownPart as E, type FillBlockOptions as F, DEFAULT_FACADES as G, type HouseProvider as H, DEFAULT_POLES as I, DEFAULT_STOREY_PRESETS as J, type KindStats as K, type LightAllowance as L, DEFAULT_TOWER_PRESETS as M, type NeighbourhoodPattern as N, type DistributionPoleDef as O, type Point as P, type DistributionSpec as Q, type Rect as R, type SilhouetteFactory as S, type TowerPreset as T, type UrbanBuilder as U, type VehicleRequest as V, type DistrictKindText as W, type DoubleArmSpec as X, type Flatten as Y, type Flickering as Z, type FloodTowerSpec as _, type CityPlanDef as a, type HouseRequest as a0, type ItemBox as a1, type LabelPart as a2, type Lake as a3, type LampLightSpec as a4, type
|
|
1087
|
+
export { type ForestOptions as $, type CrossarmSpec as A, type BlockBuilding as B, type CityPlanInput as C, type DistrictKindDef as D, type CrownPart as E, type FillBlockOptions as F, DEFAULT_FACADES as G, type HouseProvider as H, DEFAULT_POLES as I, DEFAULT_STOREY_PRESETS as J, type KindStats as K, type LightAllowance as L, DEFAULT_TOWER_PRESETS as M, type NeighbourhoodPattern as N, type DistributionPoleDef as O, type Point as P, type DistributionSpec as Q, type Rect as R, type SilhouetteFactory as S, type TowerPreset as T, type UrbanBuilder as U, type VehicleRequest as V, type DistrictKindText as W, type DoubleArmSpec as X, type Flatten as Y, type Flickering as Z, type FloodTowerSpec as _, type CityPlanDef as a, type HouseRequest as a0, type ItemBox as a1, type LabelPart as a2, type Lake as a3, type LampLightSpec as a4, type LampShares as a5, type LampSpec as a6, type LampState as a7, type LampStateParams as a8, type LanternSpec as a9, type TowerRequest as aA, type Trig as aB, type UrbanBuilderOptions as aC, type UrbanPart as aD, type UrbanScene as aE, type VaultPart as aF, type Wave as aG, type WorldFrame as aH, assertLampShares as aI, createTowerDrawer as aJ, createUrbanBuilder as aK, drawBuilding as aL, drawTower as aM, fillBlock as aN, flickerPhaseOf as aO, lampStateOf as aP, pickTowerPreset as aQ, towerPresetOf as aR, towerStoreys as aS, type LensSpec as aa, type LightBudget as ab, type LightPart as ac, type MastSpec as ad, POLE_SHAPES as ae, type PartStyle as af, type PatternText as ag, type PlacementPart as ah, type PlanDistrict as ai, type PlanLandmark as aj, type PlanLine as ak, type PlanPoint as al, type PlanRect as am, type PlanePart as an, type PoleSlotBand as ao, type PoleSlots as ap, type Providers as aq, type Ramp as ar, type ResolvedDistrict as as, type River as at, type RiverBed as au, type SingleArmSpec as av, TOWER_DEFAULTS as aw, type TerrainLayer as ax, type TerrainPart as ay, type TowerProvider as az, type LayoutOptions as b, type CityLayout as c, type Block as d, type FillBlockCityOptions as e, type ComposeOptions as f, type UrbanKitCore as g, type Composer as h, type UrbanPlan as i, type Locale as j, type TerrainOptions as k, type TerrainGrid as l, type PoleDef as m, type PoleOptions as n, type PoleShapeBuilder as o, type TowerOptions as p, type BuildingOptions as q, type PlantRequest as r, type PlantProvider as s, type VehicleProvider as t, type BarSpec as u, type BlockUse as v, type CityScale as w, type ColorRule as x, type ComposeContext as y, type ConePart as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-urban",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The urban pattern as data, with no three.js: the five street poles with a light budget, roads, sidewalks and street grids, filled blocks of city buildings and the props of a street (fences, tents, trees, containers, watch towers, sandbags, labels, wires), as parts on the silhouette vocabulary of game-floorplan. Every catalogue is a registry and every number an option.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@adatechnology/game-contracts": "^0.
|
|
46
|
-
"@adatechnology/game-floorplan": "^0.4.
|
|
45
|
+
"@adatechnology/game-contracts": "^0.37.0",
|
|
46
|
+
"@adatechnology/game-floorplan": "^0.4.1",
|
|
47
47
|
"@adatechnology/game-vegetation-species": "^0.2.0",
|
|
48
48
|
"@adatechnology/game-vehicles-fleet": "^7.0.0"
|
|
49
49
|
},
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"tsup": "^8.5.1",
|
|
53
53
|
"typescript": "^5.7.3",
|
|
54
54
|
"vitest": "^3.2.4",
|
|
55
|
-
"@adatechnology/game-floorplan-commercial": "^7.0.0",
|
|
56
55
|
"@adatechnology/game-floorplan-residential": "^7.0.0",
|
|
56
|
+
"@adatechnology/game-floorplan-commercial": "^7.0.0",
|
|
57
57
|
"@adatechnology/golden-tool": "^0.0.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|