town tweak

This commit is contained in:
33333-33333 2026-05-24 17:38:51 +09:00
commit 1ea8ba1701
12 changed files with 5005 additions and 379 deletions

17
app.js
View file

@ -1,5 +1,6 @@
import { generateMap } from "./mapGenerator.js";
import { drawMap } from "./renderer.js";
import { landuseLabel } from "./landuseCodes.js";
const modes = [
["all", "All"],
@ -57,6 +58,8 @@ function countText(items) {
function getStats(map) {
return [
["Map Type", map.terrainTemplate?.terrainTypeLabel || map.terrainDebug?.terrainTypeLabel || "-"],
["Terrain ID", map.terrainTemplate?.terrainType || map.terrainDebug?.terrainType || "-"],
["Villages", countText(map.villages)],
["Market Towns", countText(map.markets)],
["Castles", countText(map.castles)],
@ -66,6 +69,7 @@ function getStats(map) {
["Neighbor Prefectures", (map.neighborPrefectures || []).map((p) => p.name).join(" / ") || "-"],
["Neighbor Features", map.neighborPrefectureDetails ? `${map.neighborPrefectureDetails.cities?.length || 0} cities / ${map.neighborPrefectureDetails.adminCenters?.length || 0} municipalities / ${map.neighborPrefectureDetails.roads?.length || 0} roads` : "-"],
["Prefectural Capital", map.prefecturalCapital?.name || "-"],
["Regional Capitals", (map.modernCities || []).filter((p) => p.isRegionalCapital).length],
["Modern Cities", countText(map.modernCities)],
["Ports", `${map.ports.filter((p) => p.portClass === "major").length} major / ${map.ports.filter((p) => p.portClass === "regional").length} regional / ${map.ports.filter((p) => p.portClass === "fishing").length} fishing / ${map.ports.filter((p) => p.portClass === "lake").length} lake`],
["Satellite Cities", countText(map.satelliteCities || [])],
@ -148,18 +152,7 @@ function nearestEntity(map, x, y, maxDistance = 5) {
}
function landuseName(value) {
return {
0: "Agriculture",
1: "Plain",
2: "Old urban area",
3: "CBD / DID core",
4: "Suburban urban area",
5: "Industrial zone",
6: "Logistics area",
7: "New town",
8: "Roadside development",
9: "Forest / rural land",
}[value] || "Land";
return landuseLabel(value);
}
function adminName(map, adminId) {