code wiki / (root) / nx_decl_townscape.nx

nx_decl_townscape.nx

buildroot/runtime/nx_decl_townscape.nx

6361 B168 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind librarytopic decl
docsdependenciesstructsconstsfunctions

about

nx_decl_townscape.nx -- fifth declarative #tag-style primitive. license_tier: ORIGINAL Composes a populated outdoor settlement: an environment with a settlement guaranteed + building counts + road density + market presence. Distinct from simple_scene: emphasis on inhabited structure, not landscape. Equivalent of `#townscape <modifier>`. Per S-class roadmap §A3 -- fifth slice.

dependencies 6 imports · 1 importers

nx_syscalls.nx nx_types.nx nx_tier.nx nx_biome_classifier.nx nx_decl_random_environment.nx nx_decl_simple_scene.nx nx_decl_townscape.nx nx_decl_townscape_test.nx

imports: nx_syscalls.nxnx_types.nxnx_tier.nxnx_biome_classifier.nxnx_decl_random_environment.nxnx_decl_simple_scene.nx

imported by: nx_decl_townscape_test.nx

structs

53struct NxTownscape

consts

24const NX_MAGIC_1200: i64 = 1200
25const NX_MAGIC_8000: i64 = 8000
28const NX_TOWN_KIND_HAMLET: nx_int = 0 // < 50 people
29const NX_TOWN_KIND_VILLAGE: nx_int = 1 // 50..500
30const NX_TOWN_KIND_TOWN: nx_int = 2 // 500..5000
31const NX_TOWN_KIND_CITY: nx_int = 3 // 5000+
32const NX_TOWN_KIND_OUTPOST: nx_int = 4 // small frontier (sci-fi or fantasy)
33const NX_TOWN_KIND_METROPOLIS: nx_int = 5 // 100k+ (sci-fi)
34const NX_TOWN_KIND_N: nx_int = 6

functions

36func nx_town_kind_is_valid(k: nx_int) -> nx_int
called by 1: main
42func nx_town_kind_name(k: nx_int) -> *u8
called by 1: main
67func _ts_default_kind(modifier: nx_int, seed: nx_int) -> nx_int
called by 1: nx_decl_townscape calls 1: _re_hash_mod
90func _ts_building_count(kind: nx_int) -> nx_int
100func _ts_road_count(kind: nx_int) -> nx_int
113func _ts_population_log10(kind: nx_int) -> nx_int
called by 1: nx_decl_townscape
124func nx_decl_townscape(out: *NxTownscape, modifier: nx_int, seed: nx_int) -> nx_int
164func nx_ts_alloc() -> *NxTownscape
called by 1: main calls 1: sys_mmap