powergrid-engine 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +17 -0
  5. package/dist/src/available-moves.d.ts +24 -0
  6. package/dist/src/available-moves.js +363 -0
  7. package/dist/src/engine.d.ts +20 -0
  8. package/dist/src/engine.js +1937 -0
  9. package/dist/src/gamestate.d.ts +135 -0
  10. package/dist/src/gamestate.js +30 -0
  11. package/dist/src/log.d.ts +14 -0
  12. package/dist/src/log.js +2 -0
  13. package/dist/src/maps/america.d.ts +55 -0
  14. package/dist/src/maps/america.js +411 -0
  15. package/dist/src/maps/australia.d.ts +46 -0
  16. package/dist/src/maps/australia.js +138 -0
  17. package/dist/src/maps/badenwurttemberg.d.ts +46 -0
  18. package/dist/src/maps/badenwurttemberg.js +163 -0
  19. package/dist/src/maps/benelux.d.ts +46 -0
  20. package/dist/src/maps/benelux.js +210 -0
  21. package/dist/src/maps/brazil.d.ts +54 -0
  22. package/dist/src/maps/brazil.js +292 -0
  23. package/dist/src/maps/centraleurope.d.ts +54 -0
  24. package/dist/src/maps/centraleurope.js +236 -0
  25. package/dist/src/maps/china.d.ts +54 -0
  26. package/dist/src/maps/china.js +262 -0
  27. package/dist/src/maps/france.d.ts +54 -0
  28. package/dist/src/maps/france.js +290 -0
  29. package/dist/src/maps/germany.d.ts +57 -0
  30. package/dist/src/maps/germany.js +328 -0
  31. package/dist/src/maps/indian.d.ts +54 -0
  32. package/dist/src/maps/indian.js +283 -0
  33. package/dist/src/maps/italy.d.ts +54 -0
  34. package/dist/src/maps/italy.js +190 -0
  35. package/dist/src/maps/japan.d.ts +46 -0
  36. package/dist/src/maps/japan.js +144 -0
  37. package/dist/src/maps/korea.d.ts +54 -0
  38. package/dist/src/maps/korea.js +186 -0
  39. package/dist/src/maps/middleeast.d.ts +54 -0
  40. package/dist/src/maps/middleeast.js +225 -0
  41. package/dist/src/maps/northerneurope.d.ts +54 -0
  42. package/dist/src/maps/northerneurope.js +197 -0
  43. package/dist/src/maps/quebec.d.ts +54 -0
  44. package/dist/src/maps/quebec.js +283 -0
  45. package/dist/src/maps/russia.d.ts +54 -0
  46. package/dist/src/maps/russia.js +286 -0
  47. package/dist/src/maps/southafrica.d.ts +46 -0
  48. package/dist/src/maps/southafrica.js +152 -0
  49. package/dist/src/maps/spainportugal.d.ts +54 -0
  50. package/dist/src/maps/spainportugal.js +289 -0
  51. package/dist/src/maps/ukireland.d.ts +52 -0
  52. package/dist/src/maps/ukireland.js +176 -0
  53. package/dist/src/maps.d.ts +50 -0
  54. package/dist/src/maps.js +61 -0
  55. package/dist/src/move.d.ts +63 -0
  56. package/dist/src/move.js +15 -0
  57. package/dist/src/powerPlants.d.ts +4 -0
  58. package/dist/src/powerPlants.js +60 -0
  59. package/dist/src/prices.d.ts +7 -0
  60. package/dist/src/prices.js +10 -0
  61. package/dist/src/randomizeMap.d.ts +3 -0
  62. package/dist/src/randomizeMap.js +244 -0
  63. package/dist/src/utils.d.ts +2 -0
  64. package/dist/src/utils.js +24 -0
  65. package/dist/wrapper.d.ts +30 -0
  66. package/dist/wrapper.js +127 -0
  67. package/index.ts +6 -0
  68. package/package.json +51 -0
  69. package/src/available-moves.ts +450 -0
  70. package/src/engine.spec.ts +163 -0
  71. package/src/engine.ts +2270 -0
  72. package/src/fixtures/GermanyRecharged.json +6627 -0
  73. package/src/fixtures/USAOriginal.json +5216 -0
  74. package/src/fixtures/supply.json +5792 -0
  75. package/src/fixtures/undo.json +4102 -0
  76. package/src/gamestate.ts +164 -0
  77. package/src/log.ts +17 -0
  78. package/src/maps/america.ts +411 -0
  79. package/src/maps/australia.ts +137 -0
  80. package/src/maps/badenwurttemberg.ts +162 -0
  81. package/src/maps/benelux.ts +210 -0
  82. package/src/maps/brazil.ts +306 -0
  83. package/src/maps/centraleurope.ts +235 -0
  84. package/src/maps/china.ts +268 -0
  85. package/src/maps/france.ts +295 -0
  86. package/src/maps/germany.ts +328 -0
  87. package/src/maps/indian.ts +289 -0
  88. package/src/maps/italy.ts +189 -0
  89. package/src/maps/japan.ts +143 -0
  90. package/src/maps/korea.ts +185 -0
  91. package/src/maps/middleeast.ts +225 -0
  92. package/src/maps/northerneurope.ts +196 -0
  93. package/src/maps/quebec.ts +304 -0
  94. package/src/maps/russia.ts +292 -0
  95. package/src/maps/southafrica.ts +151 -0
  96. package/src/maps/spainportugal.ts +295 -0
  97. package/src/maps/ukireland.ts +175 -0
  98. package/src/maps.ts +123 -0
  99. package/src/move.ts +83 -0
  100. package/src/powerPlants.ts +59 -0
  101. package/src/prices.ts +10 -0
  102. package/src/randomizeMap.ts +288 -0
  103. package/src/rankings.spec.ts +18 -0
  104. package/src/utils.spec.ts +13 -0
  105. package/src/utils.ts +23 -0
  106. package/tsconfig.json +17 -0
  107. package/wrapper.ts +126 -0
@@ -0,0 +1,286 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.map = exports.Cities = exports.Regions = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const engine_1 = require("../engine");
6
+ const powerPlants_1 = require("../powerPlants");
7
+ const utils_1 = require("../utils");
8
+ var Regions;
9
+ (function (Regions) {
10
+ Regions["Green"] = "green";
11
+ Regions["Pink"] = "pink";
12
+ Regions["Red"] = "red";
13
+ Regions["Yellow"] = "yellow";
14
+ Regions["Purple"] = "purple";
15
+ Regions["Brown"] = "brown";
16
+ })(Regions = exports.Regions || (exports.Regions = {}));
17
+ var Cities;
18
+ (function (Cities) {
19
+ Cities["Murmansk"] = "Murmansk";
20
+ Cities["Arkhangelsk"] = "Arkhangelsk";
21
+ Cities["Syktyvkar"] = "Syktyvkar";
22
+ Cities["Kirov"] = "Kirov";
23
+ Cities["Kazan"] = "Kazan";
24
+ Cities["Cheboksary"] = "Cheboksary";
25
+ Cities["Ulyanovsk"] = "Ulyanovsk";
26
+ Cities["Tula"] = "Tula";
27
+ Cities["Kaliningrad"] = "Kaliningrad";
28
+ Cities["Ryazan"] = "Ryazan";
29
+ Cities["Nizhnynovgorod"] = "Nizhny Novgorod";
30
+ Cities["Moscow"] = "Moscow";
31
+ Cities["Stpetersburg"] = "St Petersburg";
32
+ Cities["Yaroslavl"] = "Yaroslavl";
33
+ Cities["Chita"] = "Chita";
34
+ Cities["Bratsk"] = "Bratsk";
35
+ Cities["Krasnoyarsk"] = "Krasnoyarsk";
36
+ Cities["Kemerovd"] = "Kemerovd";
37
+ Cities["Novokuznetsk"] = "Novokuznetsk";
38
+ Cities["Irkutsk"] = "Irkutsk";
39
+ Cities["Ulanude"] = "Ulan Ude";
40
+ Cities["Norilsk"] = "Norilsk";
41
+ Cities["Surgut"] = "Surgut";
42
+ Cities["Tyumen"] = "Tyumen";
43
+ Cities["Tomsk"] = "Tomsk";
44
+ Cities["Novosibirsk"] = "Novosibirsk";
45
+ Cities["Barnaul"] = "Barnaul";
46
+ Cities["Omsk"] = "Omsk";
47
+ Cities["Chelyabinsk"] = "Chelyabinsk";
48
+ Cities["Ufa"] = "Ufa";
49
+ Cities["Perm"] = "Perm";
50
+ Cities["Yekaterinburg"] = "Yekaterinburg";
51
+ Cities["Orenburg"] = "Orenburg";
52
+ Cities["Naberezhnyechelny"] = "Naberezhnye Chelny";
53
+ Cities["Samara"] = "Samara";
54
+ Cities["Astrakhan"] = "Astrakhan";
55
+ Cities["Makhachkala"] = "Makhachkala";
56
+ Cities["Saratov"] = "Saratov";
57
+ Cities["Volgograd"] = "Volgograd";
58
+ Cities["Krasnodar"] = "Krasnodar";
59
+ Cities["Rostov"] = "Rostov";
60
+ Cities["Voronezh"] = "Voronezh";
61
+ })(Cities = exports.Cities || (exports.Cities = {}));
62
+ exports.map = {
63
+ name: 'Russia',
64
+ cities: [
65
+ { name: Cities.Murmansk, region: Regions.Green, x: 1574, y: 351 },
66
+ { name: Cities.Arkhangelsk, region: Regions.Green, x: 1456, y: 695 },
67
+ { name: Cities.Syktyvkar, region: Regions.Green, x: 1669, y: 1005 },
68
+ { name: Cities.Kirov, region: Regions.Green, x: 1457, y: 1172 },
69
+ { name: Cities.Kazan, region: Regions.Green, x: 1378, y: 1478 },
70
+ { name: Cities.Cheboksary, region: Regions.Green, x: 1200, y: 1328 },
71
+ { name: Cities.Ulyanovsk, region: Regions.Green, x: 884, y: 1448 },
72
+ { name: Cities.Tula, region: Regions.Pink, x: 485, y: 1077 },
73
+ { name: Cities.Kaliningrad, region: Regions.Pink, x: 394, y: 606 },
74
+ { name: Cities.Ryazan, region: Regions.Pink, x: 793, y: 1193 },
75
+ { name: Cities.Nizhnynovgorod, region: Regions.Pink, x: 1129, y: 1116 },
76
+ { name: Cities.Moscow, region: Regions.Pink, x: 763, y: 961 },
77
+ { name: Cities.Stpetersburg, region: Regions.Pink, x: 883, y: 597 },
78
+ { name: Cities.Yaroslavl, region: Regions.Pink, x: 1018, y: 915 },
79
+ { name: Cities.Chita, region: Regions.Red, x: 4168, y: 2048 },
80
+ { name: Cities.Bratsk, region: Regions.Red, x: 3599, y: 1808 },
81
+ { name: Cities.Krasnoyarsk, region: Regions.Red, x: 3230, y: 1930 },
82
+ { name: Cities.Kemerovd, region: Regions.Red, x: 2953, y: 1987 },
83
+ { name: Cities.Novokuznetsk, region: Regions.Red, x: 3041, y: 2159 },
84
+ { name: Cities.Irkutsk, region: Regions.Red, x: 3721, y: 2162 },
85
+ { name: Cities.Ulanude, region: Regions.Red, x: 4030, y: 2228 },
86
+ { name: Cities.Norilsk, region: Regions.Yellow, x: 3001, y: 856 },
87
+ { name: Cities.Surgut, region: Regions.Yellow, x: 2348, y: 1411 },
88
+ { name: Cities.Tyumen, region: Regions.Yellow, x: 2060, y: 1627 },
89
+ { name: Cities.Tomsk, region: Regions.Yellow, x: 2773, y: 1835 },
90
+ { name: Cities.Novosibirsk, region: Regions.Yellow, x: 2647, y: 2005 },
91
+ { name: Cities.Barnaul, region: Regions.Yellow, x: 2662, y: 2191 },
92
+ { name: Cities.Omsk, region: Regions.Yellow, x: 2195, y: 1957 },
93
+ { name: Cities.Chelyabinsk, region: Regions.Purple, x: 1768, y: 1865 },
94
+ { name: Cities.Ufa, region: Regions.Purple, x: 1472, y: 1907 },
95
+ { name: Cities.Perm, region: Regions.Purple, x: 1688, y: 1388 },
96
+ { name: Cities.Yekaterinburg, region: Regions.Purple, x: 1757, y: 1620 },
97
+ { name: Cities.Orenburg, region: Regions.Purple, x: 1250, y: 1997 },
98
+ { name: Cities.Naberezhnyechelny, region: Regions.Purple, x: 1427, y: 1709 },
99
+ { name: Cities.Samara, region: Regions.Purple, x: 1132, y: 1701 },
100
+ { name: Cities.Astrakhan, region: Regions.Brown, x: 619, y: 2092 },
101
+ { name: Cities.Makhachkala, region: Regions.Brown, x: 317, y: 2262 },
102
+ { name: Cities.Saratov, region: Regions.Brown, x: 808, y: 1661 },
103
+ { name: Cities.Volgograd, region: Regions.Brown, x: 589, y: 1795 },
104
+ { name: Cities.Krasnodar, region: Regions.Brown, x: 260, y: 1865 },
105
+ { name: Cities.Rostov, region: Regions.Brown, x: 311, y: 1658 },
106
+ { name: Cities.Voronezh, region: Regions.Brown, x: 485, y: 1409 },
107
+ ],
108
+ connections: [
109
+ { nodes: [Cities.Kaliningrad, Cities.Stpetersburg], cost: 15 },
110
+ { nodes: [Cities.Stpetersburg, Cities.Murmansk], cost: 19 },
111
+ { nodes: [Cities.Murmansk, Cities.Arkhangelsk], cost: 15 },
112
+ { nodes: [Cities.Arkhangelsk, Cities.Stpetersburg], cost: 14 },
113
+ { nodes: [Cities.Tula, Cities.Kaliningrad], cost: 20 },
114
+ { nodes: [Cities.Tula, Cities.Moscow], cost: 3 },
115
+ { nodes: [Cities.Moscow, Cities.Ryazan], cost: 3 },
116
+ { nodes: [Cities.Ryazan, Cities.Voronezh], cost: 5 },
117
+ { nodes: [Cities.Voronezh, Cities.Tula], cost: 5 },
118
+ { nodes: [Cities.Tula, Cities.Stpetersburg], cost: 13 },
119
+ { nodes: [Cities.Tula, Cities.Ryazan], cost: 0 },
120
+ { nodes: [Cities.Stpetersburg, Cities.Moscow], cost: 10 },
121
+ { nodes: [Cities.Moscow, Cities.Yaroslavl], cost: 3 },
122
+ { nodes: [Cities.Yaroslavl, Cities.Nizhnynovgorod], cost: 4 },
123
+ { nodes: [Cities.Nizhnynovgorod, Cities.Moscow], cost: 7 },
124
+ { nodes: [Cities.Yaroslavl, Cities.Stpetersburg], cost: 9 },
125
+ { nodes: [Cities.Yaroslavl, Cities.Arkhangelsk], cost: 12 },
126
+ { nodes: [Cities.Arkhangelsk, Cities.Syktyvkar], cost: 10 },
127
+ { nodes: [Cities.Syktyvkar, Cities.Surgut], cost: 21 },
128
+ { nodes: [Cities.Perm, Cities.Syktyvkar], cost: 8 },
129
+ { nodes: [Cities.Syktyvkar, Cities.Kirov], cost: 6 },
130
+ { nodes: [Cities.Syktyvkar, Cities.Nizhnynovgorod], cost: 11 },
131
+ { nodes: [Cities.Nizhnynovgorod, Cities.Arkhangelsk], cost: 15 },
132
+ { nodes: [Cities.Nizhnynovgorod, Cities.Cheboksary], cost: 3 },
133
+ { nodes: [Cities.Cheboksary, Cities.Ulyanovsk], cost: 4 },
134
+ { nodes: [Cities.Ulyanovsk, Cities.Voronezh], cost: 11 },
135
+ { nodes: [Cities.Voronezh, Cities.Volgograd], cost: 8 },
136
+ { nodes: [Cities.Volgograd, Cities.Saratov], cost: 6 },
137
+ { nodes: [Cities.Saratov, Cities.Samara], cost: 5 },
138
+ { nodes: [Cities.Samara, Cities.Ulyanovsk], cost: 3 },
139
+ { nodes: [Cities.Ulyanovsk, Cities.Kazan], cost: 3 },
140
+ { nodes: [Cities.Kazan, Cities.Samara], cost: 4 },
141
+ { nodes: [Cities.Samara, Cities.Naberezhnyechelny], cost: 5 },
142
+ { nodes: [Cities.Cheboksary, Cities.Kazan], cost: 2 },
143
+ { nodes: [Cities.Cheboksary, Cities.Kirov], cost: 5 },
144
+ { nodes: [Cities.Kirov, Cities.Kazan], cost: 5 },
145
+ { nodes: [Cities.Kazan, Cities.Perm], cost: 8 },
146
+ { nodes: [Cities.Kazan, Cities.Naberezhnyechelny], cost: 3 },
147
+ { nodes: [Cities.Naberezhnyechelny, Cities.Ufa], cost: 4 },
148
+ { nodes: [Cities.Ufa, Cities.Orenburg], cost: 6 },
149
+ { nodes: [Cities.Orenburg, Cities.Samara], cost: 6 },
150
+ { nodes: [Cities.Orenburg, Cities.Naberezhnyechelny], cost: 7 },
151
+ { nodes: [Cities.Ufa, Cities.Chelyabinsk], cost: 8 },
152
+ { nodes: [Cities.Chelyabinsk, Cities.Yekaterinburg], cost: 3 },
153
+ { nodes: [Cities.Yekaterinburg, Cities.Perm], cost: 5 },
154
+ { nodes: [Cities.Perm, Cities.Kirov], cost: 6 },
155
+ { nodes: [Cities.Chelyabinsk, Cities.Tyumen], cost: 5 },
156
+ { nodes: [Cities.Tyumen, Cities.Surgut], cost: 10 },
157
+ { nodes: [Cities.Syktyvkar, Cities.Tyumen], cost: 17 },
158
+ { nodes: [Cities.Tyumen, Cities.Yekaterinburg], cost: 5 },
159
+ { nodes: [Cities.Chelyabinsk, Cities.Omsk], cost: 13 },
160
+ { nodes: [Cities.Omsk, Cities.Tyumen], cost: 9 },
161
+ { nodes: [Cities.Tyumen, Cities.Tomsk], cost: 19 },
162
+ { nodes: [Cities.Tomsk, Cities.Surgut], cost: 15 },
163
+ { nodes: [Cities.Tomsk, Cities.Novosibirsk], cost: 4 },
164
+ { nodes: [Cities.Novosibirsk, Cities.Barnaul], cost: 4 },
165
+ { nodes: [Cities.Barnaul, Cities.Omsk], cost: 11 },
166
+ { nodes: [Cities.Omsk, Cities.Novosibirsk], cost: 10 },
167
+ { nodes: [Cities.Omsk, Cities.Tomsk], cost: 12 },
168
+ { nodes: [Cities.Rostov, Cities.Krasnodar], cost: 4 },
169
+ { nodes: [Cities.Krasnodar, Cities.Volgograd], cost: 9 },
170
+ { nodes: [Cities.Volgograd, Cities.Astrakhan], cost: 6 },
171
+ { nodes: [Cities.Krasnodar, Cities.Makhachkala], cost: 14 },
172
+ { nodes: [Cities.Makhachkala, Cities.Astrakhan], cost: 8 },
173
+ { nodes: [Cities.Makhachkala, Cities.Volgograd], cost: 11 },
174
+ { nodes: [Cities.Rostov, Cities.Volgograd], cost: 7 },
175
+ { nodes: [Cities.Ryazan, Cities.Ulyanovsk], cost: 9 },
176
+ { nodes: [Cities.Ulyanovsk, Cities.Saratov], cost: 6 },
177
+ { nodes: [Cities.Saratov, Cities.Voronezh], cost: 8 },
178
+ { nodes: [Cities.Rostov, Cities.Voronezh], cost: 9 },
179
+ { nodes: [Cities.Naberezhnyechelny, Cities.Perm], cost: 6 },
180
+ { nodes: [Cities.Naberezhnyechelny, Cities.Yekaterinburg], cost: 8 },
181
+ { nodes: [Cities.Ufa, Cities.Yekaterinburg], cost: 6 },
182
+ { nodes: [Cities.Chita, Cities.Ulanude], cost: 6 },
183
+ { nodes: [Cities.Ulanude, Cities.Irkutsk], cost: 6 },
184
+ { nodes: [Cities.Irkutsk, Cities.Novokuznetsk], cost: 21 },
185
+ { nodes: [Cities.Novokuznetsk, Cities.Kemerovd], cost: 3 },
186
+ { nodes: [Cities.Kemerovd, Cities.Tomsk], cost: 3 },
187
+ { nodes: [Cities.Novosibirsk, Cities.Novokuznetsk], cost: 5 },
188
+ { nodes: [Cities.Novosibirsk, Cities.Kemerovd], cost: 4 },
189
+ { nodes: [Cities.Novokuznetsk, Cities.Barnaul], cost: 6 },
190
+ { nodes: [Cities.Kemerovd, Cities.Krasnoyarsk], cost: 7 },
191
+ { nodes: [Cities.Krasnoyarsk, Cities.Novokuznetsk], cost: 7 },
192
+ { nodes: [Cities.Krasnoyarsk, Cities.Irkutsk], cost: 17 },
193
+ { nodes: [Cities.Krasnoyarsk, Cities.Bratsk], cost: 10 },
194
+ { nodes: [Cities.Bratsk, Cities.Tomsk], cost: 17 },
195
+ { nodes: [Cities.Bratsk, Cities.Irkutsk], cost: 10 },
196
+ { nodes: [Cities.Bratsk, Cities.Ulanude], cost: 14 },
197
+ { nodes: [Cities.Tomsk, Cities.Norilsk], cost: 24 },
198
+ { nodes: [Cities.Norilsk, Cities.Bratsk], cost: 29 },
199
+ { nodes: [Cities.Norilsk, Cities.Surgut], cost: 19 },
200
+ ],
201
+ adjustRatio: [0.25, 0.25],
202
+ resupply: [
203
+ [
204
+ [2, 2, 4],
205
+ [2, 3, 4],
206
+ [3, 4, 5],
207
+ [4, 5, 6],
208
+ [5, 6, 7],
209
+ ],
210
+ [
211
+ [3, 4, 3],
212
+ [3, 4, 3],
213
+ [5, 6, 4],
214
+ [5, 7, 5],
215
+ [7, 9, 6],
216
+ ],
217
+ [
218
+ [2, 2, 3],
219
+ [2, 2, 3],
220
+ [3, 3, 4],
221
+ [4, 3, 5],
222
+ [4, 5, 6],
223
+ ],
224
+ [
225
+ [1, 1, 1],
226
+ [1, 1, 1],
227
+ [1, 2, 2],
228
+ [2, 3, 2],
229
+ [2, 3, 3],
230
+ ],
231
+ ],
232
+ startingResources: [18, 24, 0, 7],
233
+ setupDeck(numPlayers, variant, rng) {
234
+ let powerPlantsDeck = lodash_1.cloneDeep(powerPlants_1.powerPlants);
235
+ let actualMarket = [];
236
+ let futureMarket = [];
237
+ const step3 = powerPlantsDeck.pop();
238
+ if (variant == 'original') {
239
+ // Set actual and future markets (plant 6 is skipped).
240
+ actualMarket = powerPlantsDeck.filter((p) => p.number >= 3 && p.number <= 5);
241
+ futureMarket = powerPlantsDeck.filter((p) => p.number >= 7 && p.number <= 9);
242
+ // Set aside plants 10, 11, 13.
243
+ const plant10 = engine_1.getPowerPlant(10);
244
+ const plant11 = engine_1.getPowerPlant(11);
245
+ const plant13 = engine_1.getPowerPlant(13);
246
+ // Shuffle rest of plants (skipping plant 14).
247
+ const mainPlants = powerPlantsDeck.filter((p) => p.number == 12 || p.number >= 15);
248
+ let mainPlantsShuffled = utils_1.shuffle(mainPlants, rng() + '');
249
+ // Remove random set of plants based on number of players.
250
+ if (numPlayers == 2 || numPlayers == 3) {
251
+ mainPlantsShuffled = mainPlantsShuffled.slice(8);
252
+ }
253
+ else if (numPlayers == 4) {
254
+ mainPlantsShuffled = mainPlantsShuffled.slice(4);
255
+ }
256
+ // Shuffle top 3 plants from main deck with plants 10 and 11, and place on top of deck.
257
+ let topPlants = mainPlantsShuffled.slice(0, 3).concat(plant10, plant11);
258
+ topPlants = utils_1.shuffle(topPlants, rng() + '');
259
+ // Place plant 13 on top of deck, shuffled cards with 10 and 11 next, then the rest of the deck, then the step 3 card.
260
+ powerPlantsDeck = [plant13].concat(topPlants, mainPlantsShuffled.slice(3), step3);
261
+ }
262
+ else {
263
+ const initialPlants = powerPlantsDeck.filter((p) => p.number <= 15 && p.number != 6 && p.number != 14);
264
+ const initialPlantsShuffled = utils_1.shuffle(initialPlants, rng() + '');
265
+ const mainPlants = powerPlantsDeck.filter((p) => p.number >= 16);
266
+ let mainPlantsShuffled = utils_1.shuffle(mainPlants, rng() + '');
267
+ if (numPlayers == 2) {
268
+ mainPlantsShuffled = mainPlantsShuffled.slice(6);
269
+ }
270
+ else if (numPlayers == 3) {
271
+ mainPlantsShuffled = mainPlantsShuffled.slice(8);
272
+ }
273
+ else if (numPlayers == 4) {
274
+ mainPlantsShuffled = mainPlantsShuffled.slice(4);
275
+ }
276
+ let initialPlantMarket = initialPlantsShuffled.slice(0, 6);
277
+ const otherInitialPlants = initialPlantsShuffled.slice(6);
278
+ initialPlantMarket = initialPlantMarket.sort((a, b) => a.number - b.number);
279
+ actualMarket = initialPlantMarket.slice(0, 3);
280
+ futureMarket = initialPlantMarket.slice(3);
281
+ powerPlantsDeck = otherInitialPlants.concat(mainPlantsShuffled, step3);
282
+ }
283
+ return { actualMarket, futureMarket, powerPlantsDeck };
284
+ },
285
+ mapSpecificRules: 'The power plant market is restricted, and the rules for removing old plants are changed.',
286
+ };
@@ -0,0 +1,46 @@
1
+ import { GameMap } from './../maps';
2
+ export declare enum Regions {
3
+ Orange = "orange",
4
+ Green = "green",
5
+ Yellow = "yellow",
6
+ Brown = "brown",
7
+ Red = "red"
8
+ }
9
+ export declare enum Cities {
10
+ Zimbaswe = "Zimbaswe",
11
+ Musina = "Musina",
12
+ Botswana = "Botswana",
13
+ Polokwane = "Polokwane",
14
+ Pretoria1 = "Pretoria 1",
15
+ Pretoria2 = "Pretoria 2",
16
+ Rustenburc = "Rustenburc",
17
+ Mozambique = "Mozambique",
18
+ Mbombela = "Mbombela",
19
+ Iswaini = "Iswaini",
20
+ Germiston = "Germiston",
21
+ Johannesburg1 = "Johannesburg 1",
22
+ Johannesburg2 = "Johannesburg 2",
23
+ Ladysmith = "Ladysmith",
24
+ Abc = "Abc",
25
+ Def = "Def",
26
+ Ghi1 = "Ghi 1",
27
+ Ghi2 = "Ghi 2",
28
+ Jkl = "Jkl",
29
+ Mno = "Mno",
30
+ Qrs = "Qrs",
31
+ Keerksorp = "Keerksorp",
32
+ Weikom = "Weikom",
33
+ Xuruman = "Xuruman",
34
+ Kimberly = "Kimberly",
35
+ Upincion = "Upincion",
36
+ Sprincbom = "Sprincbom",
37
+ Namibia = "Namibia",
38
+ Deaar = "Deaar",
39
+ Beaufortwest = "Beaufort West",
40
+ Eastlondon = "East London",
41
+ Portelizabeth = "Port Elizabeth",
42
+ Ceorci = "Ceorci",
43
+ Capetown1 = "Capetown 1",
44
+ Capetown2 = "Capetown2"
45
+ }
46
+ export declare const map: GameMap;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.map = exports.Cities = exports.Regions = void 0;
4
+ var Regions;
5
+ (function (Regions) {
6
+ Regions["Orange"] = "orange";
7
+ Regions["Green"] = "green";
8
+ Regions["Yellow"] = "yellow";
9
+ Regions["Brown"] = "brown";
10
+ Regions["Red"] = "red";
11
+ })(Regions = exports.Regions || (exports.Regions = {}));
12
+ var Cities;
13
+ (function (Cities) {
14
+ Cities["Zimbaswe"] = "Zimbaswe";
15
+ Cities["Musina"] = "Musina";
16
+ Cities["Botswana"] = "Botswana";
17
+ Cities["Polokwane"] = "Polokwane";
18
+ Cities["Pretoria1"] = "Pretoria 1";
19
+ Cities["Pretoria2"] = "Pretoria 2";
20
+ Cities["Rustenburc"] = "Rustenburc";
21
+ Cities["Mozambique"] = "Mozambique";
22
+ Cities["Mbombela"] = "Mbombela";
23
+ Cities["Iswaini"] = "Iswaini";
24
+ Cities["Germiston"] = "Germiston";
25
+ Cities["Johannesburg1"] = "Johannesburg 1";
26
+ Cities["Johannesburg2"] = "Johannesburg 2";
27
+ Cities["Ladysmith"] = "Ladysmith";
28
+ Cities["Abc"] = "Abc";
29
+ Cities["Def"] = "Def";
30
+ Cities["Ghi1"] = "Ghi 1";
31
+ Cities["Ghi2"] = "Ghi 2";
32
+ Cities["Jkl"] = "Jkl";
33
+ Cities["Mno"] = "Mno";
34
+ Cities["Qrs"] = "Qrs";
35
+ Cities["Keerksorp"] = "Keerksorp";
36
+ Cities["Weikom"] = "Weikom";
37
+ Cities["Xuruman"] = "Xuruman";
38
+ Cities["Kimberly"] = "Kimberly";
39
+ Cities["Upincion"] = "Upincion";
40
+ Cities["Sprincbom"] = "Sprincbom";
41
+ Cities["Namibia"] = "Namibia";
42
+ Cities["Deaar"] = "Deaar";
43
+ Cities["Beaufortwest"] = "Beaufort West";
44
+ Cities["Eastlondon"] = "East London";
45
+ Cities["Portelizabeth"] = "Port Elizabeth";
46
+ Cities["Ceorci"] = "Ceorci";
47
+ Cities["Capetown1"] = "Capetown 1";
48
+ Cities["Capetown2"] = "Capetown2";
49
+ })(Cities = exports.Cities || (exports.Cities = {}));
50
+ exports.map = {
51
+ name: 'South Africa',
52
+ cities: [
53
+ { name: Cities.Zimbaswe, region: Regions.Orange, x: 1060, y: 29 },
54
+ { name: Cities.Musina, region: Regions.Orange, x: 1027, y: 125 },
55
+ { name: Cities.Botswana, region: Regions.Orange, x: 665, y: 186 },
56
+ { name: Cities.Polokwane, region: Regions.Orange, x: 944, y: 188 },
57
+ { name: Cities.Pretoria1, region: Regions.Orange, x: 894, y: 271 },
58
+ { name: Cities.Pretoria2, region: Regions.Orange, x: 894, y: 306 },
59
+ { name: Cities.Rustenburc, region: Regions.Orange, x: 787, y: 327 },
60
+ { name: Cities.Mozambique, region: Regions.Green, x: 1184, y: 167 },
61
+ { name: Cities.Mbombela, region: Regions.Green, x: 1046, y: 287 },
62
+ { name: Cities.Iswaini, region: Regions.Green, x: 1086, y: 375 },
63
+ { name: Cities.Germiston, region: Regions.Green, x: 983, y: 375 },
64
+ { name: Cities.Johannesburg1, region: Regions.Green, x: 887, y: 365 },
65
+ { name: Cities.Johannesburg2, region: Regions.Green, x: 889, y: 398 },
66
+ { name: Cities.Ladysmith, region: Regions.Green, x: 968, y: 495 },
67
+ { name: Cities.Abc, region: Regions.Yellow, x: 1122, y: 521 },
68
+ { name: Cities.Def, region: Regions.Yellow, x: 1000, y: 558 },
69
+ { name: Cities.Ghi1, region: Regions.Yellow, x: 1049, y: 618 },
70
+ { name: Cities.Ghi2, region: Regions.Yellow, x: 1048, y: 651 },
71
+ { name: Cities.Jkl, region: Regions.Yellow, x: 931, y: 733 },
72
+ { name: Cities.Mno, region: Regions.Yellow, x: 894, y: 572 },
73
+ { name: Cities.Qrs, region: Regions.Yellow, x: 776, y: 556 },
74
+ { name: Cities.Keerksorp, region: Regions.Brown, x: 780, y: 387 },
75
+ { name: Cities.Weikom, region: Regions.Brown, x: 771, y: 467 },
76
+ { name: Cities.Xuruman, region: Regions.Brown, x: 595, y: 415 },
77
+ { name: Cities.Kimberly, region: Regions.Brown, x: 670, y: 541 },
78
+ { name: Cities.Upincion, region: Regions.Brown, x: 456, y: 492 },
79
+ { name: Cities.Sprincbom, region: Regions.Brown, x: 264, y: 580 },
80
+ { name: Cities.Namibia, region: Regions.Brown, x: 239, y: 329 },
81
+ { name: Cities.Deaar, region: Regions.Red, x: 641, y: 735 },
82
+ { name: Cities.Beaufortwest, region: Regions.Red, x: 513, y: 782 },
83
+ { name: Cities.Eastlondon, region: Regions.Red, x: 852, y: 833 },
84
+ { name: Cities.Portelizabeth, region: Regions.Red, x: 712, y: 903 },
85
+ { name: Cities.Ceorci, region: Regions.Red, x: 526, y: 903 },
86
+ { name: Cities.Capetown1, region: Regions.Red, x: 290, y: 871 },
87
+ { name: Cities.Capetown2, region: Regions.Red, x: 287, y: 904 },
88
+ ],
89
+ connections: [
90
+ { nodes: [Cities.Sprincbom, Cities.Namibia], cost: 30 },
91
+ { nodes: [Cities.Qrs, Cities.Mno], cost: 30 },
92
+ { nodes: [Cities.Germiston, Cities.Iswaini], cost: 30 },
93
+ { nodes: [Cities.Mbombela, Cities.Mozambique], cost: 30 },
94
+ { nodes: [Cities.Botswana, Cities.Rustenburc], cost: 30 },
95
+ { nodes: [Cities.Zimbaswe, Cities.Musina], cost: 30 },
96
+ { nodes: [Cities.Capetown2, Cities.Capetown1], cost: 0 },
97
+ { nodes: [Cities.Capetown2, Cities.Ceorci], cost: 16 },
98
+ { nodes: [Cities.Ceorci, Cities.Portelizabeth], cost: 12 },
99
+ { nodes: [Cities.Portelizabeth, Cities.Eastlondon], cost: 13 },
100
+ { nodes: [Cities.Eastlondon, Cities.Jkl], cost: 8 },
101
+ { nodes: [Cities.Jkl, Cities.Ghi2], cost: 13 },
102
+ { nodes: [Cities.Ghi2, Cities.Ghi1], cost: 0 },
103
+ { nodes: [Cities.Ghi1, Cities.Def], cost: 3 },
104
+ { nodes: [Cities.Ghi1, Cities.Abc], cost: 9 },
105
+ { nodes: [Cities.Abc, Cities.Def], cost: 9 },
106
+ { nodes: [Cities.Def, Cities.Ladysmith], cost: 5 },
107
+ { nodes: [Cities.Ladysmith, Cities.Abc], cost: 10 },
108
+ { nodes: [Cities.Qrs, Cities.Jkl], cost: 18 },
109
+ { nodes: [Cities.Qrs, Cities.Eastlondon], cost: 22 },
110
+ { nodes: [Cities.Eastlondon, Cities.Deaar], cost: 22 },
111
+ { nodes: [Cities.Deaar, Cities.Portelizabeth], cost: 18 },
112
+ { nodes: [Cities.Ceorci, Cities.Deaar], cost: 17 },
113
+ { nodes: [Cities.Deaar, Cities.Beaufortwest], cost: 10 },
114
+ { nodes: [Cities.Beaufortwest, Cities.Ceorci], cost: 8 },
115
+ { nodes: [Cities.Beaufortwest, Cities.Capetown1], cost: 22 },
116
+ { nodes: [Cities.Capetown1, Cities.Sprincbom], cost: 22 },
117
+ { nodes: [Cities.Sprincbom, Cities.Beaufortwest], cost: 24 },
118
+ { nodes: [Cities.Deaar, Cities.Sprincbom], cost: 26 },
119
+ { nodes: [Cities.Sprincbom, Cities.Upincion], cost: 16 },
120
+ { nodes: [Cities.Upincion, Cities.Deaar], cost: 16 },
121
+ { nodes: [Cities.Deaar, Cities.Qrs], cost: 13 },
122
+ { nodes: [Cities.Qrs, Cities.Kimberly], cost: 6 },
123
+ { nodes: [Cities.Kimberly, Cities.Deaar], cost: 10 },
124
+ { nodes: [Cities.Kimberly, Cities.Upincion], cost: 14 },
125
+ { nodes: [Cities.Kimberly, Cities.Weikom], cost: 9 },
126
+ { nodes: [Cities.Weikom, Cities.Qrs], cost: 6 },
127
+ { nodes: [Cities.Qrs, Cities.Ladysmith], cost: 19 },
128
+ { nodes: [Cities.Jkl, Cities.Def], cost: 12 },
129
+ { nodes: [Cities.Upincion, Cities.Xuruman], cost: 11 },
130
+ { nodes: [Cities.Musina, Cities.Polokwane], cost: 8 },
131
+ { nodes: [Cities.Polokwane, Cities.Pretoria1], cost: 11 },
132
+ { nodes: [Cities.Pretoria1, Cities.Pretoria2], cost: 0 },
133
+ { nodes: [Cities.Pretoria2, Cities.Johannesburg1], cost: 2 },
134
+ { nodes: [Cities.Johannesburg1, Cities.Johannesburg2], cost: 0 },
135
+ { nodes: [Cities.Johannesburg2, Cities.Germiston], cost: 1 },
136
+ { nodes: [Cities.Johannesburg1, Cities.Mbombela], cost: 13 },
137
+ { nodes: [Cities.Mbombela, Cities.Germiston], cost: 13 },
138
+ { nodes: [Cities.Pretoria1, Cities.Mbombela], cost: 13 },
139
+ { nodes: [Cities.Mbombela, Cities.Polokwane], cost: 10 },
140
+ { nodes: [Cities.Musina, Cities.Mbombela], cost: 15 },
141
+ { nodes: [Cities.Pretoria1, Cities.Rustenburc], cost: 4 },
142
+ { nodes: [Cities.Rustenburc, Cities.Johannesburg1], cost: 4 },
143
+ { nodes: [Cities.Johannesburg1, Cities.Keerksorp], cost: 7 },
144
+ { nodes: [Cities.Keerksorp, Cities.Weikom], cost: 5 },
145
+ { nodes: [Cities.Qrs, Cities.Johannesburg2], cost: 16 },
146
+ { nodes: [Cities.Xuruman, Cities.Rustenburc], cost: 18 },
147
+ { nodes: [Cities.Keerksorp, Cities.Xuruman], cost: 12 },
148
+ { nodes: [Cities.Xuruman, Cities.Kimberly], cost: 8 },
149
+ { nodes: [Cities.Johannesburg2, Cities.Ladysmith], cost: 13 },
150
+ { nodes: [Cities.Ladysmith, Cities.Germiston], cost: 13 },
151
+ ],
152
+ };
@@ -0,0 +1,54 @@
1
+ import { GameMap } from './../maps';
2
+ export declare enum Regions {
3
+ Pink = "pink",
4
+ Brown = "brown",
5
+ Green = "green",
6
+ Purple = "purple",
7
+ Red = "red",
8
+ Yellow = "yellow"
9
+ }
10
+ export declare enum Cities {
11
+ Gerona = "Gerona",
12
+ Barcelona = "Barcelona",
13
+ Tarragona = "Tarragona",
14
+ Lerida = "Lerida",
15
+ Castellondelaplana = "Castellon De La Plana",
16
+ Valencia = "Valencia",
17
+ Alicante = "Alicante",
18
+ Sansebastian = "San Sebastian",
19
+ Pamplona = "Pamplona",
20
+ Zaragoza = "Zaragoza",
21
+ Madrid = "Madrid",
22
+ Logrono = "Logrono",
23
+ Bilbao = "Bilbao",
24
+ Santander = "Santander",
25
+ Gijon = "Gijon",
26
+ Leon = "Leon",
27
+ Valladolid = "Valladolid",
28
+ Salamanca = "Salamanca",
29
+ Orense = "Orense",
30
+ Lacoruna = "La Coruna",
31
+ Santiagodecompostela = "Santiago De Compostela",
32
+ Cuenca = "Cuenca",
33
+ Albacete = "Albacete",
34
+ Murcia = "Murcia",
35
+ Toledo = "Toledo",
36
+ Ciudadreal = "Ciudad Real",
37
+ Caceres = "Caceres",
38
+ Merida = "Merida",
39
+ Almeria = "Almeria",
40
+ Granada = "Granada",
41
+ Cordoba = "Cordoba",
42
+ Malaga = "Malaga",
43
+ Cadiz = "Cadiz",
44
+ Sevilla = "Sevilla",
45
+ Huelva = "Huelva",
46
+ Evora = "Evora",
47
+ Faro = "Faro",
48
+ Portimao = "Portimao",
49
+ Setubal = "Setubal",
50
+ Lisboa = "Lisboa",
51
+ Porto = "Porto",
52
+ Braga = "Braga"
53
+ }
54
+ export declare const map: GameMap;