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,54 @@
1
+ import { GameMap } from './../maps';
2
+ export declare enum Regions {
3
+ Pink = "pink",
4
+ Green = "green",
5
+ Red = "red",
6
+ Brown = "brown",
7
+ Purple = "purple",
8
+ Yellow = "yellow"
9
+ }
10
+ export declare enum Cities {
11
+ Hegang = "Hegang",
12
+ Qiqhaer = "Qiqhaer",
13
+ Haerbin = "Haerbin",
14
+ Jilin = "Jilin",
15
+ Fushun = "Fushun",
16
+ Anshan = "Anshan",
17
+ Dalian = "Dalian",
18
+ Shanghai = "Shanghai",
19
+ Hangzhou = "Hangzhou",
20
+ Nanjing = "Nanjing",
21
+ Qingoad = "Qingoad",
22
+ Jinan = "Jinan",
23
+ Zhengzhou = "Zhengzhou",
24
+ Shijiazhuang = "Shijiazhuang",
25
+ Changchun = "Changchun",
26
+ Shenyang = "Shenyang",
27
+ Tangshan = "Tangshan",
28
+ Tianjin = "Tianjin",
29
+ Beijing = "Beijing",
30
+ Taiyuan = "Taiyuan",
31
+ Badtou = "Badtou",
32
+ Fuzhou = "Fuzhou",
33
+ Nanchang = "Nanchang",
34
+ Chaozhou = "Chaozhou",
35
+ Hongkong = "Hong Kong",
36
+ Guangzhou = "Guangzhou",
37
+ Changsha = "Changsha",
38
+ Wuhan = "Wuhan",
39
+ Hami = "Hami",
40
+ Karamay = "Karamay",
41
+ Wulumuqi = "Wulumuqi",
42
+ Kuerle = "Kuerle",
43
+ Yinchjan = "Yinchjan",
44
+ Xining = "Xining",
45
+ Lanzhou = "Lanzhou",
46
+ Kunming = "Kunming",
47
+ Chengou = "Chengou",
48
+ Xian = "Xian",
49
+ Chongqing = "Chongqing",
50
+ Nanning = "Nanning",
51
+ Haikou = "Haikou",
52
+ Chiyang = "Chiyang"
53
+ }
54
+ export declare const map: GameMap;
@@ -0,0 +1,262 @@
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 gamestate_1 = require("../gamestate");
6
+ const powerPlants_1 = require("../powerPlants");
7
+ const utils_1 = require("../utils");
8
+ var Regions;
9
+ (function (Regions) {
10
+ Regions["Pink"] = "pink";
11
+ Regions["Green"] = "green";
12
+ Regions["Red"] = "red";
13
+ Regions["Brown"] = "brown";
14
+ Regions["Purple"] = "purple";
15
+ Regions["Yellow"] = "yellow";
16
+ })(Regions = exports.Regions || (exports.Regions = {}));
17
+ var Cities;
18
+ (function (Cities) {
19
+ Cities["Hegang"] = "Hegang";
20
+ Cities["Qiqhaer"] = "Qiqhaer";
21
+ Cities["Haerbin"] = "Haerbin";
22
+ Cities["Jilin"] = "Jilin";
23
+ Cities["Fushun"] = "Fushun";
24
+ Cities["Anshan"] = "Anshan";
25
+ Cities["Dalian"] = "Dalian";
26
+ Cities["Shanghai"] = "Shanghai";
27
+ Cities["Hangzhou"] = "Hangzhou";
28
+ Cities["Nanjing"] = "Nanjing";
29
+ Cities["Qingoad"] = "Qingoad";
30
+ Cities["Jinan"] = "Jinan";
31
+ Cities["Zhengzhou"] = "Zhengzhou";
32
+ Cities["Shijiazhuang"] = "Shijiazhuang";
33
+ Cities["Changchun"] = "Changchun";
34
+ Cities["Shenyang"] = "Shenyang";
35
+ Cities["Tangshan"] = "Tangshan";
36
+ Cities["Tianjin"] = "Tianjin";
37
+ Cities["Beijing"] = "Beijing";
38
+ Cities["Taiyuan"] = "Taiyuan";
39
+ Cities["Badtou"] = "Badtou";
40
+ Cities["Fuzhou"] = "Fuzhou";
41
+ Cities["Nanchang"] = "Nanchang";
42
+ Cities["Chaozhou"] = "Chaozhou";
43
+ Cities["Hongkong"] = "Hong Kong";
44
+ Cities["Guangzhou"] = "Guangzhou";
45
+ Cities["Changsha"] = "Changsha";
46
+ Cities["Wuhan"] = "Wuhan";
47
+ Cities["Hami"] = "Hami";
48
+ Cities["Karamay"] = "Karamay";
49
+ Cities["Wulumuqi"] = "Wulumuqi";
50
+ Cities["Kuerle"] = "Kuerle";
51
+ Cities["Yinchjan"] = "Yinchjan";
52
+ Cities["Xining"] = "Xining";
53
+ Cities["Lanzhou"] = "Lanzhou";
54
+ Cities["Kunming"] = "Kunming";
55
+ Cities["Chengou"] = "Chengou";
56
+ Cities["Xian"] = "Xian";
57
+ Cities["Chongqing"] = "Chongqing";
58
+ Cities["Nanning"] = "Nanning";
59
+ Cities["Haikou"] = "Haikou";
60
+ Cities["Chiyang"] = "Chiyang";
61
+ })(Cities = exports.Cities || (exports.Cities = {}));
62
+ exports.map = {
63
+ name: 'China',
64
+ cities: [
65
+ { name: Cities.Hegang, region: Regions.Pink, x: 3920, y: 290 },
66
+ { name: Cities.Qiqhaer, region: Regions.Pink, x: 3422, y: 262 },
67
+ { name: Cities.Haerbin, region: Regions.Pink, x: 3672, y: 434 },
68
+ { name: Cities.Jilin, region: Regions.Pink, x: 3744, y: 614 },
69
+ { name: Cities.Fushun, region: Regions.Pink, x: 3712, y: 784 },
70
+ { name: Cities.Anshan, region: Regions.Pink, x: 3510, y: 902 },
71
+ { name: Cities.Dalian, region: Regions.Pink, x: 3424, y: 1052 },
72
+ { name: Cities.Shanghai, region: Regions.Green, x: 3462, y: 1672 },
73
+ { name: Cities.Hangzhou, region: Regions.Green, x: 3280, y: 1824 },
74
+ { name: Cities.Nanjing, region: Regions.Green, x: 3130, y: 1632 },
75
+ { name: Cities.Qingoad, region: Regions.Green, x: 3322, y: 1316 },
76
+ { name: Cities.Jinan, region: Regions.Green, x: 3002, y: 1292 },
77
+ { name: Cities.Zhengzhou, region: Regions.Green, x: 2778, y: 1438 },
78
+ { name: Cities.Shijiazhuang, region: Regions.Green, x: 2866, y: 1152 },
79
+ { name: Cities.Changchun, region: Regions.Red, x: 3504, y: 590 },
80
+ { name: Cities.Shenyang, region: Regions.Red, x: 3458, y: 778 },
81
+ { name: Cities.Tangshan, region: Regions.Red, x: 3158, y: 908 },
82
+ { name: Cities.Tianjin, region: Regions.Red, x: 3134, y: 1016 },
83
+ { name: Cities.Beijing, region: Regions.Red, x: 2886, y: 910 },
84
+ { name: Cities.Taiyuan, region: Regions.Red, x: 2588, y: 1130 },
85
+ { name: Cities.Badtou, region: Regions.Red, x: 2500, y: 862 },
86
+ { name: Cities.Fuzhou, region: Regions.Brown, x: 3290, y: 2132 },
87
+ { name: Cities.Nanchang, region: Regions.Brown, x: 3004, y: 1974 },
88
+ { name: Cities.Chaozhou, region: Regions.Brown, x: 3096, y: 2322 },
89
+ { name: Cities.Hongkong, region: Regions.Brown, x: 2902, y: 2552 },
90
+ { name: Cities.Guangzhou, region: Regions.Brown, x: 2694, y: 2352 },
91
+ { name: Cities.Changsha, region: Regions.Brown, x: 2682, y: 1988 },
92
+ { name: Cities.Wuhan, region: Regions.Brown, x: 2810, y: 1786 },
93
+ { name: Cities.Hami, region: Regions.Purple, x: 1816, y: 698 },
94
+ { name: Cities.Karamay, region: Regions.Purple, x: 1304, y: 372 },
95
+ { name: Cities.Wulumuqi, region: Regions.Purple, x: 1520, y: 558 },
96
+ { name: Cities.Kuerle, region: Regions.Purple, x: 1326, y: 756 },
97
+ { name: Cities.Yinchjan, region: Regions.Purple, x: 2208, y: 1058 },
98
+ { name: Cities.Xining, region: Regions.Purple, x: 1868, y: 1226 },
99
+ { name: Cities.Lanzhou, region: Regions.Purple, x: 2142, y: 1328 },
100
+ { name: Cities.Kunming, region: Regions.Yellow, x: 1840, y: 2248 },
101
+ { name: Cities.Chengou, region: Regions.Yellow, x: 1988, y: 1736 },
102
+ { name: Cities.Xian, region: Regions.Yellow, x: 2440, y: 1478 },
103
+ { name: Cities.Chongqing, region: Regions.Yellow, x: 2300, y: 1880 },
104
+ { name: Cities.Nanning, region: Regions.Yellow, x: 2318, y: 2452 },
105
+ { name: Cities.Haikou, region: Regions.Yellow, x: 2524, y: 2680 },
106
+ { name: Cities.Chiyang, region: Regions.Yellow, x: 2212, y: 2112 },
107
+ ],
108
+ connections: [
109
+ { nodes: [Cities.Kunming, Cities.Chengou], cost: 16 },
110
+ { nodes: [Cities.Nanning, Cities.Haikou], cost: 10 },
111
+ { nodes: [Cities.Guangzhou, Cities.Hongkong], cost: 4 },
112
+ { nodes: [Cities.Guangzhou, Cities.Chaozhou], cost: 7 },
113
+ { nodes: [Cities.Chaozhou, Cities.Hongkong], cost: 7 },
114
+ { nodes: [Cities.Guangzhou, Cities.Haikou], cost: 13 },
115
+ { nodes: [Cities.Nanning, Cities.Guangzhou], cost: 11 },
116
+ { nodes: [Cities.Xining, Cities.Chengou], cost: 20 },
117
+ { nodes: [Cities.Chengou, Cities.Chongqing], cost: 6 },
118
+ { nodes: [Cities.Chongqing, Cities.Chiyang], cost: 9 },
119
+ { nodes: [Cities.Chiyang, Cities.Kunming], cost: 12 },
120
+ { nodes: [Cities.Chiyang, Cities.Nanning], cost: 12 },
121
+ { nodes: [Cities.Chiyang, Cities.Guangzhou], cost: 18 },
122
+ { nodes: [Cities.Guangzhou, Cities.Changsha], cost: 14 },
123
+ { nodes: [Cities.Changsha, Cities.Chongqing], cost: 16 },
124
+ { nodes: [Cities.Changsha, Cities.Wuhan], cost: 6 },
125
+ { nodes: [Cities.Wuhan, Cities.Nanchang], cost: 6 },
126
+ { nodes: [Cities.Nanchang, Cities.Changsha], cost: 7 },
127
+ { nodes: [Cities.Changsha, Cities.Chiyang], cost: 15 },
128
+ { nodes: [Cities.Chiyang, Cities.Chengou], cost: 13 },
129
+ { nodes: [Cities.Guangzhou, Cities.Nanchang], cost: 16 },
130
+ { nodes: [Cities.Nanchang, Cities.Chaozhou], cost: 14 },
131
+ { nodes: [Cities.Chaozhou, Cities.Fuzhou], cost: 9 },
132
+ { nodes: [Cities.Fuzhou, Cities.Nanchang], cost: 13 },
133
+ { nodes: [Cities.Wuhan, Cities.Hangzhou], cost: 13 },
134
+ { nodes: [Cities.Hangzhou, Cities.Fuzhou], cost: 13 },
135
+ { nodes: [Cities.Hangzhou, Cities.Shanghai], cost: 4 },
136
+ { nodes: [Cities.Shanghai, Cities.Nanjing], cost: 6 },
137
+ { nodes: [Cities.Nanjing, Cities.Hangzhou], cost: 5 },
138
+ { nodes: [Cities.Hangzhou, Cities.Nanchang], cost: 10 },
139
+ { nodes: [Cities.Chongqing, Cities.Wuhan], cost: 18 },
140
+ { nodes: [Cities.Lanzhou, Cities.Chengou], cost: 16 },
141
+ { nodes: [Cities.Chengou, Cities.Xian], cost: 14 },
142
+ { nodes: [Cities.Xian, Cities.Chongqing], cost: 14 },
143
+ { nodes: [Cities.Xian, Cities.Wuhan], cost: 15 },
144
+ { nodes: [Cities.Wuhan, Cities.Zhengzhou], cost: 10 },
145
+ { nodes: [Cities.Zhengzhou, Cities.Xian], cost: 10 },
146
+ { nodes: [Cities.Xian, Cities.Lanzhou], cost: 15 },
147
+ { nodes: [Cities.Lanzhou, Cities.Yinchjan], cost: 9 },
148
+ { nodes: [Cities.Yinchjan, Cities.Xining], cost: 11 },
149
+ { nodes: [Cities.Lanzhou, Cities.Taiyuan], cost: 18 },
150
+ { nodes: [Cities.Taiyuan, Cities.Xian], cost: 12 },
151
+ { nodes: [Cities.Taiyuan, Cities.Zhengzhou], cost: 11 },
152
+ { nodes: [Cities.Taiyuan, Cities.Shijiazhuang], cost: 5 },
153
+ { nodes: [Cities.Shijiazhuang, Cities.Tianjin], cost: 5 },
154
+ { nodes: [Cities.Shijiazhuang, Cities.Jinan], cost: 6 },
155
+ { nodes: [Cities.Shijiazhuang, Cities.Zhengzhou], cost: 9 },
156
+ { nodes: [Cities.Zhengzhou, Cities.Jinan], cost: 7 },
157
+ { nodes: [Cities.Zhengzhou, Cities.Nanjing], cost: 12 },
158
+ { nodes: [Cities.Nanjing, Cities.Wuhan], cost: 10 },
159
+ { nodes: [Cities.Jinan, Cities.Nanjing], cost: 11 },
160
+ { nodes: [Cities.Nanjing, Cities.Qingoad], cost: 12 },
161
+ { nodes: [Cities.Qingoad, Cities.Jinan], cost: 6 },
162
+ { nodes: [Cities.Jinan, Cities.Tianjin], cost: 6 },
163
+ { nodes: [Cities.Xining, Cities.Lanzhou], cost: 6 },
164
+ { nodes: [Cities.Yinchjan, Cities.Badtou], cost: 9 },
165
+ { nodes: [Cities.Badtou, Cities.Taiyuan], cost: 9 },
166
+ { nodes: [Cities.Taiyuan, Cities.Yinchjan], cost: 14 },
167
+ { nodes: [Cities.Yinchjan, Cities.Hami], cost: 25 },
168
+ { nodes: [Cities.Hami, Cities.Xining], cost: 25 },
169
+ { nodes: [Cities.Wulumuqi, Cities.Kuerle], cost: 9 },
170
+ { nodes: [Cities.Kuerle, Cities.Karamay], cost: 12 },
171
+ { nodes: [Cities.Karamay, Cities.Wulumuqi], cost: 7 },
172
+ { nodes: [Cities.Wulumuqi, Cities.Hami], cost: 12 },
173
+ { nodes: [Cities.Hami, Cities.Kuerle], cost: 15 },
174
+ { nodes: [Cities.Taiyuan, Cities.Beijing], cost: 10 },
175
+ { nodes: [Cities.Beijing, Cities.Shijiazhuang], cost: 6 },
176
+ { nodes: [Cities.Beijing, Cities.Tangshan], cost: 3 },
177
+ { nodes: [Cities.Tangshan, Cities.Tianjin], cost: 0 },
178
+ { nodes: [Cities.Beijing, Cities.Badtou], cost: 14 },
179
+ { nodes: [Cities.Tangshan, Cities.Shenyang], cost: 11 },
180
+ { nodes: [Cities.Dalian, Cities.Anshan], cost: 6 },
181
+ { nodes: [Cities.Qiqhaer, Cities.Hegang], cost: 11 },
182
+ { nodes: [Cities.Hegang, Cities.Haerbin], cost: 7 },
183
+ { nodes: [Cities.Haerbin, Cities.Qiqhaer], cost: 6 },
184
+ { nodes: [Cities.Changchun, Cities.Jilin], cost: 5 },
185
+ { nodes: [Cities.Jilin, Cities.Haerbin], cost: 5 },
186
+ { nodes: [Cities.Haerbin, Cities.Changchun], cost: 5 },
187
+ { nodes: [Cities.Changchun, Cities.Shenyang], cost: 5 },
188
+ { nodes: [Cities.Shenyang, Cities.Anshan], cost: 2 },
189
+ { nodes: [Cities.Jilin, Cities.Fushun], cost: 6 },
190
+ { nodes: [Cities.Fushun, Cities.Shenyang], cost: 0 },
191
+ { nodes: [Cities.Changchun, Cities.Qiqhaer], cost: 9 },
192
+ ],
193
+ layout: 'Portrait',
194
+ mapPosition: [-400, 70],
195
+ adjustRatio: [0.35, 0.35],
196
+ resupply: [
197
+ [
198
+ [4, 4, 3],
199
+ [5, 5, 3],
200
+ [6, 6, 4],
201
+ [7, 7, 5],
202
+ [9, 9, 6],
203
+ ],
204
+ [
205
+ [2, 2, 4],
206
+ [3, 3, 4],
207
+ [4, 4, 5],
208
+ [5, 5, 6],
209
+ [6, 6, 7],
210
+ ],
211
+ [
212
+ [2, 2, 1],
213
+ [2, 2, 1],
214
+ [3, 3, 2],
215
+ [3, 3, 3],
216
+ [5, 5, 3],
217
+ ],
218
+ [
219
+ [1, 1, 1],
220
+ [1, 1, 1],
221
+ [2, 2, 2],
222
+ [3, 3, 2],
223
+ [3, 3, 3],
224
+ ],
225
+ ],
226
+ startingResources: [12, 12, 6, 0],
227
+ setupDeck(numPlayers, variant, rng) {
228
+ /* Instructions for power plant setup:
229
+ Depending on the number of players, remove the following power plants from the game and place them in the box:
230
+ with 2 and 3 players: 3, 4, 9, 11, 16, 18, 20, 24, 30, 33, 46.
231
+ with 4 players: 3, 4, 11, 18, 24, 33, 46.
232
+ with 5 and 6 players: 3, 4, 33.
233
+ Sort the remaining power plants as described below and place them as a face-down supply:
234
+ plants 36– 50: shuffle and place face-down at the bottom of the supply
235
+ plants 31–35: (naturally without 33) shuffle along with the step 3 card and place face-down on top of the higher numbers
236
+ already placed on the supply
237
+ plants 5 – 30: sort in ascending order with 30 on the bottom and 5 on the top and place face-down on the supply
238
+ */
239
+ const allPlants = lodash_1.cloneDeep(powerPlants_1.powerPlants);
240
+ let plantsToRemove = [];
241
+ if (numPlayers == 2 || numPlayers == 3) {
242
+ plantsToRemove = [3, 4, 9, 11, 16, 18, 20, 24, 30, 33, 46];
243
+ }
244
+ else if (numPlayers == 4) {
245
+ plantsToRemove = [3, 4, 11, 18, 24, 33, 46];
246
+ }
247
+ else if (numPlayers == 5 || numPlayers == 6) {
248
+ plantsToRemove = [3, 4, 33];
249
+ }
250
+ const filteredPlants = allPlants.filter((p) => !plantsToRemove.includes(p.number));
251
+ const lowPlants = filteredPlants.filter((p) => p.number <= 30);
252
+ const step3Card = filteredPlants.filter((p) => p.type == gamestate_1.PowerPlantType.Step3);
253
+ const middlePlants = utils_1.shuffle(filteredPlants.filter((p) => p.number >= 31 && p.number <= 35).concat(step3Card), rng() + '');
254
+ const highPlants = utils_1.shuffle(filteredPlants.filter((p) => p.number >= 36 && p.number <= 50), rng() + '');
255
+ // In round 1, the number of plants available is equal to the number of players.
256
+ const actualMarket = lowPlants.splice(0, numPlayers);
257
+ const futureMarket = [];
258
+ const powerPlantsDeck = lowPlants.concat(middlePlants).concat(highPlants);
259
+ return { actualMarket, futureMarket, powerPlantsDeck };
260
+ },
261
+ mapSpecificRules: 'The power plant deck is arranged as follows: plants from 3-30 in order, plants from 31-35 and step 3 card shuffled, plants from 36-50 shuffled.\nThe same set of plants are removed in every game.\nThere are several changes to when new plants are drawn. In particular, during steps 1 and 2, plants are only drawn from the deck during the bureaucracy phase.',
262
+ };
@@ -0,0 +1,54 @@
1
+ import { GameMap } from './../maps';
2
+ export declare enum Regions {
3
+ Brown = "brown",
4
+ Purple = "purple",
5
+ Blue = "blue",
6
+ Yellow = "yellow",
7
+ Green = "green",
8
+ Red = "red"
9
+ }
10
+ export declare enum Cities {
11
+ Calais = "Calais",
12
+ Lile = "Lile",
13
+ Amiens = "Amiens",
14
+ Reims = "Reims",
15
+ Metz = "Metz",
16
+ Nancy = "Nancy",
17
+ Strasbourg = "Strasbourg",
18
+ Havre = "Havre",
19
+ Caen = "Caen",
20
+ Brest = "Brest",
21
+ Rennes = "Rennes",
22
+ Lemans = "Le Mans",
23
+ Angers = "Angers",
24
+ Rouen = "Rouen",
25
+ Paris1 = "Paris 1",
26
+ Paris2 = "Paris 2",
27
+ Paris3 = "Paris 3",
28
+ Orleans = "Orleans",
29
+ Tours = "Tours",
30
+ Limoges = "Limoges",
31
+ Clermontferrand = "Clermont-Ferrand",
32
+ Besancon = "Besancon",
33
+ Dijon = "Dijon",
34
+ Lyon = "Lyon",
35
+ Chamonix = "Chamonix",
36
+ Mulhouse = "Mulhouse",
37
+ Grenoble = "Grenoble",
38
+ Saintetienne = "Saint-Etienne",
39
+ Nice = "Nice",
40
+ Toulon = "Toulon",
41
+ Aimenprovence = "Aim-En-Provence",
42
+ Marseille = "Marseille",
43
+ Nimes = "Nimes",
44
+ Montpellier = "Montpellier",
45
+ Perpignan = "Perpignan",
46
+ Nantes = "Nantes",
47
+ Larochelle = "La Rochelle",
48
+ Bordeaux = "Bordeaux",
49
+ Biarritz = "Biarritz",
50
+ Toulous = "Toulous",
51
+ Carcassone = "Carcas Sone",
52
+ Lourdes = "Lourdes"
53
+ }
54
+ export declare const map: GameMap;
@@ -0,0 +1,290 @@
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 utils_1 = require("../utils");
7
+ const powerPlants_1 = require("./../powerPlants");
8
+ var Regions;
9
+ (function (Regions) {
10
+ Regions["Brown"] = "brown";
11
+ Regions["Purple"] = "purple";
12
+ Regions["Blue"] = "blue";
13
+ Regions["Yellow"] = "yellow";
14
+ Regions["Green"] = "green";
15
+ Regions["Red"] = "red";
16
+ })(Regions = exports.Regions || (exports.Regions = {}));
17
+ var Cities;
18
+ (function (Cities) {
19
+ Cities["Calais"] = "Calais";
20
+ Cities["Lile"] = "Lile";
21
+ Cities["Amiens"] = "Amiens";
22
+ Cities["Reims"] = "Reims";
23
+ Cities["Metz"] = "Metz";
24
+ Cities["Nancy"] = "Nancy";
25
+ Cities["Strasbourg"] = "Strasbourg";
26
+ Cities["Havre"] = "Havre";
27
+ Cities["Caen"] = "Caen";
28
+ Cities["Brest"] = "Brest";
29
+ Cities["Rennes"] = "Rennes";
30
+ Cities["Lemans"] = "Le Mans";
31
+ Cities["Angers"] = "Angers";
32
+ Cities["Rouen"] = "Rouen";
33
+ Cities["Paris1"] = "Paris 1";
34
+ Cities["Paris2"] = "Paris 2";
35
+ Cities["Paris3"] = "Paris 3";
36
+ Cities["Orleans"] = "Orleans";
37
+ Cities["Tours"] = "Tours";
38
+ Cities["Limoges"] = "Limoges";
39
+ Cities["Clermontferrand"] = "Clermont-Ferrand";
40
+ Cities["Besancon"] = "Besancon";
41
+ Cities["Dijon"] = "Dijon";
42
+ Cities["Lyon"] = "Lyon";
43
+ Cities["Chamonix"] = "Chamonix";
44
+ Cities["Mulhouse"] = "Mulhouse";
45
+ Cities["Grenoble"] = "Grenoble";
46
+ Cities["Saintetienne"] = "Saint-Etienne";
47
+ Cities["Nice"] = "Nice";
48
+ Cities["Toulon"] = "Toulon";
49
+ Cities["Aimenprovence"] = "Aim-En-Provence";
50
+ Cities["Marseille"] = "Marseille";
51
+ Cities["Nimes"] = "Nimes";
52
+ Cities["Montpellier"] = "Montpellier";
53
+ Cities["Perpignan"] = "Perpignan";
54
+ Cities["Nantes"] = "Nantes";
55
+ Cities["Larochelle"] = "La Rochelle";
56
+ Cities["Bordeaux"] = "Bordeaux";
57
+ Cities["Biarritz"] = "Biarritz";
58
+ Cities["Toulous"] = "Toulous";
59
+ Cities["Carcassone"] = "Carcas Sone";
60
+ Cities["Lourdes"] = "Lourdes";
61
+ })(Cities = exports.Cities || (exports.Cities = {}));
62
+ exports.map = {
63
+ name: 'France',
64
+ cities: [
65
+ { name: Cities.Calais, region: Regions.Brown, x: 661, y: 294 },
66
+ { name: Cities.Lile, region: Regions.Brown, x: 791, y: 328 },
67
+ { name: Cities.Amiens, region: Regions.Brown, x: 700, y: 433 },
68
+ { name: Cities.Reims, region: Regions.Brown, x: 888, y: 531 },
69
+ { name: Cities.Metz, region: Regions.Brown, x: 1076, y: 528 },
70
+ { name: Cities.Nancy, region: Regions.Brown, x: 1078, y: 643 },
71
+ { name: Cities.Strasbourg, region: Regions.Brown, x: 1208, y: 615 },
72
+ { name: Cities.Havre, region: Regions.Purple, x: 487, y: 471 },
73
+ { name: Cities.Caen, region: Regions.Purple, x: 423, y: 567 },
74
+ { name: Cities.Brest, region: Regions.Purple, x: 79, y: 654 },
75
+ { name: Cities.Rennes, region: Regions.Purple, x: 326, y: 695 },
76
+ { name: Cities.Lemans, region: Regions.Purple, x: 516, y: 699 },
77
+ { name: Cities.Angers, region: Regions.Purple, x: 446, y: 798 },
78
+ { name: Cities.Rouen, region: Regions.Purple, x: 598, y: 506 },
79
+ { name: Cities.Paris1, region: Regions.Blue, x: 693, y: 553 },
80
+ { name: Cities.Paris2, region: Regions.Blue, x: 779, y: 566 },
81
+ { name: Cities.Paris3, region: Regions.Blue, x: 722, y: 633 },
82
+ { name: Cities.Orleans, region: Regions.Blue, x: 684, y: 736 },
83
+ { name: Cities.Tours, region: Regions.Blue, x: 564, y: 813 },
84
+ { name: Cities.Limoges, region: Regions.Blue, x: 605, y: 1009 },
85
+ { name: Cities.Clermontferrand, region: Regions.Blue, x: 777, y: 1017 },
86
+ { name: Cities.Besancon, region: Regions.Yellow, x: 1084, y: 828 },
87
+ { name: Cities.Dijon, region: Regions.Yellow, x: 964, y: 801 },
88
+ { name: Cities.Lyon, region: Regions.Yellow, x: 964, y: 973 },
89
+ { name: Cities.Chamonix, region: Regions.Yellow, x: 1153, y: 987 },
90
+ { name: Cities.Mulhouse, region: Regions.Yellow, x: 1180, y: 742 },
91
+ { name: Cities.Grenoble, region: Regions.Yellow, x: 1048, y: 1116 },
92
+ { name: Cities.Saintetienne, region: Regions.Yellow, x: 892, y: 1088 },
93
+ { name: Cities.Nice, region: Regions.Green, x: 1178, y: 1302 },
94
+ { name: Cities.Toulon, region: Regions.Green, x: 1070, y: 1397 },
95
+ { name: Cities.Aimenprovence, region: Regions.Green, x: 1016, y: 1304 },
96
+ { name: Cities.Marseille, region: Regions.Green, x: 954, y: 1369 },
97
+ { name: Cities.Nimes, region: Regions.Green, x: 889, y: 1256 },
98
+ { name: Cities.Montpellier, region: Regions.Green, x: 816, y: 1330 },
99
+ { name: Cities.Perpignan, region: Regions.Green, x: 767, y: 1460 },
100
+ { name: Cities.Nantes, region: Regions.Red, x: 330, y: 833 },
101
+ { name: Cities.Larochelle, region: Regions.Red, x: 379, y: 959 },
102
+ { name: Cities.Bordeaux, region: Regions.Red, x: 435, y: 1148 },
103
+ { name: Cities.Biarritz, region: Regions.Red, x: 345, y: 1328 },
104
+ { name: Cities.Toulous, region: Regions.Red, x: 621, y: 1309 },
105
+ { name: Cities.Carcassone, region: Regions.Red, x: 700, y: 1382 },
106
+ { name: Cities.Lourdes, region: Regions.Red, x: 479, y: 1393 },
107
+ ],
108
+ connections: [
109
+ { nodes: [Cities.Calais, Cities.Havre], cost: 13 },
110
+ { nodes: [Cities.Calais, Cities.Lile], cost: 7 },
111
+ { nodes: [Cities.Calais, Cities.Amiens], cost: 8 },
112
+ { nodes: [Cities.Lile, Cities.Reims], cost: 9 },
113
+ { nodes: [Cities.Havre, Cities.Rouen], cost: 5 },
114
+ { nodes: [Cities.Havre, Cities.Caen], cost: 5 },
115
+ { nodes: [Cities.Caen, Cities.Rennes], cost: 12 },
116
+ { nodes: [Cities.Rennes, Cities.Brest], cost: 16 },
117
+ { nodes: [Cities.Brest, Cities.Nantes], cost: 19 },
118
+ { nodes: [Cities.Rennes, Cities.Nantes], cost: 7 },
119
+ { nodes: [Cities.Rennes, Cities.Angers], cost: 7 },
120
+ { nodes: [Cities.Rennes, Cities.Lemans], cost: 9 },
121
+ { nodes: [Cities.Caen, Cities.Lemans], cost: 10 },
122
+ { nodes: [Cities.Lemans, Cities.Paris3], cost: 10 },
123
+ { nodes: [Cities.Paris3, Cities.Caen], cost: 12 },
124
+ { nodes: [Cities.Caen, Cities.Rouen], cost: 9 },
125
+ { nodes: [Cities.Rouen, Cities.Paris1], cost: 9 },
126
+ { nodes: [Cities.Rouen, Cities.Amiens], cost: 6 },
127
+ { nodes: [Cities.Lile, Cities.Amiens], cost: 7 },
128
+ { nodes: [Cities.Amiens, Cities.Reims], cost: 11 },
129
+ { nodes: [Cities.Reims, Cities.Metz], cost: 12 },
130
+ { nodes: [Cities.Metz, Cities.Strasbourg], cost: 11 },
131
+ { nodes: [Cities.Strasbourg, Cities.Nancy], cost: 10 },
132
+ { nodes: [Cities.Strasbourg, Cities.Mulhouse], cost: 6 },
133
+ { nodes: [Cities.Mulhouse, Cities.Besancon], cost: 8 },
134
+ { nodes: [Cities.Besancon, Cities.Nancy], cost: 14 },
135
+ { nodes: [Cities.Nancy, Cities.Dijon], cost: 15 },
136
+ { nodes: [Cities.Reims, Cities.Nancy], cost: 13 },
137
+ { nodes: [Cities.Nancy, Cities.Paris2], cost: 21 },
138
+ { nodes: [Cities.Paris1, Cities.Paris2], cost: 0 },
139
+ { nodes: [Cities.Paris1, Cities.Paris3], cost: 0 },
140
+ { nodes: [Cities.Paris2, Cities.Dijon], cost: 20 },
141
+ { nodes: [Cities.Dijon, Cities.Orleans], cost: 18 },
142
+ { nodes: [Cities.Orleans, Cities.Lemans], cost: 8 },
143
+ { nodes: [Cities.Lemans, Cities.Tours], cost: 5 },
144
+ { nodes: [Cities.Tours, Cities.Orleans], cost: 7 },
145
+ { nodes: [Cities.Paris1, Cities.Amiens], cost: 9 },
146
+ { nodes: [Cities.Dijon, Cities.Clermontferrand], cost: 19 },
147
+ { nodes: [Cities.Clermontferrand, Cities.Limoges], cost: 12 },
148
+ { nodes: [Cities.Limoges, Cities.Toulous], cost: 19 },
149
+ { nodes: [Cities.Toulous, Cities.Clermontferrand], cost: 24 },
150
+ { nodes: [Cities.Clermontferrand, Cities.Montpellier], cost: 22 },
151
+ { nodes: [Cities.Montpellier, Cities.Nimes], cost: 3 },
152
+ { nodes: [Cities.Saintetienne, Cities.Grenoble], cost: 10 },
153
+ { nodes: [Cities.Grenoble, Cities.Chamonix], cost: 12 },
154
+ { nodes: [Cities.Chamonix, Cities.Besancon], cost: 19 },
155
+ { nodes: [Cities.Besancon, Cities.Dijon], cost: 6 },
156
+ { nodes: [Cities.Dijon, Cities.Lyon], cost: 13 },
157
+ { nodes: [Cities.Lyon, Cities.Clermontferrand], cost: 11 },
158
+ { nodes: [Cities.Saintetienne, Cities.Montpellier], cost: 18 },
159
+ { nodes: [Cities.Saintetienne, Cities.Nimes], cost: 16 },
160
+ { nodes: [Cities.Nimes, Cities.Aimenprovence], cost: 8 },
161
+ { nodes: [Cities.Aimenprovence, Cities.Nice], cost: 8 },
162
+ { nodes: [Cities.Nice, Cities.Toulon], cost: 7 },
163
+ { nodes: [Cities.Toulon, Cities.Marseille], cost: 3 },
164
+ { nodes: [Cities.Marseille, Cities.Aimenprovence], cost: 0 },
165
+ { nodes: [Cities.Nice, Cities.Grenoble], cost: 19 },
166
+ { nodes: [Cities.Grenoble, Cities.Aimenprovence], cost: 17 },
167
+ { nodes: [Cities.Grenoble, Cities.Nimes], cost: 18 },
168
+ { nodes: [Cities.Montpellier, Cities.Toulous], cost: 14 },
169
+ { nodes: [Cities.Toulous, Cities.Bordeaux], cost: 14 },
170
+ { nodes: [Cities.Bordeaux, Cities.Limoges], cost: 13 },
171
+ { nodes: [Cities.Limoges, Cities.Tours], cost: 13 },
172
+ { nodes: [Cities.Tours, Cities.Larochelle], cost: 13 },
173
+ { nodes: [Cities.Larochelle, Cities.Angers], cost: 12 },
174
+ { nodes: [Cities.Angers, Cities.Lemans], cost: 5 },
175
+ { nodes: [Cities.Angers, Cities.Nantes], cost: 5 },
176
+ { nodes: [Cities.Nantes, Cities.Larochelle], cost: 9 },
177
+ { nodes: [Cities.Larochelle, Cities.Bordeaux], cost: 13 },
178
+ { nodes: [Cities.Bordeaux, Cities.Biarritz], cost: 12 },
179
+ { nodes: [Cities.Bordeaux, Cities.Lourdes], cost: 14 },
180
+ { nodes: [Cities.Lourdes, Cities.Biarritz], cost: 9 },
181
+ { nodes: [Cities.Lourdes, Cities.Toulous], cost: 10 },
182
+ { nodes: [Cities.Lourdes, Cities.Carcassone], cost: 15 },
183
+ { nodes: [Cities.Lourdes, Cities.Perpignan], cost: 20 },
184
+ { nodes: [Cities.Perpignan, Cities.Carcassone], cost: 6 },
185
+ { nodes: [Cities.Carcassone, Cities.Toulous], cost: 6 },
186
+ { nodes: [Cities.Carcassone, Cities.Montpellier], cost: 9 },
187
+ { nodes: [Cities.Montpellier, Cities.Perpignan], cost: 11 },
188
+ { nodes: [Cities.Orleans, Cities.Limoges], cost: 19 },
189
+ { nodes: [Cities.Orleans, Cities.Clermontferrand], cost: 18 },
190
+ { nodes: [Cities.Paris3, Cities.Orleans], cost: 7 },
191
+ { nodes: [Cities.Angers, Cities.Tours], cost: 6 },
192
+ { nodes: [Cities.Larochelle, Cities.Limoges], cost: 13 },
193
+ { nodes: [Cities.Nancy, Cities.Metz], cost: 3 },
194
+ { nodes: [Cities.Nancy, Cities.Mulhouse], cost: 12 },
195
+ { nodes: [Cities.Besancon, Cities.Lyon], cost: 16 },
196
+ { nodes: [Cities.Lyon, Cities.Grenoble], cost: 7 },
197
+ { nodes: [Cities.Lyon, Cities.Chamonix], cost: 13 },
198
+ { nodes: [Cities.Lyon, Cities.Saintetienne], cost: 6 },
199
+ { nodes: [Cities.Saintetienne, Cities.Clermontferrand], cost: 10 },
200
+ { nodes: [Cities.Paris2, Cities.Reims], cost: 9 },
201
+ { nodes: [Cities.Paris3, Cities.Paris2], cost: 0 },
202
+ ],
203
+ layout: 'Portrait',
204
+ mapPosition: [50, -100],
205
+ adjustRatio: [0.7, 0.7],
206
+ resupply: [
207
+ [
208
+ [3, 4, 3],
209
+ [4, 5, 3],
210
+ [5, 6, 4],
211
+ [5, 7, 5],
212
+ [7, 9, 6],
213
+ ],
214
+ [
215
+ [2, 2, 4],
216
+ [2, 3, 4],
217
+ [3, 4, 5],
218
+ [4, 5, 6],
219
+ [5, 6, 7],
220
+ ],
221
+ [
222
+ [1, 2, 3],
223
+ [1, 2, 3],
224
+ [2, 3, 4],
225
+ [3, 3, 5],
226
+ [3, 5, 6],
227
+ ],
228
+ [
229
+ [1, 1, 1],
230
+ [1, 1, 1],
231
+ [1, 2, 2],
232
+ [2, 3, 2],
233
+ [2, 3, 3],
234
+ ],
235
+ ],
236
+ startingResources: [24, 18, 6, 8],
237
+ setupDeck(numPlayers, variant, rng) {
238
+ let powerPlantsDeck = lodash_1.cloneDeep(powerPlants_1.powerPlants);
239
+ let actualMarket;
240
+ let futureMarket;
241
+ if (variant == 'original') {
242
+ powerPlantsDeck = powerPlantsDeck.slice(8);
243
+ const powerPlant11 = powerPlantsDeck.splice(0, 1)[0];
244
+ powerPlantsDeck.splice(1, 1)[0];
245
+ const step3 = powerPlantsDeck.pop();
246
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
247
+ if (numPlayers == 2 || numPlayers == 3) {
248
+ powerPlantsDeck = powerPlantsDeck.slice(8);
249
+ }
250
+ else if (numPlayers == 4) {
251
+ powerPlantsDeck = powerPlantsDeck.slice(4);
252
+ }
253
+ powerPlantsDeck.unshift(powerPlant11);
254
+ powerPlantsDeck.push(step3);
255
+ actualMarket = [engine_1.getPowerPlant(3), engine_1.getPowerPlant(4), engine_1.getPowerPlant(5), engine_1.getPowerPlant(6)];
256
+ futureMarket = [engine_1.getPowerPlant(7), engine_1.getPowerPlant(8), engine_1.getPowerPlant(9), engine_1.getPowerPlant(10)];
257
+ }
258
+ else {
259
+ // Remove power plant 13
260
+ powerPlantsDeck.splice(10, 1)[0];
261
+ const powerPlant11 = powerPlantsDeck.splice(8, 1)[0];
262
+ let initialPowerPlants = utils_1.shuffle(powerPlantsDeck.splice(0, 11), rng() + '');
263
+ let initialPlantMarket = initialPowerPlants.splice(0, 7);
264
+ initialPlantMarket.push(powerPlant11);
265
+ initialPlantMarket = initialPlantMarket.sort((a, b) => a.number - b.number);
266
+ actualMarket = initialPlantMarket.slice(0, 4);
267
+ futureMarket = initialPlantMarket.slice(4);
268
+ const first = initialPowerPlants.shift();
269
+ const step3 = powerPlantsDeck.pop();
270
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
271
+ if (numPlayers == 2) {
272
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(6).concat(initialPowerPlants), rng() + '');
273
+ }
274
+ else if (numPlayers == 3) {
275
+ initialPowerPlants = initialPowerPlants.slice(1);
276
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(6).concat(initialPowerPlants), rng() + '');
277
+ }
278
+ else if (numPlayers == 4) {
279
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(3).concat(initialPowerPlants), rng() + '');
280
+ }
281
+ else {
282
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.concat(initialPowerPlants), rng() + '');
283
+ }
284
+ powerPlantsDeck.unshift(first);
285
+ powerPlantsDeck.push(step3);
286
+ }
287
+ return { actualMarket, futureMarket, powerPlantsDeck };
288
+ },
289
+ mapSpecificRules: 'Remove power plant 13. Put power plant 11 on top of the deck.',
290
+ };