diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-12-14 19:33:41 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:38 +0100 |
commit | 5b3e18ac67bd606395f53c096c78385d4584a039 (patch) | |
tree | 868032aef121b69956809e161e47a45a15b39712 /tools | |
parent | 4d7ea66092beb7555c842e5fa9420ce3ae9f4c3a (diff) | |
download | nevsky-5b3e18ac67bd606395f53c096c78385d4584a039.tar.gz |
Raiders.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gendata.js | 18 |
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) |