summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-06-01 11:42:06 +0200
committerTor Andersson <tor@ccxvii.net>2024-06-01 11:42:06 +0200
commit71a1badaa074df9ccb3b93910a556c9e88c75aed (patch)
treef10236bf9bdf3e127e73e876f61b88ee1155a4e1
parentc8a135ad09d7cd758ed61e8c010dcde8580e6c2a (diff)
downloadmaria-71a1badaa074df9ccb3b93910a556c9e88c75aed.tar.gz
style
-rw-r--r--data.js1198
-rw-r--r--play.css63
-rw-r--r--play.html1
-rw-r--r--play.js880
-rw-r--r--rules.js7
-rw-r--r--tools/layout.svg104
-rw-r--r--tools/parse-layout.js12
7 files changed, 1551 insertions, 714 deletions
diff --git a/data.js b/data.js
index 548a938..f6e8426 100644
--- a/data.js
+++ b/data.js
@@ -1,21 +1,21 @@
const data = {
type: {
- major_fortress: [ 28, 70, 78, 131, 197, 210, 238, 255, 271, 405, 429, 471, 516, 547, 578 ],
+ major_fortress: [ 28, 70, 78, 131, 197, 332, 360, 377, 393, 405, 429, 471, 516, 547, 578 ],
minor_fortress: [
1, 6, 8, 11, 14, 17, 39, 50, 51, 52, 67, 72, 76, 97, 106, 118, 121, 138, 139, 144, 156, 160, 178, 188, 194, 196,
- 200, 203, 206, 221, 223, 226, 227, 229, 236, 243, 245, 250, 254, 269, 277, 290, 291, 347, 360, 406, 407, 414, 433,
+ 208, 209, 265, 278, 322, 325, 328, 343, 345, 348, 349, 351, 358, 365, 367, 372, 376, 391, 399, 406, 407, 414, 433,
473, 483, 492, 494, 497, 514, 540, 561, 563, 579, 581, 592, 598, 601, 605,
],
- box: [ 60, 242, 619, 620 ],
+ box: [ 60, 364, 619, 620 ],
},
suit: {
clubs: [
[ 0, 3 ],
[ 21, 51 ],
[ 169, 176 ],
- [ 200, 217 ],
- [ 282, 298 ],
- [ 366, 367 ],
+ [ 200, 216 ],
+ [ 284, 285 ],
+ [ 322, 339 ],
[ 404, 419 ],
[ 434, 434 ],
[ 468, 488 ],
@@ -26,9 +26,9 @@ const data = {
[ 4, 9 ],
[ 52, 97 ],
[ 177, 187 ],
- [ 218, 230 ],
- [ 299, 322 ],
- [ 368, 381 ],
+ [ 217, 240 ],
+ [ 286, 299 ],
+ [ 340, 352 ],
[ 435, 454 ],
[ 489, 508 ],
[ 536, 545 ],
@@ -39,9 +39,9 @@ const data = {
[ 10, 18 ],
[ 98, 134 ],
[ 188, 189 ],
- [ 231, 254 ],
- [ 323, 348 ],
- [ 382, 385 ],
+ [ 241, 266 ],
+ [ 300, 303 ],
+ [ 353, 376 ],
[ 420, 433 ],
[ 455, 466 ],
[ 509, 509 ],
@@ -53,9 +53,9 @@ const data = {
[ 19, 20 ],
[ 135, 168 ],
[ 190, 199 ],
- [ 255, 281 ],
- [ 349, 365 ],
- [ 386, 403 ],
+ [ 267, 283 ],
+ [ 304, 321 ],
+ [ 377, 403 ],
[ 467, 467 ],
[ 510, 526 ],
[ 563, 577 ],
@@ -65,12 +65,12 @@ const data = {
map: {
Flanders: [
[ 0, 20 ],
- [ 200, 365 ],
- [ 404, 433 ],
+ [ 200, 283 ],
+ [ 322, 433 ],
],
Bohemia: [
[ 21, 199 ],
- [ 366, 403 ],
+ [ 284, 321 ],
[ 434, 618 ],
],
UNKNOWN: [ [ 619, 620 ] ],
@@ -78,13 +78,13 @@ const data = {
country: {
Austria: [ [ 0, 168 ] ],
Bavaria: [ [ 169, 199 ] ],
- France: [ [ 200, 281 ] ],
+ France: [ [ 322, 403 ] ],
Netherlands: [ [ 404, 433 ] ],
Poland: [ [ 434, 467 ] ],
Prussia: [ [ 468, 526 ] ],
Saxony: [ [ 527, 577 ] ],
Silesia: [ [ 578, 618 ] ],
- HRE: [ [ 282, 403 ] ],
+ Empire: [ [ 200, 321 ] ],
UNKNOWN: [ [ 619, 620 ] ],
},
cities: {
@@ -289,88 +289,6 @@ const data = {
"München",
"Pfaffenhofen",
"Schrobenhausen",
- "Belfort",
- "Châlons-en-Champ.",
- "Château-Thierry",
- "Colmar",
- "Créspy-en-V.",
- "Epernay",
- "Meaux",
- "Montbeliard",
- "Mulhouse",
- "Provins",
- "Reims",
- "Rethel",
- "Romilly s. S.",
- "Sezianne",
- "Soissons",
- "Valdahon",
- "Valmy",
- "Vesoul",
- "Bar-s.-Aube",
- "Bouillon",
- "Chaource",
- "Chaumont",
- "Châtillon s. S.",
- "Haguenau",
- "Langres",
- "Sens",
- "St. Dizier",
- "Strasbourg",
- "Tonnere",
- "Troyes",
- "Vitry",
- "Armientières",
- "Autun",
- "Avallon",
- "Beaumont",
- "Beaune",
- "Besançon",
- "Calais",
- "Dijon",
- "Dole",
- "Dunkerque",
- "Gray",
- "Italy",
- "Lille",
- "Longuyon",
- "Metz",
- "Montbard",
- "Montmédy",
- "Omans",
- "Perne",
- "Sedan",
- "St. Avold",
- "St. Omer",
- "Thionville",
- "Verdun",
- "Amiens",
- "Arras",
- "Bar-le-Duc",
- "Cambrai",
- "Charleville-Mézieres",
- "Compiègne",
- "Douai",
- "Doullens",
- "Epinal",
- "Guise",
- "Jussey",
- "Laon",
- "Lens",
- "Lunéville",
- "Maubeuge",
- "Mondidier",
- "Nancy",
- "Noyon",
- "Péronne",
- "Sarrebourg",
- "Sarreguemines",
- "St. Die",
- "St. Quentin",
- "Toul",
- "Valenciennes",
- "Vervins",
- "Vittel",
"Aschaffenburg",
"Bingen",
"Cochem",
@@ -493,6 +411,88 @@ const data = {
"Saalfeld",
"Sonneberg",
"Weimar",
+ "Belfort",
+ "Châlons-en-Champ.",
+ "Château-Thierry",
+ "Colmar",
+ "Créspy-en-V.",
+ "Epernay",
+ "Meaux",
+ "Montbeliard",
+ "Mulhouse",
+ "Provins",
+ "Reims",
+ "Rethel",
+ "Romilly s. S.",
+ "Sezianne",
+ "Soissons",
+ "Valdahon",
+ "Valmy",
+ "Vesoul",
+ "Bar-s.-Aube",
+ "Bouillon",
+ "Chaource",
+ "Chaumont",
+ "Châtillon s. S.",
+ "Haguenau",
+ "Langres",
+ "Sens",
+ "St. Dizier",
+ "Strasbourg",
+ "Tonnere",
+ "Troyes",
+ "Vitry",
+ "Armientières",
+ "Autun",
+ "Avallon",
+ "Beaumont",
+ "Beaune",
+ "Besançon",
+ "Calais",
+ "Dijon",
+ "Dole",
+ "Dunkerque",
+ "Gray",
+ "Italy",
+ "Lille",
+ "Longuyon",
+ "Metz",
+ "Montbard",
+ "Montmédy",
+ "Omans",
+ "Perne",
+ "Sedan",
+ "St. Avold",
+ "St. Omer",
+ "Thionville",
+ "Verdun",
+ "Amiens",
+ "Arras",
+ "Bar-le-Duc",
+ "Cambrai",
+ "Charleville-Mézieres",
+ "Compiègne",
+ "Douai",
+ "Doullens",
+ "Epinal",
+ "Guise",
+ "Jussey",
+ "Laon",
+ "Lens",
+ "Lunéville",
+ "Maubeuge",
+ "Mondidier",
+ "Nancy",
+ "Noyon",
+ "Péronne",
+ "Sarrebourg",
+ "Sarreguemines",
+ "St. Die",
+ "St. Quentin",
+ "Toul",
+ "Valenciennes",
+ "Vervins",
+ "Vittel",
"Alkmaar",
"Amsterdam",
"Bergen",
@@ -912,6 +912,128 @@ const data = {
"Bavaria",
"Bavaria",
"Bavaria",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
+ "Empire",
"France",
"France",
"France",
@@ -994,128 +1116,6 @@ const data = {
"France",
"France",
"France",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
- "HRE",
"Netherlands",
"Netherlands",
"Netherlands",
@@ -1345,27 +1345,27 @@ const data = {
1696, 1849, 1282, 1786, 1783, 2188, 2240, 1686, 1854, 2379, 1764, 2411, 1621, 1797, 2320, 1625, 2302, 1796, 2247,
1861, 2395, 1853, 1623, 1664, 1678, 2383, 2279, 1677, 2237, 1834, 2226, 1718, 1692, 1415, 1343, 1344, 1367, 1428,
1435, 1357, 1335, 1207, 1073, 1100, 1146, 1255, 1276, 1149, 1194, 1218, 1274, 1157, 1379, 1331, 1171, 1127, 1276,
- 1223, 1161, 1215, 1276, 1184, 1203, 1083, 510, 254, 152, 595, 72, 212, 77, 451, 576, 78, 245, 289, 117, 160, 145,
- 406, 323, 381, 235, 422, 131, 276, 184, 744, 301, 71, 323, 697, 95, 142, 270, 154, 75, 75, 375, 145, 318, 72, 201,
- 238, 147, 288, 215, 195, 466, 514, 136, 421, 318, 78, 384, 578, 80, 549, 389, 79, 139, 382, 182, 322, 69, 193, 71,
- 483, 229, 388, 193, 141, 542, 290, 74, 482, 121, 136, 606, 636, 567, 180, 425, 237, 259, 408, 961, 794, 750, 896,
- 928, 720, 776, 639, 862, 878, 961, 644, 949, 845, 709, 837, 703, 642, 784, 893, 378, 549, 429, 956, 936, 947, 834,
- 793, 533, 590, 578, 719, 728, 625, 906, 625, 848, 882, 516, 845, 759, 959, 949, 813, 860, 873, 932, 807, 705, 703,
- 912, 704, 724, 939, 931, 912, 877, 931, 833, 908, 779, 643, 613, 739, 960, 634, 766, 803, 854, 765, 764, 709, 690,
- 858, 861, 935, 707, 795, 730, 891, 941, 907, 802, 955, 1500, 1487, 1053, 1129, 1174, 1255, 1041, 1046, 1123, 1228,
- 1226, 1052, 1108, 1090, 1045, 1258, 1378, 1428, 1422, 1444, 1267, 1044, 1047, 1059, 1041, 1092, 1049, 1223, 1252,
- 1207, 1169, 1118, 1183, 1259, 1095, 1096, 1050, 1115, 592, 596, 467, 540, 473, 559, 596, 539, 633, 514, 637, 521,
- 382, 570, 599, 647, 813, 695, 700, 903, 935, 756, 801, 878, 831, 861, 730, 713, 769, 766, 2144, 2380, 2417, 2239,
- 2197, 2296, 2385, 1844, 2234, 2406, 1859, 1859, 2218, 2192, 2316, 1812, 2267, 2318, 2353, 2366, 2335, 2093, 1938,
- 2138, 1997, 2005, 2020, 2041, 2068, 1979, 1918, 1911, 1945, 2430, 1552, 1477, 1561, 1445, 1490, 1336, 1514, 1337,
- 1561, 1555, 1499, 1413, 1340, 1418, 1395, 1562, 1390, 1450, 1361, 1393, 1450, 1730, 1691, 1168, 1646, 1762, 1062,
- 1219, 1758, 1652, 1712, 1636, 1666, 1711, 1770, 1617, 1671, 1145, 1790, 1742, 1816, 1405, 1226, 1158, 1275, 1119,
- 1215, 1277, 1175, 1060, 1103, 1241, 1291, 1086, 1197, 1044, 1201, 1231, 1148, 1336, 1351, 1469, 1494, 1407, 1414,
- 1414, 1556, 1336, 1092, 1121, 1281, 1281, 1276, 1212, 1185, 1151, 1094, 1729, 1452, 1510, 1444, 1409, 1502, 1336,
- 1513, 1406, 1496, 1550, 1453, 1354, 1564, 1400, 1551, 1352, 1334, 1641, 1288, 1623, 1681, 1694, 1728, 1616, 1782,
- 1680, 1779, 1269, 1760, 1619, 1687, 1286, 2075, 1925, 1988, 1923, 2122, 2041, 2134, 2137, 1994, 1992, 2082, 1930,
- 2066, 1990, 2190, 2259, 2336, 2205, 2287, 2069, 2036, 2137, 2047, 2131, 2022, 1932, 2351, 2262, 2327, 2286, 1845,
- 1853, 2405, 1849, 2246, 1759, 2294, 2357, 1855, 2404, 2190, 1876, 935,
+ 1223, 1161, 1215, 1276, 1184, 1203, 1083, 961, 794, 750, 896, 928, 720, 776, 639, 862, 878, 961, 644, 949, 845,
+ 709, 837, 703, 642, 784, 893, 378, 549, 429, 956, 936, 947, 834, 793, 533, 590, 578, 719, 728, 625, 906, 625, 848,
+ 882, 516, 845, 759, 959, 949, 813, 860, 873, 932, 807, 705, 703, 912, 704, 724, 939, 931, 912, 877, 931, 833, 908,
+ 779, 643, 613, 739, 960, 634, 766, 803, 854, 765, 764, 709, 690, 858, 861, 935, 707, 795, 730, 891, 941, 907, 802,
+ 955, 1500, 1487, 1053, 1129, 1174, 1255, 1041, 1046, 1123, 1228, 1226, 1052, 1108, 1090, 1045, 1258, 1378, 1428,
+ 1422, 1444, 1267, 1044, 1047, 1059, 1041, 1092, 1049, 1223, 1252, 1207, 1169, 1118, 1183, 1259, 1095, 1096, 1050,
+ 1115, 510, 254, 152, 595, 72, 212, 77, 451, 576, 78, 245, 289, 117, 160, 145, 406, 323, 381, 235, 422, 131, 276,
+ 184, 744, 301, 71, 323, 697, 95, 142, 270, 154, 75, 75, 375, 145, 318, 72, 201, 238, 147, 288, 215, 195, 466, 514,
+ 136, 421, 318, 78, 384, 578, 80, 549, 389, 79, 139, 382, 182, 322, 69, 193, 71, 483, 229, 388, 193, 141, 542, 290,
+ 74, 482, 121, 136, 606, 636, 567, 180, 425, 237, 259, 408, 592, 596, 467, 540, 473, 559, 596, 539, 633, 514, 637,
+ 521, 382, 570, 599, 647, 813, 695, 700, 903, 935, 756, 801, 878, 831, 861, 730, 713, 769, 766, 2144, 2380, 2417,
+ 2239, 2197, 2296, 2385, 1844, 2234, 2406, 1859, 1859, 2218, 2192, 2316, 1812, 2267, 2318, 2353, 2366, 2335, 2093,
+ 1938, 2138, 1997, 2005, 2020, 2041, 2068, 1979, 1918, 1911, 1945, 2430, 1552, 1477, 1561, 1445, 1490, 1336, 1514,
+ 1337, 1561, 1555, 1499, 1413, 1340, 1418, 1395, 1562, 1390, 1450, 1361, 1393, 1450, 1730, 1691, 1168, 1646, 1762,
+ 1062, 1219, 1758, 1652, 1712, 1636, 1666, 1711, 1770, 1617, 1671, 1145, 1790, 1742, 1816, 1405, 1226, 1158, 1275,
+ 1119, 1215, 1277, 1175, 1060, 1103, 1241, 1291, 1086, 1197, 1044, 1201, 1231, 1148, 1336, 1351, 1469, 1494, 1407,
+ 1414, 1414, 1556, 1336, 1092, 1121, 1281, 1281, 1276, 1212, 1185, 1151, 1094, 1729, 1452, 1510, 1444, 1409, 1502,
+ 1336, 1513, 1406, 1496, 1550, 1453, 1354, 1564, 1400, 1551, 1352, 1334, 1641, 1288, 1623, 1681, 1694, 1728, 1616,
+ 1782, 1680, 1779, 1269, 1760, 1619, 1687, 1286, 2075, 1925, 1988, 1923, 2122, 2041, 2134, 2137, 1994, 1992, 2082,
+ 1930, 2066, 1990, 2190, 2259, 2336, 2205, 2287, 2069, 2036, 2137, 2047, 2131, 2022, 1932, 2351, 2262, 2327, 2286,
+ 1845, 1853, 2405, 1849, 2246, 1759, 2294, 2357, 1855, 2404, 2190, 1875, 935,
],
y: [
528, 587, 573, 563, 832, 641, 705, 662, 803, 719, 909, 474, 491, 538, 941, 479, 532, 582, 887, 647, 691, 1268,
@@ -1378,50 +1378,50 @@ const data = {
1479, 1038, 1168, 1596, 1326, 1520, 1468, 1310, 1001, 848, 980, 1196, 1408, 1234, 1092, 947, 1393, 1043, 843,
1137, 1573, 832, 906, 1268, 1087, 961, 1190, 1138, 1236, 1307, 1270, 1140, 1184, 1340, 1045, 1393, 1473, 1095,
1425, 1040, 1383, 959, 1470, 926, 1452, 1086, 1421, 1137, 1312, 1187, 1294, 1198, 1169, 1260, 1331, 1246, 1257,
- 1433, 1067, 973, 1388, 908, 1025, 993, 1469, 1449, 1059, 938, 894, 1086, 1043, 892, 1538, 1054, 1403, 1205, 847,
- 1235, 1273, 1292, 1187, 1331, 1160, 1186, 1246, 1304, 1173, 1142, 539, 1496, 1390, 957, 1500, 1499, 475, 1419,
- 1515, 474, 1407, 1577, 588, 990, 1078, 1387, 957, 1580, 593, 896, 1098, 536, 1020, 1033, 731, 686, 1142, 707, 840,
- 840, 649, 659, 1299, 781, 1331, 845, 642, 1208, 738, 791, 1156, 814, 755, 1226, 1140, 1299, 778, 1168, 663, 831,
- 1248, 979, 950, 895, 1013, 943, 1007, 1071, 1493, 960, 1077, 1061, 1437, 901, 906, 942, 1028, 1087, 685, 1248,
- 1196, 750, 642, 782, 1284, 1136, 1213, 1195, 1136, 718, 667, 771, 1302, 1134, 833, 1335, 644, 1144, 1261, 675,
- 1330, 1340, 545, 1441, 465, 490, 575, 1397, 588, 1387, 547, 594, 491, 594, 391, 332, 504, 1461, 1498, 1418, 440,
- 1390, 1072, 1038, 1476, 458, 984, 556, 666, 772, 775, 641, 776, 847, 701, 642, 644, 679, 839, 722, 838, 715, 768,
- 718, 831, 1177, 1223, 924, 951, 429, 406, 996, 1473, 898, 435, 884, 1039, 1536, 447, 1091, 973, 1508, 1498, 1440,
- 1540, 648, 710, 1303, 847, 1182, 1156, 646, 694, 751, 827, 698, 848, 791, 1136, 724, 771, 800, 654, 232, 312, 446,
- 461, 346, 416, 535, 289, 497, 327, 446, 384, 478, 501, 390, 578, 355, 346, 405, 237, 171, 397, 156, 295, 402, 191,
- 213, 174, 262, 316, 395, 320, 496, 378, 268, 285, 581, 131, 469, 436, 177, 237, 427, 351, 430, 202, 325, 354, 538,
- 402, 479, 336, 232, 286, 280, 322, 213, 353, 248, 175, 281, 155, 331, 645, 113, 349, 336, 209, 184, 259, 152, 141,
- 176, 273, 275, 330, 75, 145, 246, 65, 188, 57, 347, 71, 297, 76, 237, 525, 277, 122, 398, 506, 335, 196, 147, 141,
- 64, 277, 276, 229, 103, 396, 81, 218, 311, 392, 297, 153, 282, 260, 119, 121, 300, 250, 340, 63, 214, 168, 356,
- 320, 192, 230, 104, 770, 721, 653, 689, 637, 693, 745, 642, 646, 582, 484, 480, 591, 543, 556, 600, 562, 527, 636,
- 420, 581, 523, 492, 455, 589, 528, 449, 411, 393, 569, 549, 591, 559, 486, 486, 417, 589, 354, 426, 436, 394, 585,
- 533, 570, 479, 533, 795, 430, 474, 541, 729, 528, 408, 394, 502, 436, 471, 499, 564, 588, 441, 593, 571, 435, 519,
- 591, 539, 596, 536, 576, 655, 703, 644, 757, 685, 642, 641, 651, 733, 703, 674, 404, 579, 725, 525, 643, 474, 778,
- 780, 456, 774, 705, 80, 109,
+ 979, 950, 895, 1013, 943, 1007, 1071, 1493, 960, 1077, 1061, 1437, 901, 906, 942, 1028, 1087, 685, 1248, 1196,
+ 750, 642, 782, 1284, 1136, 1213, 1195, 1136, 718, 667, 771, 1302, 1134, 833, 1335, 644, 1144, 1261, 675, 1330,
+ 1340, 545, 1441, 465, 490, 575, 1397, 588, 1387, 547, 594, 491, 594, 391, 332, 504, 1461, 1498, 1418, 440, 1390,
+ 1072, 1038, 1476, 458, 984, 556, 666, 772, 775, 641, 776, 847, 701, 642, 644, 679, 839, 722, 838, 715, 768, 718,
+ 831, 1177, 1223, 924, 951, 429, 406, 996, 1473, 898, 435, 884, 1039, 1536, 447, 1091, 973, 1508, 1498, 1440, 1540,
+ 648, 710, 1303, 847, 1182, 1156, 646, 694, 751, 827, 698, 848, 791, 1136, 724, 771, 800, 654, 1433, 1067, 973,
+ 1388, 908, 1025, 993, 1469, 1449, 1059, 938, 894, 1086, 1043, 892, 1538, 1054, 1403, 1205, 847, 1235, 1273, 1292,
+ 1187, 1331, 1160, 1186, 1246, 1304, 1173, 1142, 539, 1496, 1390, 957, 1500, 1499, 475, 1419, 1515, 474, 1407,
+ 1577, 588, 990, 1078, 1387, 957, 1580, 593, 896, 1098, 536, 1020, 1033, 731, 686, 1142, 707, 840, 840, 649, 659,
+ 1299, 781, 1331, 845, 642, 1208, 738, 791, 1156, 814, 755, 1226, 1140, 1299, 778, 1168, 663, 831, 1248, 232, 312,
+ 446, 461, 346, 416, 535, 289, 497, 327, 446, 384, 478, 501, 390, 578, 355, 346, 405, 237, 171, 397, 156, 295, 402,
+ 191, 213, 174, 262, 316, 395, 320, 496, 378, 268, 285, 581, 131, 469, 436, 177, 237, 427, 351, 430, 202, 325, 354,
+ 538, 402, 479, 336, 232, 286, 280, 322, 213, 353, 248, 175, 281, 155, 331, 645, 113, 349, 336, 209, 184, 259, 152,
+ 141, 176, 273, 275, 330, 75, 145, 246, 65, 188, 57, 347, 71, 297, 76, 237, 525, 277, 122, 398, 506, 335, 196, 147,
+ 141, 64, 277, 276, 229, 103, 396, 81, 218, 311, 392, 297, 153, 282, 260, 119, 121, 300, 250, 340, 63, 214, 168,
+ 356, 320, 192, 230, 104, 770, 721, 653, 689, 637, 693, 745, 642, 646, 582, 484, 480, 591, 543, 556, 600, 562, 527,
+ 636, 420, 581, 523, 492, 455, 589, 528, 449, 411, 393, 569, 549, 591, 559, 486, 486, 417, 589, 354, 426, 436, 394,
+ 585, 533, 570, 479, 533, 795, 430, 474, 541, 729, 528, 408, 394, 502, 436, 471, 499, 564, 588, 441, 593, 571, 435,
+ 519, 591, 539, 596, 536, 576, 655, 703, 644, 757, 685, 642, 641, 651, 733, 703, 674, 404, 579, 725, 525, 643, 474,
+ 778, 780, 456, 774, 705, 80, 109,
],
main_roads: [
[],
[ 3, 7, 19 ],
[ 407, 3 ],
[ 2, 1 ],
- [ 18, 312 ],
+ [ 18, 230 ],
[],
- [ 302, 304, 310 ],
- [ 1, 302 ],
+ [ 220, 222, 228 ],
+ [ 1, 220 ],
[],
- [ 310, 299, 312 ],
+ [ 228, 217, 230 ],
[],
[],
[],
[],
- [ 253, 18 ],
+ [ 375, 18 ],
[],
[],
- [ 19, 243 ],
+ [ 19, 365 ],
[ 14, 4 ],
[ 1, 17 ],
[],
- [ 367, 70 ],
+ [ 285, 70 ],
[],
[],
[],
@@ -1538,7 +1538,7 @@ const data = {
[],
[ 168, 78 ],
[],
- [ 376, 111 ],
+ [ 294, 111 ],
[],
[],
[ 87, 164 ],
@@ -1573,12 +1573,12 @@ const data = {
[],
[ 196, 173 ],
[],
- [ 171, 367 ],
+ [ 171, 285 ],
[],
[],
[],
[],
- [ 388, 191 ],
+ [ 306, 191 ],
[],
[],
[],
@@ -1594,216 +1594,216 @@ const data = {
[ 178, 197 ],
[],
[ 197, 198, 196 ],
- [ 198, 391 ],
+ [ 198, 309 ],
[],
[ 193, 171 ],
[ 191, 193 ],
[ 193, 194 ],
[],
- [ 207, 208 ],
- [ 205, 230 ],
[],
[],
- [ 206, 260 ],
- [ 210, 201 ],
- [ 209, 204 ],
- [ 236, 200 ],
- [ 200, 293 ],
- [ 212, 206 ],
- [ 266, 211, 205 ],
- [ 210, 259 ],
- [ 229, 209 ],
[],
[],
[],
[],
+ [ 215, 232 ],
[],
- [ 226, 229, 222 ],
+ [ 213, 215 ],
+ [ 215, 224 ],
[],
+ [ 330, 248 ],
[],
+ [ 279, 208 ],
[],
- [ 218, 238 ],
+ [ 208, 209, 206 ],
+ [ 261, 232 ],
+ [ 9, 276 ],
+ [ 231, 226 ],
+ [ 226, 225 ],
+ [ 7, 6 ],
[],
- [ 281, 238 ],
+ [ 6, 381 ],
+ [ 237, 306 ],
+ [ 308, 209 ],
+ [ 219, 308 ],
+ [ 227, 218, 219, 237 ],
+ [ 232, 226 ],
+ [ 6, 9 ],
[],
- [ 230, 218, 257 ],
- [ 313, 274 ],
+ [ 4, 9 ],
+ [ 248, 349, 218 ],
+ [ 206, 216, 227 ],
[],
- [ 218, 212 ],
- [ 201, 226 ],
[],
[],
[],
+ [ 226, 223 ],
[],
[],
- [ 239, 248, 207 ],
[],
- [ 222, 239, 224 ],
- [ 238, 236 ],
[],
[],
[],
- [ 17, 267 ],
+ [ 428, 245 ],
+ [ 244, 247 ],
+ [ 258, 306 ],
+ [ 245, 270 ],
+ [ 211, 231 ],
[],
- [ 271, 251, 253 ],
[],
[],
- [ 236 ],
+ [ 270, 419 ],
[],
[],
- [ 245, 343 ],
[],
- [ 245, 14 ],
[],
[],
- [ 267, 273 ],
- [ 226, 278 ],
+ [ 263, 246 ],
[],
- [ 211, 304 ],
- [ 204, 272 ],
[],
+ [ 373, 216 ],
[],
+ [ 258 ],
[],
[],
[],
- [ 277, 210 ],
- [ 243, 256 ],
- [ 274, 271 ],
[],
[],
- [ 268, 245, 278, 281 ],
- [ 260, 277 ],
- [ 256, 277 ],
- [ 227, 268 ],
+ [ 278, 277 ],
+ [ 278, 252, 247 ],
[],
[],
- [ 273, 266, 272 ],
- [ 257, 271 ],
[],
[],
- [ 271, 224 ],
[],
+ [ 217, 278 ],
+ [ 269, 279 ],
+ [ 276, 270, 269 ],
+ [ 277, 213 ],
[],
[],
[],
[],
[],
- [ 297, 314 ],
+ [ 173, 21 ],
[],
- [ 295, 297 ],
- [ 297, 306 ],
+ [ 295, 294 ],
[],
- [ 208, 330 ],
[],
- [ 361, 290 ],
[],
- [ 290, 291, 288 ],
- [ 343, 314 ],
- [ 9, 358 ],
- [ 313, 308 ],
- [ 308, 307 ],
- [ 7, 6 ],
[],
- [ 6, 259 ],
- [ 319, 388 ],
- [ 390, 291 ],
- [ 301, 390 ],
- [ 309, 300, 301, 319 ],
- [ 314, 308 ],
- [ 6, 9 ],
[],
- [ 4, 9 ],
- [ 330, 227, 300 ],
- [ 288, 298, 309 ],
+ [ 495, 522 ],
+ [ 287, 138 ],
+ [ 298, 287 ],
[],
[],
+ [ 309, 295 ],
[],
[],
- [ 308, 305 ],
[],
[],
[],
[],
[],
+ [ 223, 246, 178 ],
[],
- [ 428, 327 ],
- [ 326, 329 ],
- [ 340, 388 ],
- [ 327, 352 ],
- [ 293, 313 ],
+ [ 225, 224, 309 ],
+ [ 308, 194, 298 ],
[],
[],
[],
- [ 352, 419 ],
[],
[],
[],
[],
[],
- [ 345, 328 ],
[],
[],
- [ 251, 298 ],
[],
- [ 340 ],
[],
+ [ 329, 330 ],
+ [ 327, 352 ],
[],
[],
+ [ 328, 382 ],
+ [ 332, 323 ],
+ [ 331, 326 ],
+ [ 358, 322 ],
+ [ 322, 211 ],
+ [ 334, 328 ],
+ [ 388, 333, 327 ],
+ [ 332, 381 ],
+ [ 351, 331 ],
[],
[],
- [ 360, 359 ],
- [ 360, 334, 329 ],
[],
[],
[],
+ [ 348, 351, 344 ],
[],
[],
- [ 299, 360 ],
- [ 351, 361 ],
- [ 358, 352, 351 ],
- [ 359, 295 ],
[],
+ [ 340, 360 ],
[],
+ [ 403, 360 ],
[],
+ [ 352, 340, 379 ],
+ [ 231, 396 ],
[],
+ [ 340, 334 ],
+ [ 323, 348 ],
[],
- [ 173, 21 ],
[],
- [ 377, 376 ],
[],
[],
[],
+ [ 361, 370, 329 ],
[],
+ [ 344, 361, 346 ],
+ [ 360, 358 ],
[],
- [ 495, 522 ],
- [ 369, 138 ],
- [ 380, 369 ],
[],
[],
- [ 391, 377 ],
+ [ 17, 389 ],
[],
+ [ 393, 373, 375 ],
[],
[],
+ [ 358 ],
[],
[],
+ [ 367, 261 ],
[],
+ [ 367, 14 ],
[],
- [ 305, 328, 178 ],
[],
- [ 307, 306, 391 ],
- [ 390, 194, 380 ],
+ [ 389, 395 ],
+ [ 348, 400 ],
[],
+ [ 333, 222 ],
+ [ 326, 394 ],
[],
[],
[],
[],
[],
+ [ 399, 332 ],
+ [ 365, 378 ],
+ [ 396, 393 ],
[],
[],
+ [ 390, 367, 400, 403 ],
+ [ 382, 399 ],
+ [ 378, 399 ],
+ [ 349, 390 ],
[],
[],
+ [ 395, 388, 394 ],
+ [ 379, 393 ],
[],
[],
+ [ 393, 346 ],
[],
[ 418, 413 ],
[],
@@ -1819,7 +1819,7 @@ const data = {
[],
[ 410, 407 ],
[ 421, 405, 409 ],
- [ 334, 410 ],
+ [ 252, 410 ],
[ 433, 428 ],
[ 433, 418 ],
[],
@@ -1828,7 +1828,7 @@ const data = {
[],
[],
[],
- [ 420, 326 ],
+ [ 420, 244 ],
[ 424, 432 ],
[],
[],
@@ -1895,7 +1895,7 @@ const data = {
[ 477, 496 ],
[ 498, 506, 489 ],
[ 518 ],
- [ 538, 375 ],
+ [ 538, 293 ],
[ 492, 501, 608 ],
[ 490, 498 ],
[ 497, 493 ],
@@ -1922,7 +1922,7 @@ const data = {
[],
[],
[],
- [ 375, 516 ],
+ [ 293, 516 ],
[],
[],
[],
@@ -2025,25 +2025,25 @@ const data = {
roads: [
[ 13, 3, 406 ],
[ 5 ],
- [ 303 ],
+ [ 221 ],
[ 0 ],
[ 8 ],
- [ 320, 1 ],
+ [ 238, 1 ],
[],
[],
- [ 219, 304, 4, 310 ],
+ [ 341, 222, 4, 228 ],
[],
- [ 14, 219 ],
+ [ 14, 341 ],
[ 15, 12 ],
[ 11, 13, 416 ],
[ 17, 12, 0 ],
- [ 244, 10, 347 ],
- [ 16, 11, 240 ],
- [ 243, 17, 15 ],
- [ 279, 16, 13 ],
- [ 315 ],
+ [ 366, 10, 265 ],
+ [ 16, 11, 362 ],
+ [ 365, 17, 15 ],
+ [ 401, 16, 13 ],
+ [ 233 ],
[ 20 ],
- [ 269, 19 ],
+ [ 391, 19 ],
[ 42 ],
[ 47, 69, 90 ],
[ 96, 110, 28 ],
@@ -2065,10 +2065,10 @@ const data = {
[ 25 ],
[ 79 ],
[ 31 ],
- [ 366, 21, 37 ],
+ [ 284, 21, 37 ],
[ 34, 124, 38 ],
[ 38, 78 ],
- [ 26, 367 ],
+ [ 26, 285 ],
[ 80 ],
[ 29, 22, 530 ],
[ 25 ],
@@ -2148,7 +2148,7 @@ const data = {
[ 119, 106, 118 ],
[ 151, 118 ],
[ 43, 118 ],
- [ 49, 384, 99 ],
+ [ 49, 302, 99 ],
[ 130, 101, 87 ],
[ 106, 120 ],
[ 35, 112 ],
@@ -2192,265 +2192,265 @@ const data = {
[ 121, 154 ],
[ 52, 140 ],
[],
- [ 367, 174, 175 ],
- [ 188, 175, 399 ],
+ [ 285, 174, 175 ],
+ [ 188, 175, 317 ],
[ 175 ],
[ 176, 26, 173 ],
[ 172 ],
[ 188, 169 ],
[ 169, 171, 170 ],
[ 181, 197, 172, 196 ],
- [ 399, 180, 184 ],
- [ 183, 373 ],
- [ 373, 187, 378 ],
- [ 177, 380, 190 ],
+ [ 317, 180, 184 ],
+ [ 183, 291 ],
+ [ 291, 187, 296 ],
+ [ 177, 298, 190 ],
[ 197, 185, 66, 189, 176 ],
- [ 105, 188, 381, 399 ],
+ [ 105, 188, 299, 317 ],
[ 178, 197, 187 ],
- [ 177, 381, 369 ],
+ [ 177, 299, 287 ],
[ 187, 181 ],
- [ 111, 381 ],
+ [ 111, 299 ],
[ 183, 179, 185 ],
[ 182, 106, 170, 174 ],
- [ 181, 26, 382, 384 ],
+ [ 181, 26, 300, 302 ],
[ 180, 195, 194 ],
[ 199 ],
- [ 196, 399 ],
+ [ 196, 317 ],
[],
[ 199, 190 ],
- [ 399, 190 ],
+ [ 317, 190 ],
[ 176, 192 ],
[ 183, 181, 176 ],
[],
- [ 388, 390, 194, 191 ],
- [ 217, 263 ],
- [ 216 ],
- [ 206, 205, 214 ],
- [ 208, 227 ],
+ [ 306, 308, 194, 191 ],
+ [ 204, 210 ],
+ [ 205, 208 ],
+ [ 272, 277, 214 ],
+ [ 204, 209 ],
+ [ 208, 203, 212, 200 ],
+ [ 261, 214, 201 ],
[],
- [ 213, 202 ],
- [ 202 ],
- [ 215 ],
- [ 203 ],
+ [ 211, 263 ],
+ [ 201, 204 ],
+ [ 203, 236 ],
+ [ 200, 224 ],
+ [ 207 ],
+ [ 204, 283 ],
[],
+ [ 265, 202, 205 ],
[],
- [ 234 ],
- [ 225, 213 ],
- [ 212, 205 ],
- [ 202, 266, 272 ],
- [ 248, 207 ],
- [ 201, 226, 234 ],
- [ 241, 236, 265, 200 ],
- [ 221 ],
- [ 10, 250, 8 ],
- [ 228, 222, 229, 225 ],
- [ 224, 218, 226 ],
- [ 220 ],
- [ 275, 227, 309 ],
- [ 221, 265 ],
- [ 220, 212 ],
- [ 221, 216 ],
- [ 203, 223 ],
- [ 233, 220 ],
- [ 220 ],
- [],
- [ 252, 267, 240 ],
- [ 235, 233 ],
- [ 246, 232, 228 ],
- [ 216, 211, 254, 250 ],
- [ 239, 232, 238 ],
- [ 217 ],
- [ 240, 252 ],
- [ 235, 246, 241 ],
- [ 235 ],
- [ 15, 231, 237 ],
- [ 238, 217 ],
[],
- [ 16 ],
- [ 254, 247, 14 ],
- [],
- [ 238, 233 ],
- [ 244, 250 ],
- [ 215 ],
- [ 262, 252 ],
- [ 259, 247, 234, 219 ],
- [ 275 ],
- [ 249, 231, 237 ],
- [],
- [ 257, 234, 244 ],
- [ 270, 273, 262 ],
- [ 261, 262 ],
- [ 254 ],
- [ 273, 269, 261 ],
- [ 280, 250 ],
- [],
- [ 258, 279, 256 ],
- [ 255, 256, 249 ],
- [ 200, 276, 265, 268 ],
- [ 277, 280 ],
- [ 224, 217, 263 ],
- [ 214 ],
- [ 231 ],
- [ 276, 263 ],
- [ 258, 280, 302, 20, 279 ],
- [ 272, 255 ],
- [],
- [ 214, 270 ],
- [ 255, 258 ],
- [ 275 ],
- [ 274, 223, 251 ],
- [ 263, 268 ],
- [ 264 ],
- [],
- [ 269, 261, 17 ],
- [ 264, 259, 269 ],
- [],
- [ 286, 292 ],
- [ 287, 290 ],
- [ 354, 359, 296 ],
- [ 286, 291 ],
- [ 290, 285, 294, 282 ],
- [ 343, 296, 283 ],
- [],
- [ 293, 345 ],
- [ 283, 286 ],
- [ 285, 318 ],
- [ 282, 306 ],
- [ 289 ],
- [ 286, 365 ],
- [],
- [ 347, 284, 287 ],
- [],
- [],
- [ 353, 317 ],
- [],
- [ 306 ],
- [ 269 ],
- [ 320, 2, 410 ],
+ [ 271, 235 ],
+ [],
+ [ 224 ],
+ [ 391 ],
+ [ 238, 2, 410 ],
[ 8 ],
- [ 307, 316 ],
- [ 292, 301 ],
- [ 305 ],
- [],
- [ 318, 223 ],
- [ 8, 311, 320 ],
- [ 310, 317 ],
- [ 315 ],
- [ 322 ],
- [],
- [ 347, 18, 312, 354, 353 ],
- [ 305, 321, 328 ],
- [ 311, 299, 419 ],
- [ 291, 309 ],
- [ 321 ],
- [ 310, 303, 5 ],
- [ 316, 319, 322 ],
- [ 321, 313, 342 ],
- [ 346, 332 ],
- [ 339, 328 ],
- [ 422, 348, 326 ],
- [ 325, 341, 337 ],
- [ 356 ],
- [ 324, 316 ],
- [ 348 ],
- [],
- [ 333, 334 ],
- [ 323, 356, 357 ],
- [ 414, 331, 348 ],
- [ 331 ],
- [ 336, 346, 341 ],
- [ 427, 335 ],
- [ 326, 346 ],
- [ 340, 339 ],
- [ 338, 324, 373 ],
- [ 342, 338 ],
- [ 335, 326 ],
- [ 322, 340 ],
- [ 344, 287 ],
- [ 343, 347 ],
- [ 289 ],
- [ 335, 337, 323 ],
- [ 344, 14, 296, 315 ],
- [ 329, 333, 325 ],
- [ 356, 360 ],
- [ 363, 351 ],
- [ 364, 350, 353 ],
- [],
- [ 315, 299, 351 ],
- [ 315, 284 ],
- [ 364, 362, 356 ],
- [ 327, 332, 349, 355 ],
- [ 332, 362 ],
- [],
- [ 284 ],
- [ 349 ],
- [ 365 ],
- [ 355, 357, 363 ],
- [ 362, 350, 365 ],
- [ 351, 355 ],
- [ 294, 361, 363 ],
- [ 367, 42 ],
- [ 45, 169, 366 ],
- [ 389, 374, 372 ],
- [ 184, 374 ],
- [ 537, 375 ],
+ [ 225, 234 ],
+ [ 210, 219 ],
+ [ 223 ],
+ [],
+ [ 236, 345 ],
+ [ 8, 229, 238 ],
+ [ 228, 235 ],
+ [ 233 ],
+ [ 240 ],
+ [],
+ [ 265, 18, 230, 272, 271 ],
+ [ 223, 239, 246 ],
+ [ 229, 217, 419 ],
+ [ 209, 227 ],
+ [ 239 ],
+ [ 228, 221, 5 ],
+ [ 234, 237, 240 ],
+ [ 239, 231, 260 ],
+ [ 264, 250 ],
+ [ 257, 246 ],
+ [ 422, 266, 244 ],
+ [ 243, 259, 255 ],
+ [ 274 ],
+ [ 242, 234 ],
+ [ 266 ],
+ [],
+ [ 251, 252 ],
+ [ 241, 274, 275 ],
+ [ 414, 249, 266 ],
+ [ 249 ],
+ [ 254, 264, 259 ],
+ [ 427, 253 ],
+ [ 244, 264 ],
+ [ 258, 257 ],
+ [ 256, 242, 291 ],
+ [ 260, 256 ],
+ [ 253, 244 ],
+ [ 240, 258 ],
+ [ 262, 205 ],
+ [ 261, 265 ],
+ [ 207 ],
+ [ 253, 255, 241 ],
+ [ 262, 14, 214, 233 ],
+ [ 247, 251, 243 ],
+ [ 274, 278 ],
+ [ 281, 269 ],
+ [ 282, 268, 271 ],
+ [],
+ [ 233, 217, 269 ],
+ [ 233, 202 ],
+ [ 282, 280, 274 ],
+ [ 245, 250, 267, 273 ],
+ [ 250, 280 ],
+ [],
+ [ 202 ],
+ [ 267 ],
+ [ 283 ],
+ [ 273, 275, 281 ],
+ [ 280, 268, 283 ],
+ [ 269, 273 ],
+ [ 212, 279, 281 ],
+ [ 285, 42 ],
+ [ 45, 169, 284 ],
+ [ 307, 292, 290 ],
+ [ 184, 292 ],
+ [ 537, 293 ],
[ 522, 512, 564, 538 ],
- [ 368, 377 ],
- [ 339, 178, 179, 378 ],
- [ 397, 395, 369, 368 ],
- [ 370 ],
- [ 395, 381 ],
- [ 372 ],
- [ 373, 179 ],
+ [ 286, 295 ],
+ [ 257, 178, 179, 296 ],
+ [ 315, 313, 287, 286 ],
+ [ 288 ],
+ [ 313, 299 ],
+ [ 290 ],
+ [ 291, 179 ],
[ 494, 537 ],
[ 180 ],
- [ 186, 182, 184, 376 ],
+ [ 186, 182, 184, 294 ],
[ 189 ],
- [ 384, 385 ],
- [ 189, 383, 125 ],
- [ 383 ],
- [ 539, 577, 393 ],
- [ 400, 392 ],
+ [ 302, 303 ],
+ [ 189, 301, 125 ],
+ [ 301 ],
+ [ 539, 577, 311 ],
+ [ 318, 310 ],
[ 199 ],
- [ 368, 397, 402 ],
+ [ 286, 315, 320 ],
[ 199 ],
[],
- [ 536, 387, 403 ],
- [ 542, 396, 394, 386 ],
- [ 573, 393 ],
- [ 374, 376, 573, 398 ],
- [ 400, 393, 403 ],
- [ 389, 374 ],
- [ 395, 401 ],
+ [ 536, 305, 321 ],
+ [ 542, 314, 312, 304 ],
+ [ 573, 311 ],
+ [ 292, 294, 573, 316 ],
+ [ 318, 311, 321 ],
+ [ 307, 292 ],
+ [ 313, 319 ],
[ 182, 177, 170, 192, 195 ],
- [ 401, 387, 396 ],
- [ 398, 402, 400 ],
- [ 401, 389 ],
- [ 542, 396, 392 ],
+ [ 319, 305, 314 ],
+ [ 316, 320, 318 ],
+ [ 319, 307 ],
+ [ 542, 314, 310 ],
+ [ 339, 385 ],
+ [ 338 ],
+ [ 328, 327, 336 ],
+ [ 330, 349 ],
+ [],
+ [ 335, 324 ],
+ [ 324 ],
+ [ 337 ],
+ [ 325 ],
+ [],
+ [],
+ [ 356 ],
+ [ 347, 335 ],
+ [ 334, 327 ],
+ [ 324, 388, 394 ],
+ [ 370, 329 ],
+ [ 323, 348, 356 ],
+ [ 363, 358, 387, 322 ],
+ [ 343 ],
+ [ 10, 372, 8 ],
+ [ 350, 344, 351, 347 ],
+ [ 346, 340, 348 ],
+ [ 342 ],
+ [ 397, 349, 227 ],
+ [ 343, 387 ],
+ [ 342, 334 ],
+ [ 343, 338 ],
+ [ 325, 345 ],
+ [ 355, 342 ],
+ [ 342 ],
+ [],
+ [ 374, 389, 362 ],
+ [ 357, 355 ],
+ [ 368, 354, 350 ],
+ [ 338, 333, 376, 372 ],
+ [ 361, 354, 360 ],
+ [ 339 ],
+ [ 362, 374 ],
+ [ 357, 368, 363 ],
+ [ 357 ],
+ [ 15, 353, 359 ],
+ [ 360, 339 ],
+ [],
+ [ 16 ],
+ [ 376, 369, 14 ],
+ [],
+ [ 360, 355 ],
+ [ 366, 372 ],
+ [ 337 ],
+ [ 384, 374 ],
+ [ 381, 369, 356, 341 ],
+ [ 397 ],
+ [ 371, 353, 359 ],
+ [],
+ [ 379, 356, 366 ],
+ [ 392, 395, 384 ],
+ [ 383, 384 ],
+ [ 376 ],
+ [ 395, 391, 383 ],
+ [ 402, 372 ],
+ [],
+ [ 380, 401, 378 ],
+ [ 377, 378, 371 ],
+ [ 322, 398, 387, 390 ],
+ [ 399, 402 ],
+ [ 346, 339, 385 ],
+ [ 336 ],
+ [ 353 ],
+ [ 398, 385 ],
+ [ 380, 402, 220, 20, 401 ],
+ [ 394, 377 ],
+ [],
+ [ 336, 392 ],
+ [ 377, 380 ],
+ [ 397 ],
+ [ 396, 345, 373 ],
+ [ 385, 390 ],
+ [ 386 ],
+ [],
+ [ 391, 383, 17 ],
+ [ 386, 381, 391 ],
+ [],
[ 411 ],
[ 411 ],
[ 407, 0, 416 ],
[ 406 ],
[],
[ 414 ],
- [ 303, 412 ],
+ [ 221, 412 ],
[ 405, 404 ],
[ 410, 414 ],
[],
- [ 412, 333, 409, 422 ],
+ [ 412, 251, 409, 422 ],
[],
[ 12, 406 ],
[],
[],
- [ 317 ],
+ [ 235 ],
[ 425, 427 ],
[ 422 ],
- [ 414, 421, 425, 325 ],
+ [ 414, 421, 425, 243 ],
[ 427, 429 ],
[],
[ 422, 420 ],
[ 429, 431 ],
- [ 432, 423, 420, 336 ],
+ [ 432, 423, 420, 254 ],
[],
[ 426, 423 ],
[ 431, 432 ],
@@ -2517,7 +2517,7 @@ const data = {
[ 544, 495 ],
[ 470, 503, 501 ],
[ 441 ],
- [ 379 ],
+ [ 297 ],
[ 540, 541, 491 ],
[],
[ 476, 499 ],
@@ -2535,7 +2535,7 @@ const data = {
[ 479, 546, 553 ],
[],
[ 521, 524 ],
- [ 525, 371 ],
+ [ 525, 289 ],
[ 524 ],
[ 524, 519 ],
[],
@@ -2545,7 +2545,7 @@ const data = {
[ 514, 526, 480 ],
[ 525, 484 ],
[ 517, 511, 526 ],
- [ 371, 505 ],
+ [ 289, 505 ],
[ 518, 517 ],
[ 513, 525, 511, 514 ],
[ 524, 512, 520 ],
@@ -2559,13 +2559,13 @@ const data = {
[ 532, 34 ],
[],
[ 539, 528 ],
- [ 542, 392, 543, 544 ],
- [ 544, 370, 505, 379 ],
- [ 562, 371 ],
- [ 535, 386, 540 ],
+ [ 542, 310, 543, 544 ],
+ [ 544, 288, 505, 297 ],
+ [ 562, 289 ],
+ [ 535, 304, 540 ],
[ 557, 551, 539, 541, 495 ],
[ 540, 495, 542, 543 ],
- [ 541, 393, 403, 536 ],
+ [ 541, 311, 321, 536 ],
[ 536, 541 ],
[ 536, 491, 537 ],
[ 568, 84, 55 ],
@@ -2587,7 +2587,7 @@ const data = {
[ 549 ],
[ 486, 553, 538 ],
[ 569, 576 ],
- [ 473, 371, 486 ],
+ [ 473, 289, 486 ],
[ 566, 575, 560 ],
[ 567, 565, 571 ],
[ 470, 574, 566 ],
@@ -2596,11 +2596,11 @@ const data = {
[ 568, 609 ],
[ 566, 576, 613 ],
[ 568, 611, 616 ],
- [ 138, 395, 394, 577 ],
+ [ 138, 313, 312, 577 ],
[ 608, 567 ],
[ 565, 569 ],
[ 563, 571 ],
- [ 573, 528, 386 ],
+ [ 573, 528, 304 ],
[ 584, 588, 591 ],
[ 466, 616, 580 ],
[ 461, 579 ],
diff --git a/play.css b/play.css
index a9195f8..125388a 100644
--- a/play.css
+++ b/play.css
@@ -148,7 +148,7 @@ header.your_turn.austria { background-color: var(--color-light-austria); }
#log { background-color: #f3ebd4 }
#log div:empty {
- min-height: 4px;
+ min-height: 6px;
}
#log .city_tip:hover { cursor: pointer; text-decoration: underline; }
@@ -193,49 +193,65 @@ span.suit.reserve { color: var(--color-reserve); font-weight: bold; font-family:
.space {
position: absolute;
- box-sizing: border-box;
border: 4px solid transparent;
- background-color: #0002;
}
.space.city {
- width: 24px;
- height: 24px;
+ width: calc(18px + 10px);
+ height: calc(18px + 10px);
border-radius: 50%;
}
.space.minor_fortress {
- width: 28px;
- height: 28px;
+ width: calc(28px + 10px);
+ height: calc(28px + 10px);
}
.space.major_fortress {
- width: 40px;
- height: 40px;
+ width: calc(32px + 12px);
+ height: calc(32px + 12px);
border-radius: 50%;
}
-.space.Austria { background-color: #fcffff; }
-.space.France { background-color: #ea192e; }
-.space.Prussia { background-color: #035783; }
-.space.Netherlands { background-color: #7d7c7a; }
-.space.Silesia { background-color: #91b4a0; }
-.space.Saxony { background-color: #127a3b; }
-.space.Bavaria { background-color: #fcb01f; }
-.space.Poland { background-color: #cac180; }
+.space.box {
+ width: 44px;
+ height: 44px;
+}
+
+.space.box.england {
+ width: 48px;
+ height: 56px;
+}
+
+/*
+.space.country_austria { background-color: #fcffff; }
+.space.country_france { background-color: #ea192e; }
+.space.country_prussia { background-color: #035783; }
+.space.country_netherlands { background-color: #7d7c7a; }
+.space.country_silesia { background-color: #91b4a0; }
+.space.country_saxony { background-color: #127a3b; }
+.space.country_bavaria { background-color: #fcb01f; }
+.space.country_poland { background-color: #cac180; }
.space.minor_fortress.Empire { background-color: #b41a70; }
.space.major_fortress.Empire { background-color: #b41a70; }
.space.city.Empire { background-color: #e0d796; }
+*/
+
+.space {
+ border-color: white;
+ box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black;
+}
.space.tip {
border-color: lime;
- z-index: 3000;
+ box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black;
+ z-index: 2000;
}
.space.action {
border-color: white;
- box-shadow: 0 0 2px black, inset 0 0 2px black;
+ box-shadow: 0 0 2px 1px black, inset 0 0 2px 1px black;
z-index: 2000;
}
@@ -410,6 +426,15 @@ span.suit.reserve { color: var(--color-reserve); font-weight: bold; font-family:
}
}
+.card.zoom {
+ width: 330px;
+ height: 514px;
+ border-radius: 16px;
+}
+
+.card.polcard { cursor: zoom-in }
+.card.polcard.zoom { cursor: zoom-out }
+
.draw-break { margin-left: 145px; }
.card.tc { margin-right: -145px; }
.panel_body { padding-right: calc(18px + 145px); }
diff --git a/play.html b/play.html
index 1e6d210..45aa939 100644
--- a/play.html
+++ b/play.html
@@ -28,6 +28,7 @@
<li><a target="_blank" href="/maria/info/cards.html">Political Cards</a>
</menu>
</details>
+ <button onclick="toggle_pieces()"><img src="/images/earth-africa-europe.svg"></button>
</div>
</header>
diff --git a/play.js b/play.js
index 76a8079..188af9b 100644
--- a/play.js
+++ b/play.js
@@ -1,77 +1,865 @@
+"use strict"
+
+// vim: set nowrap:
+/* globals data, view, action_button, action_button_with_argument, confirm_action_button, send_action, params
+*/
+
+function toggle_pieces() {
+ document.getElementById("pieces").classList.toggle("hide")
+}
+
+/* DATA */
+
+const P_FRANCE = 0
+const P_BAVARIA = 1
+const P_PRUSSIA = 2
+const P_SAXONY = 3
+const P_PRAGMATIC = 4
+const P_AUSTRIA = 5
+
const cities = data.cities
const last_city = cities.name.length - 1
+const ELIMINATED = data.cities.name.length
+const REMOVED = ELIMINATED + 1
+const ELIMINATED_TRAIN_X = 1065
+const ELIMINATED_TRAIN_Y = 210
+const ELIMINATED_DISC_X = 1365
+const ELIMINATED_DISC_Y = 210
+const ELIMINATED_GENERAL_X = 1040
+const ELIMINATED_GENERAL_Y = 160
+const ELIMINATED_GENERAL_DX = 50
+
+const power_class = [ "france", "bavaria", "prussia", "saxony", "pragmatic", "austria" ]
+const power_name = [ "France", "Bavaria", "Prussia", "Saxony", "Pragmatic", "Austria" ]
+
+const all_powers = [ 0, 1, 2, 3, 4, 5 ]
+
+let suit_class = [ "spades", "clubs", "hearts", "diamonds", "reserve" ]
+let suit_letter = [ "S", "C", "H", "D", "R" ]
+
+function to_deck(c) {
+ return c >> 7
+}
+
+function to_suit(c) {
+ return (c >> 4) & 7
+}
+
+function to_value(c) {
+ return c & 15
+}
+
+/* PANEL ORDER */
+
+const panel_order = [ P_FRANCE, P_BAVARIA, P_PRUSSIA, P_SAXONY, P_PRAGMATIC, P_AUSTRIA, P_AUSTRIA+1 ]
+const panel_start = {
+ "Observer": P_FRANCE,
+ "Louis XV": P_FRANCE,
+ "Frederick": P_PRUSSIA,
+ "Maria Theresa": P_AUSTRIA,
+}
+
+function remember_position(e) {
+ if (e.parentElement) {
+ let rect = e.getBoundingClientRect()
+ e.my_parent = e.parentElement
+ e.my_x = rect.x
+ e.my_y = rect.y
+ } else {
+ e.my_parent = null
+ e.my_x = 0
+ e.my_y = 0
+ }
+}
+
+function animate_position(e) {
+ if (e.parentElement) {
+ if (e.my_parent) {
+ let rect = e.getBoundingClientRect()
+ let dx = e.my_x - rect.x
+ let dy = e.my_y - rect.y
+ if (dx !== 0 || dy !== 0) {
+ e.animate(
+ [
+ { transform: `translate(${dx}px, ${dy}px)`, },
+ { transform: "translate(0, 0)", },
+ ],
+ { duration: 333, easing: "ease" }
+ )
+ }
+ }
+ }
+}
+
+function sort_power_panel(animate) {
+ let start = panel_start[params.role] | 0
+
+ if (animate)
+ for (let i = 0; i < 7; ++i)
+ remember_position(ui.power_panel[i])
+
+ ui.power_panel_list.replaceChildren()
+ for (let i = 0; i < 7; ++i) {
+ let p = panel_order[(i + start) % 7]
+ ui.power_panel_list.appendChild(ui.power_panel[p])
+ }
+
+ if (view && view.actions)
+ ui.power_panel_list.prepend(ui.power_panel[view.power])
+
+ if (animate)
+ for (let i = 0; i < 7; ++i)
+ animate_position(ui.power_panel[i])
+}
+
+/* BUILD UI */
+
const ui = {
- map_pieces: document.getElementById("pieces"),
+ prompt: document.getElementById("prompt"),
+ status: document.getElementById("status"),
+ header: document.querySelector("header"),
+ spaces_element: document.getElementById("spaces"),
+ pieces_element: document.getElementById("pieces"),
+ markers_element: document.getElementById("markers"),
+ political_display: document.getElementById("political_display"),
+ power_panel_list: document.getElementById("power_panel_list"),
+ power_header: [
+ document.getElementById("hand_france_header"),
+ document.getElementById("hand_bavaria_header"),
+ document.getElementById("hand_prussia_header"),
+ document.getElementById("hand_saxony_header"),
+ document.getElementById("hand_pragmatic_header"),
+ document.getElementById("hand_austria_header"),
+ document.getElementById("political_header"),
+ ],
+ power_panel: [
+ document.getElementById("hand_france_panel"),
+ document.getElementById("hand_bavaria_panel"),
+ document.getElementById("hand_prussia_panel"),
+ document.getElementById("hand_saxony_panel"),
+ document.getElementById("hand_pragmatic_panel"),
+ document.getElementById("hand_austria_panel"),
+ document.getElementById("political_panel"),
+ ],
+ hand: [
+ document.getElementById("hand_france"),
+ document.getElementById("hand_bavaria"),
+ document.getElementById("hand_prussia"),
+ document.getElementById("hand_saxony"),
+ document.getElementById("hand_pragmatic"),
+ document.getElementById("hand_austria"),
+ ],
cities: [],
- roads: [],
+ action_register: [],
+}
+
+function register_action(target, action, id) {
+ target.my_id = id
+ target.my_action = action
+ target.onmousedown = (evt) => on_click_action(evt, target)
+ ui.action_register.push(target)
+}
+
+function on_click_action(evt, target) {
+ if (evt.button === 0)
+ if (send_action(target.my_action, target.my_id))
+ evt.stopPropagation()
+}
+
+function process_actions() {
+ for (let target of ui.action_register)
+ target.classList.toggle("action", is_action(target.my_action, target.my_id))
}
-function make_road(type, x, y, dx, dy) {
+function is_action(action, arg) {
+ if (arg === undefined)
+ return !!(view.actions && view.actions[action] === 1)
+ return !!(view.actions && view.actions[action] && set_has(view.actions[action], arg))
+}
+
+function create_element(action, id, style) {
let e = document.createElement("div")
- e.className = type
- e.style.left = x + "px"
- e.style.top = y + "px"
- let a = Math.atan2(dy, dx)
- let s = (Math.hypot(dx, dy) - 15) / 20
- e.style.transform =
- "rotate(" + a + "rad)" +
- "scale(" + s + ", 1)"
- // TODO: rotate to align
- map_pieces.appendChild(e)
+ e.className = style
+ register_action(e, action, id)
+ return e
+}
+
+function create_piece(action, id, style) {
+ let e = document.createElement("div")
+ e.className = style
+ register_action(e, action, id)
+ e.onmouseenter = on_focus_piece
+ e.onmouseleave = on_blur_piece
+ return e
+}
+
+function create_marker(style) {
+ let e = document.createElement("div")
+ e.className = style
+ return e
+}
+
+function make_tc_deck(n) {
+ for (let suit = 0; suit <= 3; ++suit) {
+ for (let value = 2; value <= 10; ++value) {
+ let c = (n << 7) | (suit << 4) | value
+ ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + " " + suit_letter[suit] + value)
+ }
+ }
+ for (let value = 2; value <= 3; ++value) {
+ let c = (n << 7) | (4 << 4) | value
+ ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " reserve R")
+ }
+}
+
+function make_tc_deck_back(n) {
+ let list = []
+ for (let i = 0; i < 38; ++i) {
+ let e = document.createElement("div")
+ e.className = "card tc reverse " + n
+ list.push(e)
+ }
+ return list
+}
+
+function make_political_card(fc) {
+ let e = document.createElement("div")
+ if (fc === 0)
+ e.className = "card political reverse"
+ else
+ e.className = "card political c" + fc
+ return e
+}
+
+function has_removed_all_pieces(pow) {
+ for (let p of all_power_generals[pow])
+ if (view.pos[p] !== REMOVED)
+ return false
+ for (let p of all_power_trains[pow])
+ if (view.pos[p] !== REMOVED)
+ return false
+ return true
}
function on_init() {
- if (false) {
- for (let a = 0; a <= last_city; ++a) {
- for (let b of cities.major_roads[a]) {
- if (a < b) {
- let dx = cities.x[a] - cities.x[b]
- let dy = cities.y[a] - cities.y[b]
- let x = (cities.x[a] + cities.x[b]) / 2
- let y = (cities.y[a] + cities.y[b]) / 2
- make_road("major_road", x - 10, y - 3, dx, dy)
- }
- }
- for (let b of cities.roads[a]) {
- if (a < b) {
- let dx = cities.x[a] - cities.x[b]
- let dy = cities.y[a] - cities.y[b]
- let x = (cities.x[a] + cities.x[b]) / 2
- let y = (cities.y[a] + cities.y[b]) / 2
- make_road("road", x - 10, y - 1, dx, dy)
- }
+ ui.pieces = [
+ create_piece("piece", 0, "piece cylinder france_1"),
+ create_piece("piece", 1, "piece cylinder france_2"),
+ create_piece("piece", 2, "piece cylinder france_3"),
+ create_piece("piece", 3, "piece cylinder france_4"),
+ create_piece("piece", 4, "piece cylinder france_5"),
+ create_piece("piece", 5, "piece cylinder bavaria_1"),
+
+ create_piece("piece", 6, "piece cylinder prussia_1"),
+ create_piece("piece", 7, "piece cylinder prussia_2"),
+ create_piece("piece", 8, "piece cylinder prussia_3"),
+ create_piece("piece", 9, "piece cylinder prussia_4"),
+ create_piece("piece", 10, "piece cylinder saxony_1"),
+ create_piece("piece", 11, "piece cylinder pragmatic_1"),
+ create_piece("piece", 12, "piece cylinder pragmatic_2"),
+ create_piece("piece", 13, "piece cylinder pragmatic_3"),
+
+ create_piece("piece", 14, "piece cylinder austria_1"),
+ create_piece("piece", 15, "piece cylinder austria_2"),
+ create_piece("piece", 16, "piece cylinder austria_3"),
+ create_piece("piece", 17, "piece cylinder austria_4"),
+ create_piece("piece", 18, "piece cylinder austria_5"),
+ create_piece("piece", 19, "piece cylinder austria_6"),
+
+ create_piece("piece", 20, "piece cube france"),
+ create_piece("piece", 21, "piece cube france"),
+ create_piece("piece", 22, "piece cube bavaria"),
+
+ create_piece("piece", 23, "piece cube prussia"),
+ create_piece("piece", 24, "piece cube prussia"),
+ create_piece("piece", 25, "piece cube saxony"),
+ create_piece("piece", 26, "piece cube pragmatic"),
+
+ create_piece("piece", 27, "piece cube austria"),
+ create_piece("piece", 28, "piece cube austria"),
+ create_piece("piece", 29, "piece cube austria"),
+
+ create_piece("piece", 30, "piece disc austria"),
+ create_piece("piece", 31, "piece disc austria"),
+ ]
+
+ ui.troops = []
+ for (let i = 0; i < 20; ++i)
+ ui.troops[i] = create_marker("hide")
+ for (let e of ui.troops)
+ ui.pieces_element.appendChild(e)
+
+ /*
+ ui.conquest = []
+ ui.retro = []
+ for (let s of all_objectives) {
+ for (let pow = 0; pow < 7; ++pow) {
+ if (set_has(objective1[pow], s) || set_has(objective2[pow], s)) {
+ ui.conquest[s] = create_conquest("marker conquest " + power_class[pow], s)
+ ui.retro[s] = create_conquest("marker retroactive " + power_class[pow], s)
}
}
}
+ */
+
+ ui.tc = []
+ make_tc_deck(0)
+ make_tc_deck(1)
+ make_tc_deck(2)
+ make_tc_deck(3)
+
+ ui.tc_back = [
+ make_tc_deck_back("deck_1"),
+ make_tc_deck_back("deck_2"),
+ make_tc_deck_back("deck_3"),
+ make_tc_deck_back("deck_4"),
+ ]
+
+ ui.combat = document.createElement("div")
+ ui.combat.id = "combat"
+ ui.combat.style.zIndex = 2000
+
+ ui.tcbreak = document.createElement("div")
+ ui.tcbreak.className = "draw-break"
+
+ ui.political = []
+ for (let fc = 0; fc <= 18; ++fc)
+ ui.political[fc] = make_political_card(fc)
for (let a = 0; a <= last_city; ++a) {
let e = ui.cities[a] = document.createElement("div")
let x = cities.x[a]
let y = cities.y[a]
- if (data.type.major_fortress.includes(a)) {
- e.className = "major fortress " + cities.country[a]
- x -= 20
- y -= 20
+ if (set_has(data.type.major_fortress, a)) {
+ e.className = "space major_fortress"
+ x -= 16 + 6 + 4
+ y -= 16 + 6 + 4
+ }
+ else if (set_has(data.type.minor_fortress, a)) {
+ e.className = "space minor_fortress"
+ x -= 14 + 5 + 4
+ y -= 14 + 5 + 4
}
- else if (data.type.minor_fortress.includes(a)) {
- e.className = "minor fortress " + cities.country[a]
- x -= 14
- y -= 14
+ else if (set_has(data.type.box, a)) {
+ e.className = "space box"
+ if (data.cities.name[a] === "England") {
+ e.className = "space box england"
+ x -= 24 + 4
+ y -= 28 + 4
+ } else {
+ x -= 22 + 4
+ y -= 22 + 4
+ }
}
else {
- e.className = "city " + cities.country[a]
- x -= 12
- y -= 12
+ e.className = "space city"
+ x -= 9 + 5 + 4
+ y -= 9 + 5 + 4
}
- e.classList.add("hide")
+ if (set_has(data.country.Austria, a)) e.classList.add("country_austria")
+ if (set_has(data.country.France, a)) e.classList.add("country_france")
+ if (set_has(data.country.Prussia, a)) e.classList.add("country_prussia")
+ if (set_has(data.country.Netherlands, a)) e.classList.add("country_netherlands")
+ if (set_has(data.country.Silesia, a)) e.classList.add("country_silesia")
+ if (set_has(data.country.Saxony, a)) e.classList.add("country_saxony")
+ if (set_has(data.country.Bavaria, a)) e.classList.add("country_bavaria")
+ if (set_has(data.country.Poland, a)) e.classList.add("country_poland")
+ if (set_has(data.country.Empire, a)) e.classList.add("country_empire")
+
+ register_action(e, "space", a)
+
+ e.onmouseenter = on_focus_city
+ e.onmouseleave = on_blur_city
+
+ //e.classList.add("hide")
e.style.left = x + "px"
e.style.top = y + "px"
- e.title = cities.name[a]
- map_pieces.appendChild(e)
+
+ ui.spaces_element.appendChild(e)
}
+
+ sort_power_panel(false)
+
+ update_favicon()
}
on_init()
+
+/* TOOLTIPS */
+
+function on_click_city_tip(loc) {
+ ui.cities[loc].scrollIntoView({ block: "center", inline: "center", behavior: "smooth" })
+}
+
+function on_focus_city_tip(s) {
+ ui.cities[s].classList.add("tip")
+}
+
+function on_blur_city_tip(s) {
+ ui.cities[s].classList.remove("tip")
+}
+
+function on_click_piece_tip(loc) {
+ ui.pieces[loc].scrollIntoView({ block: "center", inline: "center", behavior: "smooth" })
+}
+
+function on_focus_piece_tip(s) {
+ ui.pieces[s].classList.add("tip")
+}
+
+function on_blur_piece_tip(s) {
+ ui.pieces[s].classList.remove("tip")
+}
+
+function on_focus_city(evt) {
+ ui.status.textContent = data.cities.name[evt.target.my_id]
+}
+
+function on_blur_city() {
+ ui.status.textContent = ""
+}
+
+function on_focus_piece(evt) {
+ ui.status.textContent = piece_tooltip_name[evt.target.my_id]
+}
+
+function on_blur_piece() {
+ ui.status.textContent = ""
+}
+
+/* UPDATE UI */
+
+function layout_general_offset(g, s) {
+ // if not selected: number of unselected generals below us
+ // if not selected: (number of unselected generals + 1) + number of selected generals below us
+ if (!set_has(view.selected, g)) {
+ let n = 0
+ for (let i = g+1; i < 20; ++i)
+ if (view.pos[i] === s && !set_has(view.selected, i))
+ ++n
+ return n
+ } else {
+ let n = 0
+ for (let i = 0; i < 20; ++i)
+ if (view.pos[i] === s && !set_has(view.selected, i))
+ ++n
+ if (n > 0)
+ ++n
+ for (let i = g+1; i < 20; ++i)
+ if (view.pos[i] === s && set_has(view.selected, i))
+ ++n
+ return n
+ }
+}
+
+function layout_general_offset_elim(g) {
+ let n = 0
+ let p = get_cylinder_power(g)
+ for (let i of all_power_generals[p])
+ if (i > g && view.pos[i] === ELIMINATED)
+ ++n
+ return n
+}
+
+function layout_train_offset(g, s) {
+ let n = 0
+ for (let i = g+1; i < 35; ++i)
+ if (view.pos[i] === s)
+ ++n
+ return n
+}
+
+function get_cylinder_power(id) {
+ for (let p of all_powers)
+ if (set_has(all_power_generals[p], id))
+ return p
+ return -1
+}
+
+function layout_general(id, s) {
+ let e = ui.pieces[id]
+ let x, y, n
+
+ if (s === REMOVED) {
+ if (e.parentElement === ui.pieces_element)
+ e.remove()
+ return
+ }
+ if (e.parentElement !== ui.pieces_element)
+ ui.pieces_element.appendChild(e)
+
+ if (s === ELIMINATED) {
+ n = layout_general_offset_elim(id)
+ x = ELIMINATED_GENERAL_X + ELIMINATED_GENERAL_DX * get_cylinder_power(id)
+ y = ELIMINATED_GENERAL_Y
+ } else {
+ n = layout_general_offset(id, s)
+ x = data.cities.x[s]
+ y = data.cities.y[s]
+ }
+
+ let selected = set_has(view.selected, id)
+
+ e.style.left = (x - 21) + "px"
+ e.style.top = (y - 29 - 15 * n) + "px"
+ e.style.zIndex = y + n
+ e.classList.toggle("selected", selected)
+ e.classList.toggle("oos", (view.oos & (1 <<id)) !== 0)
+
+ e = ui.troops[id]
+ // e.style.left = (x + 21 + 1) + "px"
+ // e.style.top = (y - 7 - 14 * n) + "px"
+ e.style.left = (x - 7) + "px"
+ // e.style.top = (y + 7 - 15 * n) + "px"
+ e.style.top = (y + 2 - 15 * n) + "px"
+ e.style.zIndex = y + n + 1
+ e.className = power_class[GENERAL_POWER[id]] + " piece number n" + view.troops[id]
+}
+
+function layout_train(id, s) {
+ let e = ui.pieces[id]
+ let n = layout_train_offset(id, s)
+ let x, y
+
+ if (s === REMOVED) {
+ if (e.parentElement === ui.pieces_element)
+ e.remove()
+ return
+ }
+ if (e.parentElement !== ui.pieces_element)
+ ui.pieces_element.appendChild(e)
+
+ if (s === ELIMINATED) {
+ x = ELIMINATED_TRAIN_X
+ y = ELIMINATED_TRAIN_Y
+ } else {
+ x = data.cities.x[s]
+ y = data.cities.y[s]
+ }
+
+ e.style.left = (x - 14 + n * 33) + "px"
+ e.style.top = (y - 21 - n * 0) + "px"
+ e.classList.toggle("selected", set_has(view.selected, id))
+}
+
+function layout_hussar(id, s) {
+ let e = ui.pieces[id]
+ let n = 0
+ let x, y
+
+ if (e.parentElement !== ui.pieces_element)
+ ui.pieces_element.appendChild(e)
+
+ if (s === ELIMINATED) {
+ x = ELIMINATED_DISC_X
+ y = ELIMINATED_DISC_Y
+ n = id - 30
+ } else {
+ x = data.cities.x[s]
+ y = data.cities.y[s]
+ }
+
+ e.style.left = (x - 14) + "px"
+ e.style.top = (y - 16 - n * 12) + "px"
+ e.classList.toggle("selected", set_has(view.selected, id))
+}
+
+function layout_combat_marker() {
+ let x = (data.cities.x[view.attacker] + data.cities.x[view.defender]) >> 1
+ let y = (data.cities.y[view.attacker] + data.cities.y[view.defender]) >> 1
+ ui.combat.style.left = x - 20 + "px"
+ ui.combat.style.top = y - 20 + "px"
+}
+
+function create_conquest(style, s) {
+ let x = data.cities.x[s]
+ let y = data.cities.y[s]
+ let e = document.createElement("div")
+ e.dataset.id = s
+ e.style.left = (x - 16) + "px"
+ e.style.top = (y - 16) + "px"
+ e.className = style
+ return e
+}
+
+function update_favicon() {
+ let favicon = document.querySelector('link[rel="icon"]')
+ switch (params.role) {
+ case "Frederick": favicon.href = "favicon/favicon_frederick.png"; break
+ case "Elisabeth": favicon.href = "favicon/favicon_elisabeth.png"; break
+ case "Maria Theresa": favicon.href = "favicon/favicon_maria_theresa.png"; break
+ case "Pompadour": favicon.href = "favicon/favicon_pompadour.png"; break
+ }
+}
+
+function cmp_tc(a, b) {
+ let ax = (to_suit(a) << 7) + (to_value(a) << 3) + to_deck(a)
+ let bx = (to_suit(b) << 7) + (to_value(b) << 3) + to_deck(b)
+ return ax - bx
+}
+
+const colorize_S = '<span class="suit spades">\u2660</span>'
+const colorize_C = '<span class="suit clubs">\u2663</span>'
+const colorize_H = '<span class="suit hearts">\u2665</span>'
+const colorize_D = '<span class="suit diamonds">\u2666</span>'
+const colorize_R = '$1<span class="suit reserve">R</span>'
+
+const suit_text = [
+ '<span class="suit spades">\u2660</span>',
+ '<span class="suit clubs">\u2663</span>',
+ '<span class="suit hearts">\u2665</span>',
+ '<span class="suit diamonds">\u2666</span>',
+ '<span class="suit reserve">R</span>'
+]
+
+function colorize(text) {
+ text = text.replaceAll("\u2660", colorize_S)
+ text = text.replaceAll("\u2663", colorize_C)
+ text = text.replaceAll("\u2665", colorize_H)
+ text = text.replaceAll("\u2666", colorize_D)
+ text = text.replace(/(\d+)R/g, colorize_R)
+ return text
+}
+
+function on_update() {
+// let text = colorize(view.prompt)
+// if (text !== view.prompt)
+// ui.prompt.innerHTML = text
+
+ ui.header.classList.toggle("france", view.power === P_FRANCE)
+ ui.header.classList.toggle("bavaria", view.power === P_BAVARIA)
+ ui.header.classList.toggle("prussia", view.power === P_PRUSSIA)
+ ui.header.classList.toggle("saxony", view.power === P_SAXONY)
+ ui.header.classList.toggle("pragmatic", view.power === P_PRAGMATIC)
+ ui.header.classList.toggle("austira", view.power === P_AUSTRIA)
+
+ sort_power_panel(true)
+
+/*
+ for (let p = 0; p < 20; ++p)
+ layout_general(p, view.pos[p])
+ for (let p = 20; p < 30; ++p)
+ layout_train(p, view.pos[p])
+ for (let p = 30; p < 32; ++p)
+ layout_hussar(p, view.pos[p])
+*/
+
+ let back = [ 0, 0, 0, 0 ]
+
+ for (let pow of all_powers) {
+ /*
+ let banner = `${power_name[pow]} \u2014 ${view.pt[pow]} troops`
+ let m_obj = count_total_objectives(pow)
+ if (m_obj > 0) {
+ let n_obj = count_captured_objectives(pow)
+ if (pow === P_AUSTRIA && view.oo)
+ m_obj += "*"
+ banner += ` \u2014 ${n_obj} of ${m_obj} objectives`
+ }
+ ui.power_header[pow].textContent = banner
+ */
+
+ ui.hand[pow].replaceChildren()
+ view.hand[pow].sort(cmp_tc)
+ for (let c of view.hand[pow]) {
+ if ((c & 15) === 0)
+ ui.hand[pow].appendChild(ui.tc_back[c>>7][back[c>>7]++])
+ else
+ ui.hand[pow].appendChild(ui.tc[c])
+ }
+ }
+
+ if (view.draw) {
+ view.draw.sort(cmp_tc)
+ if (view.hand[view.power].length > 0)
+ ui.hand[view.power].appendChild(ui.tcbreak)
+ for (let c of view.draw)
+ ui.hand[view.power].appendChild(ui.tc[c])
+ }
+
+ /*
+ ui.political_display.replaceChildren()
+ if (view.oo > 0)
+ ui.political_display.appendChild(ui.tc[view.oo])
+ ui.political_display.appendChild(ui.fate[0])
+ if (typeof view.fate === "object")
+ for (let c of view.fate)
+ ui.political_display.appendChild(ui.fate[c])
+ */
+
+ ui.markers_element.replaceChildren()
+ /*
+ for (let s of view.conquest)
+ ui.markers_element.appendChild(ui.conquest[s])
+ for (let s of view.retro)
+ ui.markers_element.appendChild(ui.retro[s])
+ */
+
+ if (view.attacker !== undefined && view.defender !== undefined) {
+ ui.markers_element.appendChild(ui.combat)
+ layout_combat_marker()
+ }
+
+ for (let v = 16; v >= 0; --v)
+ action_button_with_argument("value", v, v)
+
+ for (let p = 0; p < 24; ++p)
+ action_button_with_argument("detach", p, "Detach " + piece_button_name[p])
+
+ action_button("take", "Take")
+ action_button("give", "Give")
+ action_button("recruit", "Recruit")
+ action_button("transfer", "Transfer")
+
+ action_button("stop", "Stop")
+ action_button("pass", "Pass")
+ action_button("next", "Next")
+ action_button("done", "Done")
+
+ action_button("end_cards", "End card draw")
+ action_button("end_setup", "End setup")
+ action_button("end_recruit", "End recruit")
+ action_button("end_movement", "End movement")
+ action_button("end_combat", "End combat")
+ action_button("end_supply", "End supply")
+ action_button("end_turn", "End turn")
+
+ confirm_action_button("confirm_end_movement", "End movement",
+ "You still have UNMOVED pieces.?")
+
+ action_button("undo", "Undo")
+
+ process_actions()
+}
+
+/* LOG */
+
+const piece_log_name = [
+]
+
+const piece_power = [
+]
+
+const piece_button_name = [
+]
+
+const piece_tooltip_name = [
+]
+
+function sub_piece(match, p1) {
+ let x = p1 | 0
+ let n = piece_log_name[x]
+ let p = power_class[piece_power[x]]
+ return `<span class="piece_tip ${p}" onclick="on_click_piece_tip(${x})" onmouseenter="on_focus_piece_tip(${x})" onmouseleave="on_blur_piece_tip(${x})">${n}</span>`
+}
+
+function sub_space(match, p1) {
+ let x = p1 | 0
+ let n = data.cities.name[x]
+ return `<span class="city_tip" onclick="on_click_city_tip(${x})" onmouseenter="on_focus_city_tip(${x})" onmouseleave="on_blur_city_tip(${x})">${n}</span>`
+}
+
+function sub_tc(match, p1) {
+ return value + suit_text[suit]
+}
+
+function on_log(text) {
+ let p = document.createElement("div")
+
+ if (text.match(/^>>/)) {
+ text = text.substring(2)
+ p.className = "ii"
+ }
+
+ if (text.match(/^>/)) {
+ text = text.substring(1)
+ p.className = "i"
+ }
+
+ if (text.match(/^!/)) {
+ text = "Combat"
+ p.className = "combat"
+ }
+
+ text = text.replace(/&/g, "&amp;")
+ text = text.replace(/</g, "&lt;")
+ text = text.replace(/>/g, "&gt;")
+
+ text = text.replace(/S(\d+)/g, sub_space)
+ text = text.replace(/P(\d+)/g, sub_piece)
+ text = colorize(text)
+
+ if (text.match(/^\$(\d+)/)) {
+ let fx = parseInt(text.substring(1))
+ if (fx < 48 + 6)
+ text = `<div class="q">${fate_flavor_text[fx]}</div><div></div><div>${fate_effect_text[fx]}</div><div></div>`
+ else
+ text = `<div class="q">${fate_flavor_text[fx]}</div><div></div>`
+ }
+ else if (text.match(/^# /)) {
+ p.className = "h fate"
+ text = text.substring(2)
+ }
+ else if (text.match(/^\.s1/))
+ text = the_war_in_the_west_text
+ else if (text.match(/^\.s2/))
+ text = the_austrian_theater_text
+ else if (text.match(/^=\d/)) {
+ p.className = "h " + power_class[text[1]]
+ text = power_name[text[1]]
+ }
+
+ p.innerHTML = text
+ return p
+}
+
+/* COMMON LIBRARY */
+
+function array_insert(array, index, item) {
+ for (let i = array.length; i > index; --i)
+ array[i] = array[i - 1]
+ array[index] = item
+}
+
+function set_has(set, item) {
+ if (set === item) return true
+ if (set === undefined) return false
+ if (set === null) return false
+ let a = 0
+ let b = set.length - 1
+ while (a <= b) {
+ let m = (a + b) >> 1
+ let x = set[m]
+ if (item < x)
+ b = m - 1
+ else if (item > x)
+ a = m + 1
+ else
+ return true
+ }
+ return false
+}
+
+function set_add(set, item) {
+ let a = 0
+ let b = set.length - 1
+ while (a <= b) {
+ let m = (a + b) >> 1
+ let x = set[m]
+ if (item < x)
+ b = m - 1
+ else if (item > x)
+ a = m + 1
+ else
+ return
+ }
+ array_insert(set, a, item)
+}
+
+function set_add_all(set, other) {
+ for (let item of other)
+ set_add(set, item)
+}
diff --git a/rules.js b/rules.js
index 51218c6..953c8d5 100644
--- a/rules.js
+++ b/rules.js
@@ -58,7 +58,12 @@ console.log(objectives)
console.log("TAKE", anti_objectives)
console.log("PROT", prot_objectives)
-exports.roles = [ "Maria Theresa", "Frederick", "Louis XV" ]
+exports.roles = [
+ "Louis XV",
+ "Frederick",
+ "Maria Theresa",
+]
+
exports.scenarios = [ "Standard", "Introductory" ]
const P_AUSTRIA = 0
diff --git a/tools/layout.svg b/tools/layout.svg
index 7fe274c..841fb90 100644
--- a/tools/layout.svg
+++ b/tools/layout.svg
@@ -40,10 +40,10 @@
inkscape:window-height="480"
id="namedview6"
showgrid="false"
- inkscape:zoom="0.42996109"
- inkscape:cx="1321.8811"
- inkscape:cy="745.19143"
- inkscape:current-layer="svg4"
+ inkscape:zoom="8.3661045"
+ inkscape:cx="236.64652"
+ inkscape:cy="1572.9559"
+ inkscape:current-layer="g3013"
inkscape:document-rotation="0"
showguides="false">
<inkscape:grid
@@ -53,45 +53,49 @@
<image
sodipodi:absref="/home/tor/src/rally/public/maria/Maria.Gameboard.150.png"
xlink:href="../Maria.Gameboard.150.png"
- style="display:none"
- x="0"
- y="0"
- width="2485"
- height="1654"
- image-rendering="pixelated"
+ id="image2"
sodipodi:insensitive="true"
- id="image2" />
+ image-rendering="pixelated"
+ height="1654"
+ width="2485"
+ y="0"
+ x="0"
+ style="display:inline" />
<g
id="g3013"
inkscape:label="box">
<rect
- style="fill:#ffffff;fill-opacity:0.54878"
+ style="fill:#ffffff;fill-opacity:0.54878;stroke-width:1.01529"
id="rect3008"
- width="43.831398"
- height="45.260857"
- x="1853.6437"
- y="56.910255" />
+ width="44.419098"
+ height="46.038109"
+ x="1853.1211"
+ y="56.521629"
+ inkscape:label="#EastPrussia" />
<rect
- style="fill:#ffffff;fill-opacity:0.54878"
+ style="fill:#ff0000;fill-opacity:0.54878;stroke-width:1.03215"
id="rect3006"
- width="43.490704"
- height="44.500431"
- x="2260.5447"
- y="1556.2987" />
+ width="44.758511"
+ height="46.064903"
+ x="2259.615"
+ y="1555.5796"
+ inkscape:label="#ItalyA" />
<rect
style="fill:#ffffff;fill-opacity:0.54878"
id="rect2965"
width="50.698509"
height="59.472061"
x="909.94495"
- y="78.812782" />
+ y="78.812782"
+ inkscape:label="#England" />
<rect
- style="fill:#ffffff;fill-opacity:0.54878"
+ style="display:inline;fill:#ffffff;fill-opacity:0.54878;stroke-width:0.997019"
id="rect3004"
- width="44.615875"
- height="46.146133"
- x="192.40532"
- y="1554.2411" />
+ width="44.497803"
+ height="45.993053"
+ x="192.34482"
+ y="1554.1805"
+ inkscape:label="#ItalyF" />
</g>
<g
id="g2467"
@@ -14127,7 +14131,8 @@
<g
id="g2869"
inkscape:label="$HEARTS"
- style="display:none;fill:#ff2a2a">
+ style="display:none;fill:#ff2a2a"
+ sodipodi:insensitive="true">
<rect
style="fill:#ff2a2a;fill-opacity:0.54878"
id="rect2836"
@@ -14209,7 +14214,8 @@
<g
id="g2974"
inkscape:label="$DIAMONDS"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ffff00;fill-opacity:0.54878"
id="rect2938"
@@ -14299,7 +14305,8 @@
<g
id="g2904"
inkscape:label="$SPADES"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#000080;fill-opacity:0.54878"
id="rect2871"
@@ -14381,7 +14388,8 @@
<g
id="g2936"
inkscape:label="$CLUBS"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#008000;fill-opacity:0.54878"
id="rect2906"
@@ -14456,7 +14464,8 @@
<g
id="g2897"
inkscape:label="$France"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ff2f2f;fill-opacity:0.54878"
id="rect2870"
@@ -14524,7 +14533,8 @@
<g
id="g3734"
inkscape:label="$Netherlands"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#808080;fill-opacity:0.54878"
id="rect2899"
@@ -14557,7 +14567,8 @@
<g
id="g3754"
inkscape:label="$Prussia"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#0000ff;fill-opacity:0.54878"
id="rect3736"
@@ -14604,7 +14615,8 @@
<g
id="g3777"
inkscape:label="$Poland"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ffff00;fill-opacity:0.54878"
id="rect3756"
@@ -14658,7 +14670,8 @@
<g
id="g3800"
inkscape:label="$Silesia"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#808000;fill-opacity:0.54878"
id="rect3781"
@@ -14712,7 +14725,8 @@
<g
id="g3847"
inkscape:label="$Saxony"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#008000;fill-opacity:0.54878"
id="rect3802"
@@ -14822,7 +14836,8 @@
<g
id="g3872"
inkscape:label="$Bavaria"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ff6600;fill-opacity:0.54878"
id="rect3849"
@@ -14876,7 +14891,8 @@
<g
id="g3912"
inkscape:label="$Austria_E"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ffffff;fill-opacity:0.54878"
id="rect3937"
@@ -14979,7 +14995,8 @@
<g
id="g3931"
inkscape:label="$Austria_W"
- style="display:none">
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ffffff;fill-opacity:0.54878"
id="rect3914"
@@ -15025,8 +15042,9 @@
</g>
<g
id="g3974"
- inkscape:label="$HRE_E"
- style="display:none">
+ inkscape:label="$Empire_E"
+ style="display:none"
+ sodipodi:insensitive="true">
<rect
style="fill:#ffff00;fill-opacity:0.54878"
id="rect2963"
@@ -15128,7 +15146,7 @@
</g>
<g
id="g4011"
- inkscape:label="$HRE_W"
+ inkscape:label="$Empire_W"
style="display:none"
sodipodi:insensitive="true">
<rect
diff --git a/tools/parse-layout.js b/tools/parse-layout.js
index b389669..9006560 100644
--- a/tools/parse-layout.js
+++ b/tools/parse-layout.js
@@ -221,7 +221,7 @@ const PRUSSIA = "Prussia"
const SAXONY = "Saxony"
const AUSTRIA = "Austria"
const AUSTRIAN_NETHERLANDS = "Austria"
-const HRE = "HRE"
+const EMPIRE = "Empire"
const NETHERLANDS = "Netherlands"
const SILESIA = "Silesia"
const POLAND = "Poland"
@@ -254,13 +254,13 @@ for (let key in points) {
let map = "UNKNOWN"
let country = "UNKNOWN"
- if (find_enclosing_rect(rects.$HRE_W, x, y)) {
+ if (find_enclosing_rect(rects.$Empire_W, x, y)) {
map = FLANDERS
- country = HRE
+ country = EMPIRE
}
- else if (find_enclosing_rect(rects.$HRE_E, x, y)) {
+ else if (find_enclosing_rect(rects.$Empire_E, x, y)) {
map = BOHEMIA
- country = HRE
+ country = EMPIRE
}
else if (find_enclosing_rect(rects.$Austria_W, x, y)) {
map = FLANDERS
@@ -393,7 +393,7 @@ let sets = {
Prussia: [],
Saxony: [],
Silesia: [],
- HRE: [],
+ Empire: [],
UNKNOWN: [],
},
}