summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index d9bf342..11623b0 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -4,6 +4,8 @@
const fs = require('fs')
+function cmpnum(a,b) { return a - b }
+
// :r !python3 genboxes.py
const boxes = {
"Wesenberg": [1448,3625,304,60],
@@ -301,6 +303,20 @@ function dumplist(name, list) {
print("],")
}
+locales.forEach(loc => {
+ loc.adjacent = []
+ loc.adjacent_by_trackway = []
+ for (let [to, way] of loc.ways) {
+ if (!loc.adjacent.includes(to))
+ loc.adjacent.push(to)
+ if (ways[way].type === "trackway")
+ if (!loc.adjacent_by_trackway.includes(to))
+ loc.adjacent_by_trackway.push(to)
+ }
+ loc.adjacent.sort(cmpnum)
+ loc.adjacent_by_trackway.sort(cmpnum)
+})
+
function seats(list) {
return list.split(", ").map(name => locmap[name]).sort((a,b)=>a-b)
}
@@ -589,8 +605,6 @@ let lords = [
let AOW = {}
let cards = []
-function cmpnum(a,b) { return a - b }
-
function arts_of_war_event(name, event, when) {
let c = { name, event, when, capability: null, this_lord: false, lords: null }
cards.push(c)