From 8eda31b500eb6ec8778d299daf373a430ad4c98e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 17 Mar 2024 18:33:34 +0100 Subject: Add cities and roads to client. --- tools/parse-layout.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'tools/parse-layout.js') diff --git a/tools/parse-layout.js b/tools/parse-layout.js index e3a76fd..8cf2a9f 100644 --- a/tools/parse-layout.js +++ b/tools/parse-layout.js @@ -224,8 +224,8 @@ const BAVARIA = "Bavaria" const PRUSSIA = "Prussia" const SAXONY = "Saxony" const AUSTRIA = "Austria" -const AUSTRIAN_NETHERLANDS = "Austrian Netherlands" -const HRE = "Holy Roman Empire" +const AUSTRIAN_NETHERLANDS = "Austria" +const HRE = "HRE" const NETHERLANDS = "Netherlands" const SILESIA = "Silesia" const POLAND = "Poland" @@ -268,7 +268,7 @@ for (let key in points) { } else if (find_enclosing_rect(rects.$Austria_W, x, y)) { map = FLANDERS - country = AUSTRIA + country = AUSTRIAN_NETHERLANDS } else if (find_enclosing_rect(rects.$Austria_E, x, y)) { map = BOHEMIA @@ -325,16 +325,20 @@ for (let key in points) { } cities.sort((a,b) => { - if (a.map < b.map) return 1 - if (a.map > b.map) return -1 if (a.country < b.country) return -1 if (a.country > b.country) return 1 + + if (a.map < b.map) return 1 + if (a.map > b.map) return -1 + if (a.suit < b.suit) return -1 if (a.suit > b.suit) return 1 - if (a.type === "major_fortress" && b.type !== "major_fortress") return -1 - if (a.type !== "major_fortress" && b.type === "major_fortress") return 1 - if (a.type === "minor_fortress" && b.type !== "minor_fortress") return -1 - if (a.type !== "minor_fortress" && b.type === "minor_fortress") return 1 + + //if (a.type === "major_fortress" && b.type !== "major_fortress") return -1 + //if (a.type !== "major_fortress" && b.type === "major_fortress") return 1 + //if (a.type === "minor_fortress" && b.type !== "minor_fortress") return -1 + //if (a.type !== "minor_fortress" && b.type === "minor_fortress") return 1 + if (a.name < b.name) return -1 if (a.name > b.name) return 1 return b.y - a.y @@ -357,7 +361,7 @@ for (let e of edges.road) { let arrays = { name: [], // map: [], - // country: [], + country: [], // suit: [], // type: [], x: [], @@ -391,7 +395,7 @@ let sets = { Prussia: [], Saxony: [], Silesia: [], - "Holy Roman Empire": [], + HRE: [], }, } -- cgit v1.2.3