summaryrefslogtreecommitdiff
path: root/data.js
blob: 7e5c8f4b3073cd170d55760fc709fa9c05e0a6ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
"use strict"

let BOXES = {}
let BLOCKADE = {}
let COLONIES = {}
let SPACES = {}
let PATH_INDEX = {}
let PATH_NAME
let PATH_TYPE

const GENERALS = {
	Arnold: { owner: "American", strategy: 1, battle: 3, agility: 2, bonus: false },
	Gates: { owner: "American", strategy: 2, battle: 2, agility: 1, bonus: false },
	Greene: { owner: "American", strategy: 1, battle: 4, agility: 2, bonus: true },
	Lafayette: { owner: "American", strategy: 1, battle: 2, agility: 1, bonus: false },
	Lee: { owner: "American", strategy: 2, battle: 1, agility: 1, bonus: false },
	Lincoln: { owner: "American", strategy: 2, battle: 1, agility: 1, bonus: false },
	Washington: { owner: "American", strategy: 1, battle: 5, agility: 2, bonus: true },

	Burgoyne: { owner: "British", strategy: 2, battle: 2, agility: 1, bonus: false },
	Carleton: { owner: "British", strategy: 3, battle: 3, agility: 2, bonus: false },
	Clinton: { owner: "British", strategy: 3, battle: 4, agility: 2, bonus: false },
	Cornwallis: { owner: "British", strategy: 2, battle: 4, agility: 2, bonus: false },
	Howe: { owner: "British", strategy: 3, battle: 6, agility: 3, bonus: false },

	Rochambeau: { owner: "French", strategy: 2, battle: 4, agility: 2, bonus: false },
}

function getEdge(A, B) {
	if (A > B)
		return PATHS[B + "/" + A]
	return PATHS[A + "/" + B]
}

;(function () {
	let info = {}

	function box(category, A, x, y) {
		x += 40
		y += 36
		BOXES[A] = { name: A, category: category, x: x, y: y }
	}

	function space(colony, name, x, y, type) {
		x += 40
		y += 36
		if (type == "winter-quarters") {
			x += 1
			y += 1
		}
		if (!(colony in COLONIES))
			COLONIES[colony] = []
		COLONIES[colony].push(name)
		SPACES[name] = { name: name, colony: colony, type: type, port: false, x: x, y: y, exits: [] }
	}

	function line(A, B, type) {
		if (A > B) {
			let C = B
			B = A
			A = C
		}
		let id = A + "/" + B
		SPACES[A].exits.push(B)
		SPACES[B].exits.push(A)
		info[id] = type
		if (!(A in PATH_INDEX))
			PATH_INDEX[A] = {}
		if (!(B in PATH_INDEX))
			PATH_INDEX[B] = {}
		PATH_INDEX[A][B] = -1
		PATH_INDEX[B][A] = -1
	}

	space("CA", "Fort Detroit", 55, 673, "regular-space")
	space("CA", "Montreal", 1000, 159, "fortified-port")
	space("CA", "Quebec", 1122, 57, "fortified-port")
	space("CT", "Hartford", 1183, 749, "winter-quarters")
	space("CT", "New Haven", 1088, 736, "regular-space")
	space("DE", "Wilmington DE", 885, 1079, "winter-quarters")
	space("GA", "Augusta", 140, 2060, "regular-space")
	space("GA", "Savannah", 227, 2271, "regular-space")
	space("GA", "St. Mary's", 180, 2394, "regular-space")
	space("MA", "Barnstable", 1394, 705, "regular-space")
	space("MA", "Boston", 1327, 592, "winter-quarters")
	space("MA", "Falmouth", 1334, 410, "regular-space")
	space("MA", "Lexington Concord", 1218, 628, "regular-space")
	space("MA", "Springfield", 1095, 624, "winter-quarters")
	space("MD", "Baltimore", 769, 1105, "winter-quarters")
	space("MD", "Fort Cumberland", 446, 1098, "regular-space")
	space("MD", "Frederick Town", 646, 1097, "regular-space")
	space("NC", "Charlotte", 215, 1653, "regular-space")
	space("NC", "Gilbert Town", 123, 1568, "regular-space")
	space("NC", "Hillsboro", 484, 1582, "regular-space")
	space("NC", "New Bern", 764, 1670, "regular-space")
	space("NC", "Salem", 308, 1561, "regular-space")
	space("NC", "Wake (Raleigh)", 606, 1671, "regular-space")
	space("NC", "Wilmington NC", 676, 1816, "regular-space")
	space("NH", "Brattleboro", 1102, 486, "regular-space")
	space("NH", "Concord", 1214, 460, "regular-space")
	space("NH", "Norwich", 1125, 342, "winter-quarters")
	space("NJ", "Monmouth", 998, 1074, "regular-space")
	space("NJ", "Morristown", 864, 831, "regular-space")
	space("NJ", "New Brunswick", 961, 942, "regular-space")
	space("NY", "Albany", 965, 626, "winter-quarters")
	space("NY", "Fort Niagara", 461, 526, "regular-space")
	space("NY", "Fort Stanwix", 877, 483, "winter-quarters")
	space("NY", "Genesee", 668, 582, "regular-space")
	space("NY", "Long Island", 1147, 868, "regular-space")
	space("NY", "New York", 1024, 838, "winter-quarters")
	space("NY", "Oswego", 768, 424, "regular-space")
	space("NY", "Saratoga", 992, 496, "regular-space")
	space("NY", "Ticonderoga", 993, 355, "winter-quarters")
	space("NY", "Westchester", 955, 747, "regular-space")
	space("PA", "Bassett Town", 147, 984, "regular-space")
	space("PA", "Harrisburg", 555, 880, "regular-space")
	space("PA", "Philadelphia", 846, 961, "fortified-port")
	space("PA", "Pittsburgh", 439, 958, "winter-quarters")
	space("PA", "Reading", 684, 900, "regular-space")
	space("PA", "Wyoming Valley", 685, 747, "winter-quarters")
	space("PA", "York", 589, 992, "regular-space")
	space("RI", "Newport", 1289, 736, "winter-quarters")
	space("SC", "Camden", 346, 1773, "regular-space")
	space("SC", "Charleston", 444, 2050, "fortified-port")
	space("SC", "Cheraw", 496, 1795, "regular-space")
	space("SC", "Eutaw Springs", 404, 1905, "regular-space")
	space("SC", "Fort Prince George", 74, 1773, "regular-space")
	space("SC", "Georgetown", 574, 1915, "regular-space")
	space("SC", "Ninety Six", 222, 1932, "regular-space")
	space("VA", "Abingdon", 61, 1451, "regular-space")
	space("VA", "Alexandria", 653, 1217, "winter-quarters")
	space("VA", "Charlottesville", 434, 1257, "winter-quarters")
	space("VA", "Fincastle", 349, 1402, "regular-space")
	space("VA", "Fort Chiswell", 212, 1408, "regular-space")
	space("VA", "Lynch's Ferry", 486, 1444, "regular-space")
	space("VA", "Norfolk", 781, 1450, "winter-quarters")
	space("VA", "Petersburg", 634, 1446, "regular-space")
	space("VA", "Point Pleasant", 132, 1218, "regular-space")
	space("VA", "Richmond", 608, 1323, "winter-quarters")
	space("VA", "Yorktown", 767, 1317, "regular-space")

	box("SEA", "Sea1", 1277, 65, "blockade")
	box("SEA", "Sea2", 1469, 514, "blockade")
	box("SEA", "Sea3", 1213, 981, "blockade")
	box("SEA", "Sea4", 1058, 1174, "blockade")
	box("SEA", "Sea5", 947, 1395, "blockade")
	box("SEA", "Sea6", 637, 2027, "blockade")
	box("SEA", "Sea7", 359, 2358, "blockade")

	box("HOLDING", "Continental Congress Dispersed", 545, 350)
	box("HOLDING", "Captured Generals", 1463, 80)
	box("HOLDING", "British Leader Reinforcements", 1425, 1745)
	box("HOLDING", "American Leader Reinforcements", 400, 310)
	box("HOLDING", "French Reinforcements", 150, 340)

	box("ALLIANCE", "French Alliance Track 0", 898, 2240)
	box("ALLIANCE", "French Alliance Track 1", 964, 2240)
	box("ALLIANCE", "French Alliance Track 2", 1030, 2240)
	box("ALLIANCE", "French Alliance Track 3", 1096, 2240)
	box("ALLIANCE", "French Alliance Track 4", 1162, 2240)
	box("ALLIANCE", "French Alliance Track 5", 1228, 2240)
	box("ALLIANCE", "French Alliance Track 6", 1294, 2240)
	box("ALLIANCE", "French Alliance Track 7", 1360, 2240)
	box("ALLIANCE", "French Alliance Track 8", 1426, 2240)
	box("ALLIANCE", "French Alliance Track 9", 1492, 2240)

	box("TURN", "Game Turn 1775", 898, 2370)
	box("TURN", "Game Turn 1776", 964, 2370)
	box("TURN", "Game Turn 1777", 1030, 2370)
	box("TURN", "Game Turn 1778", 1096, 2370)
	box("TURN", "Game Turn 1779", 1162, 2370)
	box("TURN", "Game Turn 1780", 1228, 2370)
	box("TURN", "Game Turn 1781", 1294, 2370)
	box("TURN", "Game Turn 1782", 1360, 2370)
	box("TURN", "Game Turn 1783", 1426, 2370)

	box("CONTROL", "CA", 1376, 967)
	box("CONTROL", "NH", 1458, 1006)
	box("CONTROL", "NY", 1375, 1081)
	box("CONTROL", "MA", 1491, 1081)
	box("CONTROL", "CT", 1455, 1156)
	box("CONTROL", "RI", 1533, 1156)
	box("CONTROL", "PA", 1299, 1194)
	box("CONTROL", "NJ", 1376, 1189)
	box("CONTROL", "MD", 1299, 1266)
	box("CONTROL", "DE", 1376, 1266)
	box("CONTROL", "VA", 1241, 1337)
	box("CONTROL", "NC", 1260, 1407)
	box("CONTROL", "SC", 1212, 1479)
	box("CONTROL", "GA", 1164, 1550)

	function wilderness(A, B) {
		line(A, B, "wilderness")
	}
	function path(A, B) {
		line(A, B, "path")
	}
	function sea(space, zone) {
		SPACES[space].port = true
		BLOCKADE[space] = zone
	}

	wilderness("Quebec", "Falmouth")
	wilderness("Fort Detroit", "Bassett Town")
	wilderness("Bassett Town", "Point Pleasant")

	path("Quebec", "Montreal")
	path("Montreal", "Ticonderoga")
	path("Montreal", "Oswego")
	path("Oswego", "Fort Niagara")
	path("Oswego", "Fort Stanwix")
	path("Fort Niagara", "Fort Detroit")
	path("Fort Niagara", "Genesee")
	path("Ticonderoga", "Norwich")
	path("Ticonderoga", "Saratoga")
	path("Norwich", "Brattleboro")
	path("Norwich", "Concord")
	path("Concord", "Falmouth")
	path("Concord", "Brattleboro")
	path("Saratoga", "Brattleboro")
	path("Saratoga", "Albany")
	path("Brattleboro", "Springfield")
	path("Fort Stanwix", "Albany")
	path("Albany", "Springfield")
	path("Lexington Concord", "Springfield")
	path("Lexington Concord", "Boston")
	path("Falmouth", "Boston")
	path("Barnstable", "Boston")
	path("Newport", "Boston")
	path("Newport", "Hartford")
	path("Springfield", "Hartford")
	path("New Haven", "Hartford")
	path("New Haven", "New York")
	path("New Haven", "Westchester")
	path("New York", "Westchester")
	path("New York", "Long Island")
	path("Newport", "Lexington Concord")
	path("Albany", "Westchester")
	path("Fort Stanwix", "Genesee")
	path("Genesee", "Wyoming Valley")
	path("Fort Niagara", "Pittsburgh")
	path("Morristown", "Westchester")
	path("Morristown", "Wyoming Valley")
	path("Morristown", "Reading")
	path("Morristown", "New Brunswick")
	path("Morristown", "New York")
	path("New York", "New Brunswick")
	path("Monmouth", "New Brunswick")
	path("Philadelphia", "New Brunswick")
	path("Monmouth", "Philadelphia")
	path("Reading", "Philadelphia")
	path("Wyoming Valley", "Reading")
	path("Wilmington DE", "Philadelphia")
	path("Wilmington DE", "Baltimore")
	path("Bassett Town", "Pittsburgh")
	path("Fort Cumberland", "Pittsburgh")
	path("Harrisburg", "Pittsburgh")
	path("Harrisburg", "York")
	path("Reading", "York")
	path("Harrisburg", "Reading")
	path("Frederick Town", "York")
	path("Frederick Town", "Baltimore")
	path("Frederick Town", "Alexandria")
	path("Frederick Town", "Charlottesville")
	path("Frederick Town", "Fort Cumberland")
	path("Richmond", "Alexandria")
	path("Richmond", "Yorktown")
	path("Richmond", "Petersburg")
	path("Richmond", "Lynch's Ferry")
	path("Richmond", "Charlottesville")
	path("Richmond", "Norfolk")
	path("Fincastle", "Charlottesville")
	path("Fincastle", "Lynch's Ferry")
	path("Fincastle", "Fort Chiswell")
	path("Point Pleasant", "Fort Chiswell")
	path("Abingdon", "Fort Chiswell")
	path("Abingdon", "Gilbert Town")
	path("Fort Prince George", "Gilbert Town")
	path("Charlotte", "Gilbert Town")
	path("Charlotte", "Salem")
	path("Hillsboro", "Salem")
	path("Cheraw", "Salem")
	path("Lynch's Ferry", "Salem")
	path("Charlotte", "Camden")
	path("Abingdon", "Fort Prince George")
	path("New Bern", "Norfolk")
	path("Petersburg", "Norfolk")
	path("Petersburg", "Wake (Raleigh)")
	path("New Bern", "Wake (Raleigh)")
	path("Hillsboro", "Wake (Raleigh)")
	path("Petersburg", "Hillsboro")
	path("Petersburg", "Lynch's Ferry")
	path("Wilmington NC", "Wake (Raleigh)")
	path("Wilmington NC", "Cheraw")
	path("Wilmington NC", "Georgetown")
	path("Cheraw", "Georgetown")
	path("Cheraw", "Camden")
	path("Ninety Six", "Fort Prince George")
	path("Ninety Six", "Camden")
	path("Ninety Six", "Augusta")
	path("Eutaw Springs", "Camden")
	path("Eutaw Springs", "Charleston")
	path("Georgetown", "Charleston")
	path("Savannah", "Charleston")
	path("Alexandria", "Baltimore")
	path("Savannah", "Augusta")
	path("Savannah", "St. Mary's")
	path("Charlottesville", "Lynch's Ferry")

	sea("Quebec", "Sea1")
	sea("Montreal", "Sea1")

	sea("Falmouth", "Sea2")
	sea("Boston", "Sea2")
	sea("Barnstable", "Sea2")
	sea("Newport", "Sea2")

	sea("New Haven", "Sea3")
	sea("New York", "Sea3")
	sea("Long Island", "Sea3")

	sea("Philadelphia", "Sea4")
	sea("Wilmington DE", "Sea4")

	sea("Baltimore", "Sea5")
	sea("Alexandria", "Sea5")
	sea("Yorktown", "Sea5")
	sea("Norfolk", "Sea5")

	sea("New Bern", "Sea6")
	sea("Wilmington NC", "Sea6")
	sea("Charleston", "Sea6")

	sea("Savannah", "Sea7")
	sea("St. Mary's", "Sea7")

	PATH_NAME = Object.keys(info).sort()
	PATH_TYPE = []
	for (let id of PATH_NAME)
		PATH_TYPE.push(info[id])
	for (let a in PATH_INDEX) {
		for (let b in PATH_INDEX[a]) {
			let id = a < b ? a + "/" + b : b + "/" + a
			PATH_INDEX[a][b] = PATH_NAME.indexOf(id)
		}
	}
})()

if (typeof module == "object") {
	module.exports = {
		GENERALS: GENERALS,
		BOXES: BOXES,
		COLONIES: COLONIES,
		SPACES: SPACES,
		PATH_NAME: PATH_NAME,
		PATH_TYPE: PATH_TYPE,
		PATH_INDEX: PATH_INDEX,
		BLOCKADE,
	}
}