@adatechnology/game-floorplan-interactables 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anderson Fernandes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/MIGRATION.md ADDED
@@ -0,0 +1,307 @@
1
+ # Migration notes
2
+
3
+ Port of `AdaptadorInterativos` v0.3.0, the IIFE of the team's pages (`area-casas.html`, `visor-casas-3d.html`, `zombiada-modo-livre.html`; the three copies are identical).
4
+ The port is literal: the same planning, the same order of draws, the same fitting of the doors. What changed is the **names** (Portuguese to English), where the
5
+ **tables** live (registries the game can override) and where the adapter **reads** the house (the plan of the kit, not the `PlantasSDK` result).
6
+
7
+ The tests run the team's original code in a `vm` (`tests/fixtures/team-golden/adaptador-interativos.js`, verbatim, sha256
8
+ `0cc377e6248bbbad3b49c82e7b8b864f3449442923a0c32a2d53f4129d72d7c4`) on the same houses and compare the answers, after renaming, with `toEqual`: the plan of 17
9
+ typologies over 3 seeds and the states, the serialization of the world, the result of `add` (hinges turned, objects moved), `blockedOf` on a grid of points, the chimney and the contents drawn from the goods catalog.
10
+
11
+ ## Functions
12
+
13
+ | Team | Here |
14
+ |---|---|
15
+ | `AdaptadorInterativos.criar(opcoes)` | `create(options)` (also `FloorplanInteractables.create`) |
16
+ | `.planejar(res, opcoes)` | `plan(house, planOptions)` |
17
+ | `.criarMundo(res, opcoes)` | `createWorld(house, worldOptions)` |
18
+ | `.adicionar(mundo, plano, opcoes)` | `add(world, planned, addOptions)` |
19
+ | `.bloqueadoDe(res, opcoes)` | `blockedOf(house, options)` |
20
+ | `.pontoDe(mundo, id)` | `pointOf(world, id)` |
21
+ | `.especProprio(tipo, ...)` | `ownSpec(type, ...)` |
22
+ | `.versao` | `.version` (`'0.3.0'`) |
23
+
24
+ ## Options
25
+
26
+ | Team | Here |
27
+ |---|---|
28
+ | `regiao` | `region` (default `'br'`) |
29
+ | `locale` | `locale` (default `'pt-BR'`) |
30
+ | `cadeiras` | `chairs` (also a plan option) |
31
+ | `semente` | `seed` |
32
+ | `andar` | `floor` |
33
+ | `externos` | `externals` |
34
+ | `noite` | `night` |
35
+ | `luzesLigadas` | `lightsOn` |
36
+ | `origemX`, `origemZ` | `originX`, `originZ` |
37
+ | `base`, `inw` | `base`, `inw` |
38
+ | `rede` | `grid` |
39
+ | `agua` | `water` |
40
+ | `bloqueado` | `isBlocked` |
41
+ | `construir` | `build` |
42
+ | `folga` | `margin` |
43
+
44
+ New: `typeMap`, `contentMap`, `contentByGroup`, `contentFallback`, `groupOf`, `chairTables`, `chairSide`, `fixturesOfPoint`, `substitutes`, `preference`, `ownTypes`,
45
+ `frozenItems`, `drawerItems`, `seedKey`, `messages`. Each table of the team became a registry with the team's values as default; a key with `null` removes the entry.
46
+
47
+ ## Answer of `plan` (`planejar`)
48
+
49
+ | Team | Here |
50
+ |---|---|
51
+ | `versao`, `template`, `semente` | `version`, `template`, `seed` |
52
+ | `andar` / `piso` (of an entry) | `floor` / `floorY` |
53
+ | `itens` | `items` |
54
+ | `tomadas`, `interruptores`, `luzes`, `lampioes` | `outlets`, `switches`, `lights`, `lanterns` |
55
+ | `botijoes`, `fogoes`, `pontos` | `cylinders`, `stoves`, `points` |
56
+ | `entradaEnergia`, `quadro`, `medidor`, `conduites` | `serviceEntrance`, `panel`, `meter`, `conduits` |
57
+ | `mapeados`, `naoMapeados`, `descartados`, `avisos` | `mapped`, `unmapped`, `discarded`, `warnings` |
58
+ | `cadeiras`, `origem` | `chairs`, `origin` |
59
+ | entry `{ tipo, origem, ligacoes, ligada, ponto, afastado }` | `{ type, origin, connections, lit, point, moved }` |
60
+ | connections `chuveiro, tomada, botijao, circuito, controla, topoChamine, vazao_lpm, circuitoTomada` | `shower, outlet, cylinder, circuit, controls, chimneyTop, flowLpm, outletCircuit` |
61
+ | fixture `{ objeto, tipoPonto }` (`torneira`, `chuveiro`, `descarga`, `tanque`, `maquina`) | `{ object, pointKind }` (`tap`, `shower`, `flush`, `tub`, `machine`) |
62
+ | botijao `{ fogao, local }` (`ao_lado`, `nicho_externo`, `sob_bancada`) | cylinder `{ stove, place }` (`beside`, `external_niche`, `under_counter`) |
63
+ | `add` answer `{ adicionados, partes, dobradicas, afastados, avisos }` | `{ added, parts, hinges, moved, warnings }` |
64
+ | stack data `{ nome_pt, origem, categoria, pegavel }` | `{ source, group, pickable }` (`nome_pt` is dropped: the item has its own name) |
65
+
66
+ ## Ids the adapter creates
67
+
68
+ | Team | Here |
69
+ |---|---|
70
+ | `entrada_energia` | `service_entrance` |
71
+ | `quadro`, `medidor` | `panel`, `meter` |
72
+ | `gas_encanado` (type `gas_encanado`) | `piped_gas` (type `gas_piped`) |
73
+ | `conduite_descida`, `circuito_avulso` | `conduit_descent`, `standalone_circuit` |
74
+ | `<id>#aereo`, `<id>#armario`, `<id>#cadeiraN` | `<id>#overhead`, `<id>#cabinet`, `<id>#chairN` |
75
+
76
+ Seeds: the objects the adapter creates are drawn from the seed of their id, so the renamed ids draw different numbers than the team's. A game that must reproduce a scene
77
+ saved with the team's ids passes `seedKey` (the house renderer forwards its own `seedKey` option).
78
+
79
+ ## Furniture types (team `tipo` to the type of the plan)
80
+
81
+ | Kit type (key of `typeMap`) | Team `tipo` |
82
+ |---|---|
83
+ | `table_lamp` | `abajur` |
84
+ | `sideboard` | `aparador` |
85
+ | `console_table` | `aparador_c` |
86
+ | `kitchen_cabinet` | `armario_cozinha` |
87
+ | `kitchen_cabinet_large` | `armario_cozinha_g` |
88
+ | `kitchen_cabinet_small` | `armario_cozinha_p` |
89
+ | `laundry_cabinet` | `armario_lav` |
90
+ | `filing_cabinet` | `arquivo` |
91
+ | `workbench` | `bancada_ferr` |
92
+ | `bench` | `banco` |
93
+ | `garden_bench` | `banco_jardim` |
94
+ | `log_bench` | `banco_tronco` |
95
+ | `stool` | `banqueta` |
96
+ | `bunk_bed` | `beliche` |
97
+ | `gas_cylinder` | `botijao` |
98
+ | `camp_gas_canister` | `botijao_camping` |
99
+ | `cooking_gas_cylinder` | `botijao_gas` |
100
+ | `shower` | `box` |
101
+ | `shower_large` | `box_g` |
102
+ | `buffet` | `bufe` |
103
+ | `rocking_chair` | `cadeira_balanco` |
104
+ | `camp_chair` | `cadeira_camping` |
105
+ | `mailbox` | `caixa_correio` |
106
+ | `double_bed` | `cama_casal` |
107
+ | `improvised_bed` | `cama_improvisada` |
108
+ | `king_bed` | `cama_king` |
109
+ | `queen_bed` | `cama_queen` |
110
+ | `single_bed` | `cama_solteiro` |
111
+ | `doghouse` | `casinha_cachorro` |
112
+ | `bbq_grill` | `churrasqueira` |
113
+ | `bbq_simple` | `churrasqueira_simples` |
114
+ | `dresser` | `comoda` |
115
+ | `cooler` | `cooler` |
116
+ | `curtain` | `cortina` |
117
+ | `nightstand` | `criado` |
118
+ | `china_cabinet` | `cristaleira` |
119
+ | `pantry` | `despensa` |
120
+ | `desk` | `escrivaninha` |
121
+ | `waiting_bench` | `espera` |
122
+ | `tool_shelf` | `estante_ferr` |
123
+ | `stove` | `fogao` |
124
+ | `stove_4burner` | `fogao4` |
125
+ | `wood_stove` | `fogao_lenha` |
126
+ | `camp_stove` | `fogareiro` |
127
+ | `campfire` | `fogueira` |
128
+ | `freezer` | `freezer` |
129
+ | `fridge` | `geladeira` |
130
+ | `fridge_large` | `geladeira2` |
131
+ | `display_fridge_medium` | `geladeira_med` |
132
+ | `wardrobe` | `guarda` |
133
+ | `closet_wardrobe` | `guarda_closet` |
134
+ | `wardrobe_large` | `guarda_g` |
135
+ | `wardrobe_small` | `guarda_peq` |
136
+ | `oil_lamp` | `lampiao` |
137
+ | `camp_lantern` | `lampiao_camping` |
138
+ | `ceiling_oil_lamp` | `lampiao_teto` |
139
+ | `fireplace` | `lareira` |
140
+ | `trash_bin` | `lixeira` |
141
+ | `outdoor_bin` | `lixeira_ext` |
142
+ | `floor_lamp` | `luminaria` |
143
+ | `chandelier` | `lustre` |
144
+ | `washing_machine` | `maquina` |
145
+ | `dining_table` | `mesa` |
146
+ | `camp_table` | `mesa_camping` |
147
+ | `office_desk` | `mesa_escr` |
148
+ | `office_desk_large` | `mesa_escr_g` |
149
+ | `outdoor_table` | `mesa_ext` |
150
+ | `gourmet_table` | `mesa_gourmet` |
151
+ | `gourmet_table_small` | `mesa_gourmet_peq` |
152
+ | `dining_table_large` | `mesa_grande` |
153
+ | `dining_table_small` | `mesa_peq` |
154
+ | `dining_table_round` | `mesa_red` |
155
+ | `microwave` | `microondas` |
156
+ | `pendant` | `pendente` |
157
+ | `blinds` | `persiana` |
158
+ | `washbasin` | `pia_b` |
159
+ | `pedestal_basin` | `pia_coluna` |
160
+ | `rustic_sink` | `pia_rustica` |
161
+ | `ceiling_light` | `plafon` |
162
+ | `well` | `poco` |
163
+ | `armchair` | `poltrona` |
164
+ | `armchair_high` | `poltrona_alta` |
165
+ | `plank_shelf` | `prateleira_tabua` |
166
+ | `outhouse` | `privada` |
167
+ | `tv_unit` | `rack` |
168
+ | `tv_unit_large` | `rack_grande` |
169
+ | `tv_unit_small` | `rack_peq` |
170
+ | `display_fridge` | `refrig_exp` |
171
+ | `sofa_2seat` | `sofa2` |
172
+ | `sofa_3seat` | `sofa3` |
173
+ | `sofa_l` | `sofa_l` |
174
+ | `sofa_xl` | `sofa_xl` |
175
+ | `track_spot` | `spot_trilho` |
176
+ | `laundry_tub` | `tanque` |
177
+ | `tv` | `tv` |
178
+ | `tv_large` | `tv_grande` |
179
+ | `clothesline` | `varal` |
180
+ | `toilet` | `vaso` |
181
+
182
+ ## Content ids (team to household item)
183
+
184
+ The team's table was keyed by the ids of `PlantasSDK`; the plan of the kit carries the ids of `game-items-goods` and of the structure pack, which the adapter resolves
185
+ before using `contentMap` (31 ids of the structure table were matched by name; see the evidence of spec 001).
186
+
187
+ | Kit id (key of `contentMap`) | Team id |
188
+ |---|---|
189
+ | `sugar` | `acucar` |
190
+ | `water_jug_5l` | `agua_galao` |
191
+ | `water_jug` | `agua_galao` |
192
+ | `water_bottle` | `agua_garrafa` |
193
+ | `bleach` | `agua_sanitaria` |
194
+ | `alcohol_70` | `alcool` |
195
+ | `rubbing_alcohol` | `alcool` |
196
+ | `pliers` | `alicate` |
197
+ | `fabric_softener` | `amaciante` |
198
+ | `rice` | `arroz` |
199
+ | `bucket` | `balde` |
200
+ | `biscuits` | `biscoito` |
201
+ | `cable_bundle` | `cabos` |
202
+ | `cables` | `cabos` |
203
+ | `coffee` | `cafe` |
204
+ | `jeans` | `calca` |
205
+ | `trousers` | `calca` |
206
+ | `tshirt` | `camisa` |
207
+ | `shirt` | `camisa` |
208
+ | `t_shirt` | `camiseta` |
209
+ | `mug` | `caneca` |
210
+ | `pen` | `caneta` |
211
+ | `frozen_meat` | `carne` |
212
+ | `raw_beef` | `carne` |
213
+ | `packed_meat` | `carne` |
214
+ | `phone_charger` | `carregador` |
215
+ | `charger` | `carregador` |
216
+ | `letter` | `carta` |
217
+ | `jacket` | `casaco` |
218
+ | `coat` | `casaco` |
219
+ | `clothespins` | `cesto_pregadores` |
220
+ | `screwdriver` | `chave_fenda` |
221
+ | `house_key` | `chaves` |
222
+ | `keys` | `chaves` |
223
+ | `flip_flops` | `chinelo` |
224
+ | `blanket` | `cobertor` |
225
+ | `bill` | `conta` |
226
+ | `remote_control` | `controle_remoto` |
227
+ | `cup` | `copo` |
228
+ | `rope` | `corda` |
229
+ | `adhesive_bandages` | `curativo` |
230
+ | `bandages` | `curativo` |
231
+ | `disinfectant` | `desinfetante` |
232
+ | `detergent` | `detergente` |
233
+ | `dish_soap` | `detergente` |
234
+ | `documents` | `documento` |
235
+ | `dvd` | `dvd` |
236
+ | `dvds` | `dvd` |
237
+ | `food_packaging` | `embalagem` |
238
+ | `packaging` | `embalagem` |
239
+ | `toothbrush` | `escova_dente` |
240
+ | `sponge` | `esponja` |
241
+ | `knife` | `faca` |
242
+ | `kitchen_knife` | `faca` |
243
+ | `flour` | `farinha` |
244
+ | `beans` | `feijao` |
245
+ | `electrical_tape` | `fita_isolante` |
246
+ | `insulating_tape` | `fita_isolante` |
247
+ | `apple` | `fruta` |
248
+ | `fruit` | `fruta` |
249
+ | `stapler` | `grampeador` |
250
+ | `shoe_polish` | `graxa` |
251
+ | `insulin` | `insulina` |
252
+ | `yogurt` | `iogurte` |
253
+ | `flashlight` | `lanterna` |
254
+ | `canned_food` | `lata_atum` |
255
+ | `canned_tuna` | `lata_atum` |
256
+ | `canned_corn_and_peas` | `lata_milho` |
257
+ | `canned_corn` | `lata_milho` |
258
+ | `paint_can` | `lata_tinta` |
259
+ | `empty_can` | `lata_vazia` |
260
+ | `milk_carton` | `leite` |
261
+ | `book` | `livro` |
262
+ | `rubber_gloves` | `luvas` |
263
+ | `pasta` | `macarrao` |
264
+ | `hammer` | `martelo` |
265
+ | `socks` | `meias` |
266
+ | `backpack` | `mochila` |
267
+ | `eyeglasses` | `oculos` |
268
+ | `glasses` | `oculos` |
269
+ | `cooking_oil` | `oleo` |
270
+ | `eggs` | `ovos` |
271
+ | `pot` | `panela` |
272
+ | `flyer` | `panfleto` |
273
+ | `crumpled_paper` | `papel_amassado` |
274
+ | `toilet_paper` | `papel_higienico` |
275
+ | `painkillers` | `paracetamol` |
276
+ | `painkiller` | `paracetamol` |
277
+ | `screws` | `parafusos` |
278
+ | `batteries` | `pilhas` |
279
+ | `plate` | `prato` |
280
+ | `china_plates` | `prato` |
281
+ | `plates` | `prato` |
282
+ | `nails` | `pregos` |
283
+ | `cheese` | `queijo` |
284
+ | `soda_can` | `refrigerante` |
285
+ | `soda` | `refrigerante` |
286
+ | `maintenance_medication` | `remedio` |
287
+ | `medicine` | `remedio` |
288
+ | `underwear` | `roupa_intima` |
289
+ | `laundry_powder` | `sabao_po` |
290
+ | `washing_powder` | `sabao_po` |
291
+ | `soap` | `sabonete` |
292
+ | `trash_bag` | `saco_lixo` |
293
+ | `full_trash_bag` | `saco_lixo_cheio` |
294
+ | `shoes` | `sapato` |
295
+ | `handsaw` | `serrote` |
296
+ | `hand_saw` | `serrote` |
297
+ | `shampoo` | `shampoo` |
298
+ | `leftover_meal` | `sobras` |
299
+ | `leftovers` | `sobras` |
300
+ | `ice_cream` | `sorvete` |
301
+ | `wine_glass` | `taca` |
302
+ | `wine_glasses` | `taca` |
303
+ | `seasoning` | `tempero` |
304
+ | `spices` | `tempero` |
305
+ | `sneakers` | `tenis` |
306
+ | `scissors` | `tesoura` |
307
+ | `broom` | `vassoura` |
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ # @adatechnology/game-floorplan-interactables
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Adapter from the plan of `@adatechnology/game-floorplan` to the objects of the interactables kit (`game-interactables` + `game-interactables-household`). It turns
4
+ each piece of furniture of a house into a household object with its doors, drawers, hinges, sockets, switches, lamps, appliances and containers, wires the
5
+ house (service entrance, meter, panel, circuits, gas cylinders and pipes, water points), puts chairs around the tables, fills the containers with the finds of the plan and fits the
6
+ hinged doors against the walls. Port of the team's `AdaptadorInterativos` v0.3.0 (the names are in `MIGRATION.md`).
7
+
8
+ No three.js and no game names: the three.js side is `game-interactables-three`, and `game-floorplan-three` uses this package as the default of its `interactives` option.
9
+
10
+ ```ts
11
+ import * as GameInteractables from '@adatechnology/game-interactables'
12
+ import * as GameInteractablesHousehold from '@adatechnology/game-interactables-household'
13
+ import { create } from '@adatechnology/game-floorplan-interactables'
14
+
15
+ const adapter = create({ GameInteractables, GameInteractablesHousehold }) // locale 'pt-BR', region 'br': the team's defaults
16
+ const planned = adapter.plan(house, { seed: house.seed, night: true }) // items, outlets, switches, lights, cylinders, fixtures, chairs, unmapped...
17
+ const world = adapter.createWorld(house, { seed: house.seed })
18
+ const out = adapter.add(world, planned, { isBlocked: adapter.blockedOf(house) }) // { added, parts, hinges, moved, warnings }
19
+ ```
20
+
21
+ ## Everything is a registry
22
+
23
+ Each table of the team is a default the game can extend, replace or empty (a key with `null` removes the entry), without touching the adapter:
24
+
25
+ | Option | Table |
26
+ |---|---|
27
+ | `typeMap` | furniture type of the plan to household type, variant, compound (sink, basin), dimensions, watts |
28
+ | `contentMap`, `contentByGroup`, `contentFallback`, `groupOf` | item of the plan to household item |
29
+ | `chairTables`, `chairSide`, `chairs` | tables that get chairs |
30
+ | `fixturesOfPoint` | plumbing points to fixtures |
31
+ | `substitutes`, `preference`, `ownTypes`, `frozenItems`, `drawerItems` | substitutes by type, who takes a stack first, types the adapter builds itself, frozen items, drawer items |
32
+ | `locale`, `region`, `messages` | language of the household pack and of the warnings (`en`, `pt-BR`), texts |
33
+ | `seedKey` | maps an id to the key of its seeded draws (reproduces another scene's seeds) |
34
+
35
+ No `Math.random`: every draw is seeded.
36
+
37
+ ## Reading the plan
38
+
39
+ The adapter reads the plan of the kit (English names, `contents` as stacks of the goods catalog, `utilities` from the structure pack). Without the structure pack there are no
40
+ utilities and the house gets furniture only. Lights follow `electrical.mode` (grid, tap, off-grid) and the `night` / `lightsOn` options.
41
+
42
+ ## Tests
43
+
44
+ `tests/team-golden.test.ts` runs the team's original code (`tests/fixtures/team-golden/adaptador-interativos.js`, verbatim) in a `vm` on the same houses and compares everything
45
+ after renaming: the plan of 17 typologies over several seeds and the states fortified and abandoned, the serialization of the world, `add`, `blockedOf`, the chimney and the goods contents.
@@ -0,0 +1,167 @@
1
+ declare const en: {
2
+ readonly 'error.missingKit': "game-floorplan-interactables: create needs GameInteractables and GameInteractablesHousehold";
3
+ readonly 'error.unknownOwnType': "game-floorplan-interactables: unknown own type: {type}";
4
+ readonly 'warn.cylinderNoCabinet': "cylinder {id} under the counter has no kitchen cabinet to hide it";
5
+ readonly 'warn.cabinetNoDoor': "cabinet {cabinet} has no door for the cylinder {id}";
6
+ readonly 'warn.switchUnknownLamp': "switch {id} controls {lamp}, which does not exist";
7
+ readonly 'warn.pointNoObject': "point {id} ({kind}) has no object for {item}";
8
+ readonly 'warn.buildEmpty': "build returned nothing for {id}";
9
+ };
10
+ type MessageKey = keyof typeof en;
11
+ type Messages = Record<MessageKey, string>;
12
+ declare const locales: Record<string, Messages>;
13
+ /** Translator for a locale (`pt-BR`, `pt`, `en`, another falls back to `en`); `table` adds or replaces keys. */
14
+ declare function createTranslator(locale?: string, table?: Partial<Messages>): (key: MessageKey, params?: Record<string, string | number>) => string;
15
+
16
+ /** How a furniture type of the plan becomes an object of the household pack. */
17
+ interface TypeMapEntry {
18
+ /** Household type (`hh.types`), or one the adapter creates itself (`lamp`). */
19
+ type?: string;
20
+ /** Household variant (`steel`, `garage`, `hanging`). */
21
+ variant?: string;
22
+ /** The furniture becomes more than one object: `sink` (basin + base cabinet + wall cabinet), `basin` (bathroom basin + wall cabinet), `rustic_sink`. */
23
+ compound?: 'sink' | 'basin' | 'rustic_sink';
24
+ /**
25
+ * Which sizes of the furniture go to the drawing: `wdh` (default), `wd` (width and depth: the plan gives the height of the base, not of the whole drawing, like the
26
+ * 10 cm shower tray or the 50 cm bench without a back), `wh`, `w`, `x` (none, but the height off the floor `y` stays) or `none` (none, not even `y`).
27
+ */
28
+ dim?: 'wdh' | 'wd' | 'wh' | 'w' | 'x' | 'none';
29
+ /** Power of a lamp (W). */
30
+ watts?: number;
31
+ }
32
+ /** Furniture type of the plan to the object of the kit (`TypeMapEntry`). */
33
+ declare const TYPE_MAP: Readonly<Record<string, TypeMapEntry>>;
34
+ /**
35
+ * Tables that get chairs of the kit (the plan puts none around them). `dining`: chairs on both long sides (and at the ends if the table is 1.6 m or more); `office`:
36
+ * one armchair on the front side of the desk. The adapter only puts a chair where it fits (walls and other furniture).
37
+ */
38
+ declare const CHAIR_TABLES: Readonly<Record<string, 'dining' | 'office'>>;
39
+ /** Side of the dining chair of the pack (m). */
40
+ declare const DINING_CHAIR_SIDE = 0.45;
41
+ /**
42
+ * What a content stack of the plan (`FindStack.itemId`) becomes in the household catalog (`hh.items`). The ids on the left are the ones the structure pack
43
+ * puts in `result.contents` by default and the ones of the goods catalog (`game-items-goods`, through its provenance); the right side is the team's choice.
44
+ * An id that is not here but is a household item stays as it is.
45
+ */
46
+ declare const CONTENT_MAP: Readonly<Record<string, string>>;
47
+ /** When the item is in no table: the closest household item by the group of the stack (`FindStack.group`). */
48
+ declare const CONTENT_BY_GROUP: Readonly<Record<string, string>>;
49
+ /** The item for a stack with no table entry, no household id and no known group. */
50
+ declare const CONTENT_FALLBACK = "crumpled_paper";
51
+ /** Items that go in the freezer first (the team asked for it by the name of the stack: ice cream and "frozen meat"). */
52
+ declare const FROZEN_ITEMS: readonly string[];
53
+ /** Items that go in the drawers of a wardrobe first (underwear and socks). */
54
+ declare const DRAWER_ITEMS: readonly string[];
55
+ /** Groups that go in the drawer of a kitchen base cabinet first. */
56
+ declare const DRAWER_GROUPS: readonly string[];
57
+ /** The last resort when nothing of the category fits the slots of the object (a mailbox holds only thin paper). */
58
+ declare const OBJECT_SUBSTITUTES: Readonly<Record<string, readonly string[]>>;
59
+ /** Point of the plumbing (`plumbing.points[].kind`) to the fixtures of the household object that use it. */
60
+ declare const FIXTURES_OF_POINT: Readonly<Record<string, readonly string[]>>;
61
+ /** Objects the kit does not have and the adapter creates itself (without going through `build`). */
62
+ declare const OWN_TYPES: Readonly<Record<string, true>>;
63
+
64
+ /** Loosely typed data: the plan of the engine (`result` of `generate`), the kit objects and the specs of the household pack. */
65
+ type Json = any;
66
+ type Registry<T> = Readonly<Record<string, T | null | undefined>>;
67
+ interface AdapterOptions {
68
+ /** The `game-interactables` module (or its global): `createWorld`, `fitsSlot`, `hashString`. Required. */
69
+ GameInteractables?: Json;
70
+ /** The `game-interactables-household` module (or its global): `createHousehold`, `createRecorder`. Required. */
71
+ GameInteractablesHousehold?: Json;
72
+ /** Locale of the household pack and of the warnings (default `pt-BR`, the team's). */
73
+ locale?: string;
74
+ /** Region of the household pack (default `br`, the team's). */
75
+ region?: string;
76
+ /** `false`: no chairs around the tables (also a plan option). */
77
+ chairs?: boolean;
78
+ /** Side of the dining chair (m, default 0.45, the chair of the pack). */
79
+ chairSide?: number;
80
+ /** Maps the id of an object to the key of its seeded random (default: the id itself); the house renderer passes its `seedKey` to reproduce the team's seeds. */
81
+ seedKey?: (id: string) => string | null | undefined;
82
+ /** Texts of the warnings and errors, by key. */
83
+ messages?: Partial<Record<MessageKey, string>>;
84
+ /** Furniture type of the plan to object of the kit; `null` drops a default entry. */
85
+ typeMap?: Registry<TypeMapEntry>;
86
+ /** Id of a content stack to household item. */
87
+ contentMap?: Registry<string>;
88
+ /** Group of a content stack (`food`, `tool`...) to the household item used when no table entry exists. */
89
+ contentByGroup?: Registry<string>;
90
+ /** Item for a stack that is in no table, is no household item and has no known group (default `crumpled_paper`). */
91
+ contentFallback?: string;
92
+ /** Group of an item id, for stacks that carry none (the goods finds provider answers `{ itemId, count }` only). */
93
+ groupOf?: (itemId: string) => string | null | undefined;
94
+ /** Tables that get chairs: furniture type to `dining` or `office`. */
95
+ chairTables?: Registry<'dining' | 'office'>;
96
+ /** Kind of plumbing point to the fixtures of the household object. */
97
+ fixturesOfPoint?: Registry<readonly string[]>;
98
+ /** Substitute items by object type, the last resort when nothing of the category fits. */
99
+ substitutes?: Registry<readonly string[]>;
100
+ /** Order of the containers of an object for a stack, by household type. */
101
+ preference?: Registry<(stack: Json, context: {
102
+ frozen(stack: Json): boolean;
103
+ group(stack: Json): string | null;
104
+ drawerItem(stack: Json): boolean;
105
+ }) => string[]>;
106
+ /** Types the adapter builds itself (default `lamp`, `gas_piped`). */
107
+ ownTypes?: Registry<true>;
108
+ /** Items that go to the freezer first (default `ice_cream`, `frozen_meat`). */
109
+ frozenItems?: readonly string[];
110
+ /** Items that go to the wardrobe drawers first (default `underwear`, `socks`). */
111
+ drawerItems?: readonly string[];
112
+ }
113
+ interface FloorplanAdapter {
114
+ version: string;
115
+ /** The household pack the adapter was made with (`types`, `items`, `loot`, `strings`, `build`). */
116
+ household: Json;
117
+ /** Plans the objects of a plan; pure data, nothing is drawn. Options: `floor`, `externals`, `seed`, `night`, `lightsOn`, `chairs`, `originX`, `originZ`, `inw`, `base`. */
118
+ plan(result: Json, options?: Json): Json;
119
+ /** Creates the kit world with texts, items, loot and the water network. Options: `water` (`{ consume(point, liters) }`), `seed`, `grid`, `onEvent`, `canInteract`, `lightsOn`. */
120
+ createWorld(result: Json, options?: Json): Json;
121
+ /** Adds the planned objects to the world and fits the doors against the walls. Options: `build(type, item)`, `isBlocked(x, z, floor)`, `lightsOn`. */
122
+ add(world: Json, plan: Json, options?: Json): Json;
123
+ /** `(x, z, floor)` to true inside a wall of the plan. Options: `originX`, `originZ`, `inw`, `margin`. */
124
+ blockedOf(result: Json, options?: Json): (x: number, z: number, floor?: number | null) => boolean;
125
+ /** The plumbing point behind a global fixture id (`object:fixture`) of a world made by `createWorld`. */
126
+ pointOf(world: object, fixtureId: string): string | undefined;
127
+ /** The spec of an object the adapter builds itself (`lamp`, `gas_piped`). */
128
+ ownSpec(entry: Json): Json;
129
+ /** The registries in use (defaults with the overrides of the game). */
130
+ registries: Record<string, Json>;
131
+ }
132
+
133
+ /** Version of the team's adapter this is the port of. */
134
+ declare const ADAPTER_VERSION = "0.3.0";
135
+ /** Copy of a table with the overrides applied: a `null` or `undefined` value removes the entry. */
136
+ declare function mergeRegistry<T>(base: Readonly<Record<string, T>>, extra?: Readonly<Record<string, T | null | undefined>> | null): Record<string, T>;
137
+ /** The helpers the preference functions of a container get. */
138
+ interface PreferenceContext {
139
+ /** The stack goes in the freezer first (ice cream, frozen meat). */
140
+ frozen(stack: Json): boolean;
141
+ /** Group of the stack (`food`, `tool`, ...), or null. */
142
+ group(stack: Json): string | null;
143
+ /** The stack is underwear or socks. */
144
+ drawerItem(stack: Json): boolean;
145
+ }
146
+ /** Order of the containers of an object for a stack (the first with a free slot that fits takes the stack). */
147
+ type Preference = (stack: Json, context: PreferenceContext) => string[];
148
+ /** Default preference by household type. */
149
+ declare const PREFERENCE: Readonly<Record<string, Preference>>;
150
+ declare function create(options?: AdapterOptions): FloorplanAdapter;
151
+
152
+ /**
153
+ * The adapter as the house renderer takes it (`interactives.adapter`): `create(options)` makes the adapter; the tables are on it too.
154
+ * Same shape as the team's `AdaptadorInterativos` (`criar`, `MAPA_TIPOS`, `MAPA_CONTEUDO`, `CONTEUDO_POR_CATEGORIA`).
155
+ */
156
+ declare const FloorplanInteractables: {
157
+ version: string;
158
+ create: typeof create;
159
+ TYPE_MAP: Readonly<Record<string, TypeMapEntry>>;
160
+ CONTENT_MAP: Readonly<Record<string, string>>;
161
+ CONTENT_BY_GROUP: Readonly<Record<string, string>>;
162
+ CHAIR_TABLES: Readonly<Record<string, "dining" | "office">>;
163
+ PREFERENCE: Readonly<Record<string, Preference>>;
164
+ mergeRegistry: typeof mergeRegistry;
165
+ };
166
+
167
+ export { ADAPTER_VERSION, type AdapterOptions, CHAIR_TABLES, CONTENT_BY_GROUP, CONTENT_FALLBACK, CONTENT_MAP, DINING_CHAIR_SIDE, DRAWER_GROUPS, DRAWER_ITEMS, FIXTURES_OF_POINT, FROZEN_ITEMS, type FloorplanAdapter, FloorplanInteractables, type Json, type MessageKey, type Messages, OBJECT_SUBSTITUTES, OWN_TYPES, PREFERENCE, type Preference, type PreferenceContext, type Registry, TYPE_MAP, type TypeMapEntry, create, createTranslator, locales, mergeRegistry };