From c31955a8a1d78f4aed842efcc9d41491a52fcecd Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:40:56 +0200 Subject: location data --- data.js | 2 +- map.svg | 2 +- play.html | 19 ++++--- play.js | 154 +++++++++++++++++++++++++++++-------------------------- rules.js | 94 +++++++++++++++++++++++++-------- tools/gendata.js | 71 +++++++++---------------- 6 files changed, 187 insertions(+), 155 deletions(-) diff --git a/data.js b/data.js index a16a55d..0cee6c8 100644 --- a/data.js +++ b/data.js @@ -1,2 +1,2 @@ -const data = {"areas":[{"id":12,"name":"Oran","type":1,"zone":"V","x":430.6,"y":588.8},{"id":13,"name":"Algiers","type":1,"zone":"IV","x":1185.6,"y":346.8},{"id":14,"name":"Constantine","type":1,"zone":"II","x":2066.6,"y":315.8},{"id":9,"name":"France","type":3,"zone":null,"x":1605,"y":185.3,"w":266,"h":212.4},{"id":10,"name":"Morocco","type":3,"zone":null,"x":109,"y":1765,"w":94,"h":94},{"id":11,"name":"Tunisia","type":3,"zone":null,"x":2499.9,"y":1667.6,"w":94,"h":94},{"id":15,"name":"Barika","type":0,"zone":"I","x":1708.1,"y":1117.9},{"id":16,"name":"Batna","type":2,"zone":"I","x":2185.6,"y":1390.9},{"id":17,"name":"Biskra","type":2,"zone":"I","x":1853.6,"y":1620.9},{"id":18,"name":"Tebessa","type":0,"zone":"I","x":2299.6,"y":1120.9},{"id":19,"name":"Setif","type":0,"zone":"II","x":1917.6,"y":800.8},{"id":20,"name":"Souk Ahras","type":0,"zone":"II","x":2347.6,"y":848.9},{"id":21,"name":"Phillippeville","type":0,"zone":"II","x":2200.6,"y":584.9},{"id":22,"name":"Tizi Ouzou","type":0,"zone":"III","x":1473.6,"y":578.9},{"id":23,"name":"Bordj Bou Arreridj","type":0,"zone":"III","x":1465.6,"y":832.9},{"id":24,"name":"Bougie","type":0,"zone":"III","x":1703.6,"y":616.9},{"id":25,"name":"Medea","type":0,"zone":"IV","x":1212,"y":727},{"id":26,"name":"Orleansville","type":0,"zone":"IV","x":982,"y":780.2},{"id":27,"name":"Mecheria","type":2,"zone":"V","x":234,"y":1485.7},{"id":28,"name":"Tlemcen","type":0,"zone":"V","x":173,"y":1140.9},{"id":29,"name":"Sidi Bel Abbes","type":0,"zone":"V","x":476,"y":1038},{"id":30,"name":"Mostaganem","type":0,"zone":"V","x":741,"y":863.9},{"id":31,"name":"Saida","type":2,"zone":"V","x":501,"y":1419.1},{"id":32,"name":"Mascara","type":2,"zone":"V","x":785,"y":1302.9},{"id":33,"name":"Ain Sefra","type":2,"zone":"V","x":752,"y":1670.9},{"id":34,"name":"Laghouat","type":2,"zone":"V","x":1191,"y":1615.6},{"id":35,"name":"Sidi Aissa","type":2,"zone":"VI","x":1385,"y":1186},{"id":36,"name":"Ain Qussera","type":0,"zone":"VI","x":1070.6,"y":1235.6}],"zones":{"V":["Oran","Mecheria","Tlemcen","Sidi Bel Abbes","Mostaganem","Saida","Mascara","Ain Sefra","Laghouat"],"IV":["Algiers","Medea","Orleansville"],"II":["Constantine","Setif","Souk Ahras","Phillippeville"],"I":["Barika","Batna","Biskra","Tebessa"],"III":["Tizi Ouzou","Bordj Bou Arreridj","Bougie"],"VI":["Sidi Aissa","Ain Qussera"]},"locations":{"DEPLOY":1,"ELIMINATED":2,"I":3,"II":4,"III":5,"IV":6,"V":7,"VI":8,"France":9,"Morocco":10,"Tunisia":11,"Oran":12,"Algiers":13,"Constantine":14,"Barika":15,"Batna":16,"Biskra":17,"Tebessa":18,"Setif":19,"Souk Ahras":20,"Phillippeville":21,"Tizi Ouzou":22,"Bordj Bou Arreridj":23,"Bougie":24,"Medea":25,"Orleansville":26,"Mecheria":27,"Tlemcen":28,"Sidi Bel Abbes":29,"Mostaganem":30,"Saida":31,"Mascara":32,"Ain Sefra":33,"Laghouat":34,"Sidi Aissa":35,"Ain Qussera":36},"free_deploy_locations":[3,4,5,6,7,8],"units":[{"side":1,"type":0,"class":"fr_xx_2"},{"side":1,"type":0,"class":"fr_xx_4"},{"side":1,"type":0,"class":"fr_xx_9"},{"side":1,"type":0,"class":"fr_xx_12"},{"side":1,"type":0,"class":"fr_xx_13"},{"side":1,"type":0,"class":"fr_xx_14"},{"side":1,"type":0,"class":"fr_xx_19"},{"side":1,"type":0,"class":"fr_xx_20"},{"side":1,"type":0,"class":"fr_xx_21"},{"side":1,"type":0,"class":"fr_xx_29"},{"side":1,"type":0,"class":"fr_xx_27"},{"side":1,"type":0,"class":"fr_xx_25"},{"side":1,"type":0,"class":"fr_xx_7"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_inf"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"}]} +const data = {"locations":{},"areas":[{"loc":0,"id":"NONE","name":"None"},{"loc":1,"id":"DEPLOY","name":"Deployment"},{"loc":2,"id":"ELIMINATED","name":"Eliminated"},{"loc":3,"id":"FRANCE","name":"France","type":4,"zone":null,"x":1690.3,"y":244.8,"w":94,"h":94},{"loc":4,"id":"TUNISIA","name":"Tunisia","type":4,"zone":"TUNISIA","x":2499.9,"y":1667.6,"w":94,"h":94},{"loc":5,"id":"MOROCCO","name":"Morocco","type":4,"zone":"MOROCCO","x":109,"y":1765,"w":94,"h":94},{"loc":6,"id":"I-1","name":"Barika","type":1,"zone":"I","x":1708.1,"y":1117.9},{"loc":7,"id":"I-2","name":"Batna","type":3,"zone":"I","x":2185.6,"y":1390.9},{"loc":8,"id":"I-3","name":"Biskra","type":3,"zone":"I","x":1853.6,"y":1620.9},{"loc":9,"id":"I-4","name":"Tebessa","type":1,"zone":"I","x":2299.6,"y":1120.9},{"loc":10,"id":"CONSTANTINE","name":"Constantine","type":2,"zone":"II","x":2066.6,"y":315.8},{"loc":11,"id":"II-1","name":"Setif","type":1,"zone":"II","x":1917.6,"y":800.8},{"loc":12,"id":"II-2","name":"Phillippeville","type":1,"zone":"II","x":2200.6,"y":584.9},{"loc":13,"id":"II-3","name":"Souk Ahras","type":1,"zone":"II","x":2347.6,"y":848.9},{"loc":14,"id":"III-1","name":"Tizi Ouzou","type":1,"zone":"III","x":1473.6,"y":578.9},{"loc":15,"id":"III-2","name":"Bordj Bou Arreridj","type":1,"zone":"III","x":1465.6,"y":832.9},{"loc":16,"id":"III-3","name":"Bougie","type":1,"zone":"III","x":1703.6,"y":616.9},{"loc":17,"id":"ALGIERS","name":"Algiers","type":2,"zone":"IV","x":1185.6,"y":346.8},{"loc":18,"id":"IV-1","name":"Medea","type":1,"zone":"IV","x":1212,"y":727},{"loc":19,"id":"IV-2","name":"Orleansville","type":1,"zone":"IV","x":982,"y":780.2},{"loc":20,"id":"ORAN","name":"Oran","type":2,"zone":"V","x":430.6,"y":588.8},{"loc":21,"id":"V-1","name":"Mecheria","type":3,"zone":"V","x":234,"y":1485.7},{"loc":22,"id":"V-2","name":"Tlemcen","type":1,"zone":"V","x":173,"y":1140.9},{"loc":23,"id":"V-3","name":"Sidi Bel Abbes","type":1,"zone":"V","x":476,"y":1038},{"loc":24,"id":"V-4","name":"Mostaganem","type":1,"zone":"V","x":741,"y":863.9},{"loc":25,"id":"V-5","name":"Saida","type":3,"zone":"V","x":501,"y":1419.1},{"loc":26,"id":"V-6","name":"Mascara","type":3,"zone":"V","x":785,"y":1302.9},{"loc":27,"id":"V-7","name":"Ain Sefra","type":3,"zone":"V","x":752,"y":1670.9},{"loc":28,"id":"V-8","name":"Laghouat","type":3,"zone":"V","x":1191,"y":1615.6},{"loc":29,"id":"VI-1","name":"Sidi Aissa","type":3,"zone":"VI","x":1385,"y":1186},{"loc":30,"id":"VI-2","name":"Ain Qussera","type":1,"zone":"VI","x":1070.6,"y":1235.6}],"zone_areas":{"TUNISIA":[4],"MOROCCO":[5],"I":[6,7,8,9],"II":[10,11,12,13],"III":[14,15,16],"IV":[17,18,19],"V":[20,21,22,23,24,25,26,27,28],"VI":[29,30]},"adjecents":{"undefined":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},"units":[{"side":1,"type":0,"class":"fr_xx_2"},{"side":1,"type":0,"class":"fr_xx_4"},{"side":1,"type":0,"class":"fr_xx_9"},{"side":1,"type":0,"class":"fr_xx_12"},{"side":1,"type":0,"class":"fr_xx_13"},{"side":1,"type":0,"class":"fr_xx_14"},{"side":1,"type":0,"class":"fr_xx_19"},{"side":1,"type":0,"class":"fr_xx_20"},{"side":1,"type":0,"class":"fr_xx_21"},{"side":1,"type":0,"class":"fr_xx_29"},{"side":1,"type":0,"class":"fr_xx_27"},{"side":1,"type":0,"class":"fr_xx_25"},{"side":1,"type":0,"class":"fr_xx_7"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":1,"class":"fr_x"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_para"},{"side":1,"type":2,"class":"fr_elite_x_inf"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":2,"class":"fr_elite_x_marine"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":3,"class":"alg_x"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":1,"type":4,"class":"alg_police"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":5,"class":"fln_failek"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":6,"class":"fln_band"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":7,"class":"fln_cadre"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"},{"side":0,"type":8,"class":"fln_front"}]} if (typeof module !== 'undefined') module.exports = data diff --git a/map.svg b/map.svg index 3e6115d..a829e4d 100644 --- a/map.svg +++ b/map.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/play.html b/play.html index 4719dec..d7812ff 100644 --- a/play.html +++ b/play.html @@ -46,12 +46,12 @@ main { background-color: dimgray } /* SPACES */ -.box{position:absolute;box-sizing:border-box;border:4px solid transparent} -.box.loc{border-radius:50%} -.box.action{border-color:lemonchiffon;} -.box.loc.action{border-color:lemonchiffon;} -.box.selected{border-color:yellow;} -.box.tip { border-color: white; } +.space{position:absolute;box-sizing:border-box;border:4px solid transparent} +.space.loc{border-radius:50%} +.space.action{border-color:lemonchiffon;} +.space.loc.action{border-color:lemonchiffon;} +.space.selected{border-color:yellow;} +.space.tip { border-color: white; } .stack { display: grid; @@ -238,11 +238,10 @@ main { background-color: dimgray } -