# @adatechnology/game-urban 中文文档

规范地址：https://npmcn.com/package/%40adatechnology/game-urban/

版本：0\.3\.9
npm 元数据更新时间：2026-11-07T17:26:44.904Z
中文译文更新时间：2026-11-06T23:54:29.028Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40adatechnology/game-urban
原文对照：https://npmcn.com/package/%40adatechnology/game-urban/?lang=original
项目主页：https://github.com/Andersonfrfilho/adatechnology-game-kit#readme
源码仓库：https://github.com/Andersonfrfilho/adatechnology-game-kit

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：4.6 MB，8 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：4 个
- 首次发布：2026-10-24T19:11:10.171Z
- 最新版本发布：2026-11-07T17:26:44.581Z
- 近 30 天下载量：2148（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：21（近 12 个月 21 个）

## 中文简介

城市图案为数据,无三.j:有轻预算的五道街杆,道路,人行道和街道网格,填满的城市建筑块和一条街道道具(栅栏,帐篷,树木,容器,瞭望塔,沙袋,标签,电线),

## 安装

```sh
npm install @adatechnology/game-urban
```

也可以使用：`pnpm add @adatechnology/game-urban`、`yarn add @adatechnology/game-urban`、`bun add @adatechnology/game-urban`

## README

# @adatechnology/游戏城市

城市图案为数据,无"三.j":有轻便预算的五道街杆,有破折中线的公路,人行道,街道网格,填满了城市建筑的街区,以及一条街道道具. 球队"谷地"(Galeria do Vale Cinzento)的棋子的一字形出港(图)`poleLED`, (中文(简体) ), `poleConcrete`, (中文(简体) ), `poleIron`, (中文(简体) ), `poleWood`, (中文(简体) ), `floodTower`, (中文(简体) ), `road`, (中文(简体) ), `walk`, (中文(简体) ), `streetGrid`, (中文(简体) ), `fillBlock`, (中文(简体) ), `fence`, (中文(简体) ), `tent`, (中文(简体) ), `pine`, (中文(简体) ), `tree`, (中文(简体) ), `container`, (中文(简体) ), `watchtower`, (中文(简体) ), `sandbags`, (中文(简体) ), `stripLabel`, (中文(简体) ), `wires`) (中文(简体) ).

一切都是一个 **编** 的 silhouette 词汇表 `@adatechnology/game-floorplan` (有圆形边缘,圆柱,棱柱,线条,标志,组),外加街道需要的少数(锥形,花冠,平面,标签,灯光). 抽屉之类的 `@adatechnology/game-urban-three` 将零件变成网状 套接字没有游戏和地点:被命名为"谷","僵尸检查站"等的邻里属于使用该套接字的游戏.

```ts
import { createUrban } from '@adatechnology/game-urban'

const urban = createUrban({ lights: { budget: 16 } })
const b = urban.builder({ seed: 7 })               // the page's generator, mulberry32(7)

urban.streets.grid(b, { block: 36, count: 2, width: 10 })
urban.block.fill(b, { cx: 0, cz: 0, size: 26, minHeight: 12, maxHeight: 36, lit: 0.05, shop: 0.5 })
urban.poles.get('led_double').build(b, { x: 18, z: 5, on: true })
urban.props.watchtower(b, 40, 0, true)

const scene = b.scene()                            // { parts, items, windows: { lit, dark } }
```

## 波兰人

| 编号 | 形状 | 这是什么 |
| --- | --- | --- |
| `led_double` | `double_arm` | 9米桅杆,两臂有白色LED头(风景) |
| `concrete_arm` | `single_arm` | 8米混凝土桅杆、一臂、钠灯、可选变压器鼓(`dir` - 1 镜像手臂) |
| `cast_iron` | `lantern` | 4米铁柱、灯笼和尖顶 |
| `wood_crossarm` | `crossarm` | 7米有横臂和吊灯的木杆 |
| `flood_tower` | `flood_tower` | 12米四脚高的塔 有三盏防洪灯 |

一根杆子 `on` 有一发光的镜头,而 **小规模预算** 相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相 预算是Galleria的柜台: 16 默认, `take()` 实值 `left-- > 0`这样 `left` 当灯光比预算要多时,灯光一直降到零以下,没有灯光的灯光则保留了镜头. `flicker: true` 标记失败灯的光;抽屉的动画.

每个柱子的数量都是数据. 游戏会逐一地补上一分,再加一分杆或取出一分杆来取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆去取出一分杆取出一分杆取出一分杆取出一分杆取出一分杆取出一分杆取出一分杆取出一分杆取出一分杆取出一分分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出一分出分出一分出一分出一分出

```ts
createUrban({
  patch: { poles: { led_double: { spec: { light: { distance: 30 } } } } },
  packs: { poles: [{ id: 'banner', shape: 'banner', spec: { height: 5 } }] },
  shapes: { banner: (b, spec, o) => b.box(o.x, 0, o.z, 0.2, spec.height, 0.2, 0xffffff) },
  remove: { poles: ['wood_crossarm'] },
  facades: [0x777777, 0x998877],        // colours of the city buildings
  streets: { road: { color: 0x303030, dash: { every: 4 } } },
})
```

## 街道、街区和道具

-   `streets.road(b, x, z, w, l, 'x' | 'z')`:平面为2厘米并有破折号(1.8×0.16米)的平面,起步后从2米起每5米为例. `walk`, (中文(简体) ), `ground` 财务报告和审定财务报表 `grid({ block, count, width })` 2n+1路相通,2n×2n区块各有一条人行道板.
-   `block.fill(b, { cx, cz, size, minHeight, maxHeight, k, gap, lit, shop })`(单位:千美元) `k x k` 一块小于其地块的建筑, 高到 `lerp(min, max, random^1.6)` (比高楼还低),由 `createCityBuilding` 与共享生成器的游戏底盘计划。 返回游戏的记账大楼 . `block.building` 一个地方.
-   `props`数字 : `fence`, (中文(简体) ), `tent`, (中文(简体) ), `pine`, (中文(简体) ), `tree`, (中文(简体) ), `container`, (中文(简体) ), `watchtower` (有探照灯,其光束环绕地上), `sandbags` (事件), `label` (22x4.4米板上有两条线)和 `wires`。 。 。 .

### 塔楼

`createUrban({ towers: true })` (默认关闭;然后输出与以前相同,字节为字节)绘制块或至少是道的构件 `minHeight` (60米) 高得像一个 **塔楼** 而不是一个盒子:一个高高地盘的讲台、四面各一排一排窗户的杆子、没有窗户的更深的带子、植物上层倒放、抛子和桅杆。 抽取哪种,按重量选择 `presets`,其数字是类型中的 `game-floorplan-commercial` (单位:千美元)`office`: 4 m surcys,每20个植物地层,玻璃幕墙)和 `game-floorplan-residential` (单位:千美元)`residential`: 3.1 m surcys,每25个,每个海湾有一扇窗户的泥瓦;测试使其保持等同. 游戏关闭它们,改变被截断的高度,预设和重量,或画出塔本身:

```ts
createUrban({
  towers: {
    minHeight: 80,
    presets: [{ id: 'office', weight: 1, storeyHeight: 4, mechanicalEvery: 20, glass: true, color: 0x3c5a73 }],
    mast: 0.04,
    provider: (request, b) => myTower(request, b),   // request: x, z, width, depth, height, color, preset, lit
  },
})
```

高地出自建筑所取地: `block.fill`是因为 `minHeight` 财务报告和审定财务报表 `maxHeight`,或 `buildings` 会 议 日 程 和 议 程 `downtown` 模式(以 `patch`) (中文(简体) ). 那个包 `TOWER_PATTERNS` (不在样本表中)添加 `financial_district`20米地块和70至180米高地的街道: `createUrban({ packs: { neighbourhoods: TOWER_PATTERNS }, towers: true })`。 。 。 .

## 邻居模式

`urban.neighbourhoods` galleria样本表的十个图案: `downtown`, (中文(简体) ), `suburb`, (中文(简体) ), `working_class`, (中文(简体) ), `historic_street`, (中文(简体) ), `industrial_port`, (中文(简体) ), `railway_village`, (中文(简体) ), `mountain_resort`, (中文(简体) ), `stilt_village`, (中文(简体) ), `military` 财务报告和审定财务报表 `rural`模式是数据(`streetWidth`, (中文(简体) ), `walkWidth`, (中文(简体) ), `typologies`, (中文(简体) ), `pole`, (中文(简体) ), `lightColor`, (中文(简体) ), `spacing`, (中文(简体) ), `lit` =灯光和其余被烧光的部分, `marker`, (中文(简体) ), `text` 内 `pt-BR` 财务报告和审定财务报表 `en`,则 `params` 作曲家名单)加a `compose` 键入作曲家的注册簿,绘制街道。 游戏修改数字 `patch`,添加图案 `packs` 和一个作曲家 `composers`,或与 `remove`。 。 。 .

```ts
const plan = urban.neighbourhoods.get('suburb').compose(b, { x: 0, z: 0 }, {
  locale: 'en',
  providers: {
    house: (typology, request, b) => myHouse(typology, request, b),   // default: the far-away silhouettes of game-floorplan
    vehicle: createVehicleProvider({ ids: myFleetIds }),            // default: none (the page's box car is not shipped)
    plant: createPlantProvider({ pickSpecies: myPicker }),          // default: the cone pine and the ball tree of the props
  },
})
// plan: { id, origin, houses, buildings, poles, vehicles, plants }  (what was put where)
urban.neighbourhoods.composeSampleSheet(b)   // the ground and the ten cells, in the order the page builds them
```

### 其他包裹中的车辆和工厂

`createVehicleProvider({ ids, pick?, paint? })` 将游戏名称放在 `ids` 其中模式公园之一 `createPlantProvider({ pickSpecies, contexts?, seed?, pick? })` 植物种类 `pickSpecies(context, key)` 返回图案植物(来自 `sidewalk_tree` 上下文,从 `square`) (中文(简体) ). 舰队和物种可以选择(推荐路径;预设) `defaultUrbanProviders()` 联 合 国 `@adatechnology/game-kit-defaults` 请用它。 没有他们 供应商就保留旧的默认, `PARKED_VEHICLE_IDS` 联 合 国 `game-vehicles-fleet` 区域表格 `game-vegetation-species`;这些违约在下个大项被贬值并去除. 它们不绘图:它们添加一个 `placement` 编`b.place(kind, id, x, z, { ry, scale, color, seed })`上面写着要放什么 在哪里 选择取决于地点而不是 `b.random`,所以周围的场景保持了相同的画序. 抽屉`game-urban-three`)询问每种的解析器,当没有解析器时则将空出.

## 城市规划(分区)

A 类 **地区类型** (单位:千美元)`urban.cities.kinds`22)说城市的一补:它的地图 `color`,则 `zone` 基本计划包(`zt`, (中文(简体) ), `zc`, (中文(简体) ), `zr1`,......),邻里 `pattern` 穿着它(指 `urban.neighbourhoods`,或 `financial_district` 联 合 国 `TOWER_PATTERNS`页:1 `floors` `[min, max]`,按 `uses` (单位:千美元)`commercial`, (中文(简体) ), `residential`, (中文(简体) ), `industrial`, (中文(简体) ), `institutional`, (中文(简体) ), `agricultural`页:1 `block` 大小(0=无块)及其 `text` 内 `pt-BR` 财务报告和审定财务报表 `en`A级 **城市规划** (单位:千美元)`urban.cities.plans`) 在一幅米(中心为0,0,x以东,z以南)地图上作画: `districts` (单位:千美元)`{ id, kind, rect: [x0, z0, x1, z1], name?, floors?, uses? }`从外到内都列出,所以 **最后一个包含点数的区域获胜**· ; `lines` (大道、高速公路、铁路、河流) `landmarks`。计划是数据:除非您拨打 `fillBlock`,而现有的场景不会改变.

| 编号 | 缩放 | 大小(m) | 这是什么 |
| --- | --- | --- | --- |
| `metropolis` | 大都会 | 6000 x 6000 (韩语) | 市中心塔由商业、高楼和低楼街区、郊区和铁路工业环绕 |
| `regional_city` | 城市 | 4000×4000 (英语) | 商业中心,有几所高楼、住宅区和一个工业区 |
| `port_city` | 城市 | 4000×3000 (英语) | 码头和仓库,港口后面的老城和山上街区 |
| `rail_town` | 城镇 | 3000×3000 (英语) | 车站周围有一个小镇:铁道场,老中心,公司村 |
| `country_town` | 城镇 | 2400x24 (英语) | 主广场与教堂,地上店铺周围,房屋,合作社和小庄 |
| `mountain_village` | 村庄 | 1600 x 1200 (英语) | 教堂广场,山坡上一条小客栈和小客栈 |

```ts
const urban = createUrban({ towers: true })
const layout = urban.cities.layout('regional_city', { locale: 'en', maxFloors: 40 })
layout.districtAt(0, 0)                              // { id, kind, color, zone, pattern, floors, uses, block, name, rect }
const center = layout.districts.find((d) => d.kind === 'commercial_center')!
const blocks = layout.blocks(center.id, { street: 10 })   // { x, z, size, district, building: { floors, uses, zone, pattern } }[]
const b = urban.builder({ seed: 7 })
for (const block of blocks) urban.cities.fillBlock(b, block)   // block.fill with the block's floors and uses
urban.cities.stats(layout)                           // [{ kind, area, share, districts }] by kind
```

`blocks` 以区域为矩形 `block` 大小,更不要说街道,跳过中心属于另一区的牢房(一个被涂上). `block.building` 是建筑物生成器的配置 . `fillBlock` 电话 `block.fill` 与块的 `floors` 财务报告和审定财务报表 `uses` (和 `storeyPresets` 编号 : `storeyHeight` 当你通过它们时,每座建筑都按重量来选择它的用途,然后 `floors x storey height` 该用途的塔的预设( )`office` 4米长, `residential` 3.1 m; 更改预设的游戏更改它); 与 `towers` 高高的商用建筑成为办公塔和高高的住宅塔,顶部为: `towers.maxStoreys`地面层 `shop` 机会默认为商业份额。 它没有画的种类 没有商店或图案.

**默认下限为60**,在该区自身推翻后: `createUrban({ cities: { maxFloors: 40 } })` 或者说 `layout(plan, { maxFloors })` 夹住每个区域 `[0, maxFloors]`游戏会提高盖子和花样.

游戏增加了自己的城市( 或类型) `packs`,修改数字 `patch` 并带走一些与 `remove`键下 `districtKinds` 财务报告和审定财务报表 `cityPlans`。一个计划可以从另一个开始 `extends`:其区,线和地标名列前茅,一个区或线同代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代代 `size`, (中文(简体) ), `scale` 财务报告和审定财务报表 `text` 在省略时继承.

```ts
createUrban({
  cities: { maxFloors: 80 },
  packs: {
    districtKinds: [{ id: 'harbour_lofts', color: '#5aa0a8', zone: 'zr3_zm', pattern: 'downtown', floors: [3, 9], uses: { residential: 0.7, commercial: 0.3 }, block: 60,
      text: { 'pt-BR': { name: 'Lofts do cais', description: 'Armazéns reformados.' }, en: { name: 'Harbour lofts', description: 'Converted warehouses.' } } }],
    cityPlans: [{
      id: 'my_port',
      extends: 'port_city',
      districts: [{ id: 'lofts', kind: 'harbour_lofts', rect: [-400, -200, 0, 300] }],   // painted over what is there
      lines: [{ id: 'ferry', kind: 'street', width: 12, points: [[-400, 0], [0, 0]] }],
      landmarks: [{ kind: 'lighthouse', at: [-380, 120], name: 'Old light' }],
    }],
  },
  patch: { districtKinds: { downtown: { floors: [30, 80] } } },
  remove: { cityPlans: ['rail_town'] },
})
```

## 地形

`urban.terrain(options)` 地由地层所成,如"加勒里亚之谷":一个滚滚的地基(波),被遮住的地平地(山地,丘陵: `mask · (level + waves)`),城市平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地平地 它会回答的 `heightAt(px, py)`, (中文(简体) ), `forestAt`, (中文(简体) ), `colorAt`, (中文(简体) ), `nearRiver` 财务报告和审定财务报表 `toWorld`编号 :`fromWorld` (框架将计划映射为: `world = plan · scale + origin`)和手拿抽屉 `grid(segments)`:平方网格的32位坐标,高度和颜色,沿z行. `urban.drawTerrain(b, terrain)` 加网和水平面. `custom(px, py, h)` 在高处有最后一句话.

一个地方的号码是游戏的: Vale Cinzento (4条河流,4个湖泊,5个城市,Serra,Mata Funda)是 `game-slice/urban/valley-terrain.json` 在光谱文件夹中,它的副本是测试的固定.

## 同样的种子,同样的城市

页面保留一个生成器,用于它所提取的所有东西,并按调用顺序从中取出. 建造者也这样做:外观颜色,商店标志,点亮的窗户和高地来自 `b.random`,按照页面的顺序,所以一个画出相同种子和相同呼叫的场景有相同的部分. 黄金测试 `game-urban-three` 将34个部分,地形网(181×181顶,高度和颜色)和整个样本表(1029个对象,实例和窗口列表,光预算左,下个随机数字和地图标记)与页面的场景散列相比较,列出页面在被冲出和每个材料表面之前所保存的页面.

### Configurar pelo jogo (法语)

`createUrban({ towers })` 爱西塔 `minHeight`, (中文(简体) ), `maxStoreys` (padrão 60: um lade mais alto é desenhado com 60 andares do tipo),"(padrão 60: um lade mais alto é desenhado com 60 andares do tipo),","(lade mais alto e desenhado com 60"),"(padrão 60: um um mais alto e senhado com and ares do tipo"),"(padrão 60: 60: um mais alto e senhado com 60","ares do tipo",",","),",","(", `presets` (卡达,嗯,com) `weight`, (中文(简体) ), `storeyHeight`, (中文(简体) ), `mechanicalEvery`, (中文(简体) ), `glass`, (中文(简体) ), `minStoreys`, (中文(简体) ), `maxStoreys`, (中文(简体) ), `mast`, (中文(简体) ), `lit` 电子 `provider`。 。 。 . `towerPresetOf` monta um 预设了 ma tipologia 的 版式, para a cidade desenhar a mesma torre que o jogo configurou em `office_tower` 编号 : `residential_tower`。 。 。 .

```ts
const office = officeTowerLayout({ storeys: 50, height: 3.4 })
const kit = createUrban({
  packs: { neighbourhoods: TOWER_PATTERNS },
  towers: {
    maxStoreys: 70,
    presets: [
      towerPresetOf('office', 0.3, office, { mechanicalEvery: 18, minStoreys: 25, maxStoreys: 70 }),
      { ...DEFAULT_TOWER_PRESETS[1], weight: 0.7, maxStoreys: 40 },
    ],
  },
})
```

Por prédio, o groupo também aceita os andares e os usos (os mesmos nomes de) 互联网档案馆的存檔,存档日期2014-12-02 `building` 集团公司 `urban.cities`: `block.fill(b, { ..., floors: [8, 40], uses: { commercial: 0.6, residential: 0.4 } })`。 。 。 . `floors` 额,努梅罗,你 `[min, max]` e vira altura (aandares veezes o pé-direito do presset do uso; sem uso, `storeyHeight`(三); `uses` (原始内容存档于2013-10-12). sorteia o uso de cada prédio por peso, e `storeyPresets` (帕德朗语) `{ commercial: 'office', residential: 'residential' }`{\\fn黑体\\fs22\\bord1\\shad0\\3aHBE\\4aH00\\fscx67\\fscy66\\2cHFFFFFF\\3cH808080}我们是德森哈 科姆语 `towers` rigado, prédios altos comerciais viram) 维拉姆语 维拉姆语 `office` e 居住者 `residential` (单位:千美元) `TowerRequest` 轨迹 `use` 电子 `storeys`; os baixos seguem o prédio comum com a altura dos andares pedidos. 中国植物物种信息数据库. 萨姆 `floors` 电子 `uses` 泥地岛.

```ts
kit.block.fill(b, { cx: 0, cz: 0, size: 100, minHeight: 20, maxHeight: 60, ...block.building })  // block.building = { floors: [10, 40], uses: { commercial: 1 } }
```

## 常见问题

### @adatechnology/game-urban 是什么？

城市图案为数据,无三\.j:有轻预算的五道街杆,道路,人行道和街道网格,填满的城市建筑块和一条街道道具\(栅栏,帐篷,树木,容器,瞭望塔,沙袋,标签,电线\),

### 如何安装 @adatechnology/game-urban？

在项目目录运行 npm install @adatechnology/game-urban，或使用 pnpm add / yarn add / bun add。

### @adatechnology/game-urban 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @adatechnology/game-urban 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @adatechnology/game-urban 可以商用吗？

@adatechnology/game-urban 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @adatechnology/game-urban 的下载量有多少？

根据 npm 官方下载统计，@adatechnology/game-urban 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,148 次，日均约 72 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @adatechnology/game-urban 还在维护吗？

最新版本 0\.3\.9 发布于 2026/11/08（今天）；至今共发布 21 个版本，其中过去 12 个月发布了 21 个；首次发布于 2026/10/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

