Skip to main content
Verticopolis engineGitHub

verticopolis_engine/catalog/
build.rs

1use super::*;
2
3/// The catalog for `mode`.
4pub fn catalog(mode: GameMode) -> Catalog {
5    Catalog {
6        version: CATALOG_VERSION,
7        mode: mode.as_str(),
8        world: World {
9            lot_width: LOT_WIDTH,
10            min_floor: MIN_FLOOR,
11            max_floor: MAX_FLOOR,
12            ground_floor: 1,
13            ground_floor_structure: ground_floor_structure_kind(Kind::Floor, 1).as_str(),
14            lobby_interval: LOBBY_INTERVAL,
15        },
16        economy: Economy {
17            starting_money: STARTING_MONEY,
18            add_car_cost: ADD_CAR_COST,
19            car_resale_refund: car_resale_refund(),
20            transport_floor_cost: TRANSPORT_FLOOR_COST,
21            calendars: calendars_for(mode),
22            maintenance_per_car_monthly: MAINTENANCE_PER_CAR_MONTHLY,
23            overhead_per_unit_monthly: mode.operating_overhead_per_unit(),
24            condo_hold_tax_rate: mode.condo_hold_tax_rate(),
25            nightclub_dj_monthly: NIGHTCLUB_DJ_MONTHLY,
26            garbage_collect_hour: GARBAGE_COLLECT_HOUR,
27            exterminator: mode
28                .infestation_recovery()
29                .map(|(callout_fee, per_room_fee)| ExterminatorFees {
30                    callout_fee,
31                    per_room_fee,
32                }),
33            films: mode.films().offers,
34            film_rebooks: mode.films().rebooks,
35            film_rebook_default: mode.films().rebook_default,
36            auto_bridge_toggleable: mode.bridging_toggleable(),
37        },
38        rules: Rules {
39            variant_households: mode.variant_households(),
40            preview_names_refusal: mode.preview_names_refusal(),
41            schedule_assist: mode.schedule_assist(),
42            builds_while_paused: mode.builds_while_paused(),
43        },
44        pools: POOLED_CAPS
45            .iter()
46            .zip(POOL_KEYS)
47            .map(|(p, key)| PoolEntry {
48                key,
49                label: p.label,
50                cap: p.cap,
51                kinds: p.kinds.iter().map(|k| k.as_str()).collect(),
52            })
53            .collect(),
54        facilities: FACILITIES
55            .iter()
56            .map(|f| facility_entry(mode, f.kind))
57            .collect(),
58    }
59}