-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclasses.py
More file actions
608 lines (563 loc) · 25.6 KB
/
Copy pathclasses.py
File metadata and controls
608 lines (563 loc) · 25.6 KB
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# from _typeshed import ReadableBuffer
import os
import time
import random
from colors import *
#============================
# UNIT RESOURCE MODIFIERS
#============================
HUNTER_FOOD_MOD = 2 #Use this to balance hunter food generation
# For VENDOR_GOLD_PER_HOUR:
# Max vendors is currently 5 per farm
# This amount of gold is doubled at max rank
# With 8 fully upgraded farms, you can get 40 vendors.
# With 40 vendors, you can fetch 4k gold/hr if the value below is 50
VENDOR_GOLD_PER_HOUR = 50
#============================
#this is the d20 roll function
def roll(mod):
d20 = random.randint(1, 20)
return d20 + mod
#define biome globals:
WATER = '~'
RIVER = ['/','|','\\']
MOUNTAIN = 'M'
PLAINS = '#'
FOREST = '^'
BACKSLASH_SUB = 'L' #This needed to be added so the program could properly read/write '\'
def biomeColor(biome):
if biome == MOUNTAIN:
return textColor.DARK_GRAY
elif biome == FOREST:
return textColor.GREEN
elif biome == PLAINS:
return textColor.YELLOW
def strongholdColor(color):
if color == 'red':
return textColor.RED
if color == 'green':
return textColor.GREEN
if color == 'magenta':
return textColor.MAGENTA
if color == 'white':
return textColor.BOLD
if color == 'blue':
return textColor.BLUE
if color == 'yellow':
return textColor.YELLOW
if color == 'cyan':
return textColor.CYAN
if color == 'gray':
return textColor.DARK_GRAY
#the fiefdom class holds variables that define a player's stats
class Fiefdom:
name = 'Default Fiefdom'
ruler = 'Unclaimed'
home = False
defenders = 100
gold = 500
wood = 0
stone = 0
food = 0
ore = 0
defLevel = 0
defType = "Open Camp"
attLevel = 0
attType = "Angry Mob"
goldMod = '1'
defenderMod = '1'
farmType = "Dirt Patch"
thieves = 0
biome = '0'
xCoordinate = 0
yCoordinate = 0
adjacentWater = 0
adjacentRivers = 0
adjacentMountains = 0
adjacentForests = 0
adjacentPlains = 0
strongholdMessage = 'Message Not Set'
op_farmlandTier = 0
op_farmlandPrimaryPer = 0
op_farmlandSecondaryPer = 0
op_farmlandPrimaryUnits = 0
op_farmlandSecondaryUnits = 0
op_farmlandNumBuilt = 0
op_fisheryTier = 0
op_fisheryPrimaryPer = 0
op_fisherySecondaryPer = 0
op_fisheryPrimaryUnits = 0
op_fisherySecondaryUnits = 0
op_fisheryNumBuilt = 0
op_lumberMillTier = 0
op_lumberMillPrimaryPer = 0
op_lumberMillSecondaryPer = 0
op_lumberMillPrimaryUnits = 0
op_lumberMillSecondaryUnits = 0
op_lumberMillNumBuilt = 0
op_mineTier = 0
op_minePrimaryPer = 0
op_mineSecondaryPer = 0
op_minePrimaryUnits = 0
op_mineSecondaryUnits = 0
op_mineNumBuilt = 0
#take the current fiefdom and write it to the /fiefs directory
def write(self):
fiefFile = 'fiefs/' + self.name + '.txt'
#this part creates a file if it isn't made yet
try:
with open(fiefFile, 'x') as f:
f.write(self.name + '\n')
f.write(self.ruler + '\n')
f.write(str(self.home) + '\n')
f.write(str(self.defenders) + '\n')
f.write(str(self.gold) + '\n')
f.write(str(self.wood) + '\n')
f.write(str(self.stone) + '\n')
f.write(str(self.food) + '\n')
f.write(str(self.ore) + '\n')
f.write(str(self.defLevel) + '\n')
f.write(str(self.defType) + '\n')
f.write(str(self.attLevel) + '\n')
f.write(str(self.attType) + '\n')
f.write(str(self.goldMod) + '\n')
f.write(str(self.defenderMod) + '\n')
f.write(str(self.farmType) + '\n')
f.write(str(self.thieves) + '\n')
f.write(str(self.biome) + '\n')
f.write(str(self.xCoordinate) + '\n')
f.write(str(self.yCoordinate) + '\n')
f.write(str(self.adjacentWater) + '\n')
f.write(str(self.adjacentRivers) + '\n')
f.write(str(self.adjacentMountains) + '\n')
f.write(str(self.adjacentForests) + '\n')
f.write(str(self.adjacentPlains) + '\n')
f.write(str(self.strongholdMessage) + '\n')
f.write(str(self.op_farmlandTier) + '\n')
f.write(str(self.op_farmlandPrimaryPer) + '\n')
f.write(str(self.op_farmlandSecondaryPer) + '\n')
f.write(str(self.op_farmlandPrimaryUnits) + '\n')
f.write(str(self.op_farmlandSecondaryUnits) + '\n')
f.write(str(self.op_farmlandNumBuilt) + '\n')
f.write(str(self.op_fisheryTier) + '\n')
f.write(str(self.op_fisheryPrimaryPer) + '\n')
f.write(str(self.op_fisherySecondaryPer) + '\n')
f.write(str(self.op_fisheryPrimaryUnits) + '\n')
f.write(str(self.op_fisherySecondaryUnits) + '\n')
f.write(str(self.op_fisheryNumBuilt) + '\n')
f.write(str(self.op_lumberMillTier) + '\n')
f.write(str(self.op_lumberMillPrimaryPer) + '\n')
f.write(str(self.op_lumberMillSecondaryPer) + '\n')
f.write(str(self.op_lumberMillPrimaryUnits) + '\n')
f.write(str(self.op_lumberMillSecondaryUnits) + '\n')
f.write(str(self.op_lumberMillNumBuilt) + '\n')
f.write(str(self.op_mineTier) + '\n')
f.write(str(self.op_minePrimaryPer) + '\n')
f.write(str(self.op_mineSecondaryPer) + '\n')
f.write(str(self.op_minePrimaryUnits) + '\n')
f.write(str(self.op_mineSecondaryUnits) + '\n')
f.write(str(self.op_mineNumBuilt) + '\n')
except:
pass
#write the class variables down line by line in the text file
try:
with open(fiefFile, 'w') as f:
f.write(self.name + '\n')
f.write(self.ruler + '\n')
f.write(str(self.home) + '\n')
f.write(str(self.defenders) + '\n')
f.write(str(self.gold) + '\n')
f.write(str(self.wood) + '\n')
f.write(str(self.stone) + '\n')
f.write(str(self.food) + '\n')
f.write(str(self.ore) + '\n')
f.write(str(self.defLevel) + '\n')
f.write(str(self.defType) + '\n')
f.write(str(self.attLevel) + '\n')
f.write(str(self.attType) + '\n')
f.write(str(self.goldMod) + '\n')
f.write(str(self.defenderMod) + '\n')
f.write(str(self.farmType) + '\n')
f.write(str(self.thieves) + '\n')
f.write(str(self.biome) + '\n')
f.write(str(self.xCoordinate) + '\n')
f.write(str(self.yCoordinate) + '\n')
f.write(str(self.adjacentWater) + '\n')
f.write(str(self.adjacentRivers) + '\n')
f.write(str(self.adjacentMountains) + '\n')
f.write(str(self.adjacentForests) + '\n')
f.write(str(self.adjacentPlains) + '\n')
f.write(str(self.strongholdMessage) + '\n')
f.write(str(self.op_farmlandTier) + '\n')
f.write(str(self.op_farmlandPrimaryPer) + '\n')
f.write(str(self.op_farmlandSecondaryPer) + '\n')
f.write(str(self.op_farmlandPrimaryUnits) + '\n')
f.write(str(self.op_farmlandSecondaryUnits) + '\n')
f.write(str(self.op_farmlandNumBuilt) + '\n')
f.write(str(self.op_fisheryTier) + '\n')
f.write(str(self.op_fisheryPrimaryPer) + '\n')
f.write(str(self.op_fisherySecondaryPer) + '\n')
f.write(str(self.op_fisheryPrimaryUnits) + '\n')
f.write(str(self.op_fisherySecondaryUnits) + '\n')
f.write(str(self.op_fisheryNumBuilt) + '\n')
f.write(str(self.op_lumberMillTier) + '\n')
f.write(str(self.op_lumberMillPrimaryPer) + '\n')
f.write(str(self.op_lumberMillSecondaryPer) + '\n')
f.write(str(self.op_lumberMillPrimaryUnits) + '\n')
f.write(str(self.op_lumberMillSecondaryUnits) + '\n')
f.write(str(self.op_lumberMillNumBuilt) + '\n')
f.write(str(self.op_mineTier) + '\n')
f.write(str(self.op_minePrimaryPer) + '\n')
f.write(str(self.op_mineSecondaryPer) + '\n')
f.write(str(self.op_minePrimaryUnits) + '\n')
f.write(str(self.op_mineSecondaryUnits) + '\n')
f.write(str(self.op_mineNumBuilt) + '\n')
except:
pass
#read class variables line by line
def read(self):
fiefFile = 'fiefs/' + self.name + '.txt'
try:
with open(fiefFile, 'r') as f:
self.name = f.readline().strip()
self.ruler = f.readline().strip()
self.home = f.readline().strip()
self.defenders = f.readline().strip()
self.gold = f.readline().strip()
self.wood = f.readline().strip()
self.stone = f.readline().strip()
self.food = f.readline().strip()
self.ore = f.readline().strip()
self.defLevel = f.readline().strip()
self.defType = f.readline().strip()
self.attLevel = f.readline().strip()
self.attType = f.readline().strip()
self.goldMod = f.readline().strip()
self.defenderMod = f.readline().strip()
self.farmType = f.readline().strip()
self.thieves = f.readline().strip()
self.biome = f.readline().strip()
self.xCoordinate = f.readline().strip()
self.yCoordinate = f.readline().strip()
self.adjacentWater = f.readline().strip()
self.adjacentRivers = f.readline().strip()
self.adjacentMountains = f.readline().strip()
self.adjacentForests = f.readline().strip()
self.adjacentPlains = f.readline().strip()
self.strongholdMessage = f.readline().strip()
self.op_farmlandTier = f.readline().strip()
self.op_farmlandPrimaryPer = f.readline().strip()
self.op_farmlandSecondaryPer = f.readline().strip()
self.op_farmlandPrimaryUnits = f.readline().strip()
self.op_farmlandSecondaryUnits = f.readline().strip()
self.op_farmlandNumBuilt = f.readline().strip()
self.op_fisheryTier = f.readline().strip()
self.op_fisheryPrimaryPer = f.readline().strip()
self.op_fisherySecondaryPer = f.readline().strip()
self.op_fisheryPrimaryUnits = f.readline().strip()
self.op_fisherySecondaryUnits = f.readline().strip()
self.op_fisheryNumBuilt = f.readline().strip()
self.op_lumberMillTier = f.readline().strip()
self.op_lumberMillPrimaryPer = f.readline().strip()
self.op_lumberMillSecondaryPer = f.readline().strip()
self.op_lumberMillPrimaryUnits = f.readline().strip()
self.op_lumberMillSecondaryUnits = f.readline().strip()
self.op_lumberMillNumBuilt = f.readline().strip()
self.op_mineTier = f.readline().strip()
self.op_minePrimaryPer = f.readline().strip()
self.op_mineSecondaryPer = f.readline().strip()
self.op_minePrimaryUnits = f.readline().strip()
self.op_mineSecondaryUnits = f.readline().strip()
self.op_mineNumBuilt = f.readline().strip()
except:
self.write()
def setCoordinates(self, coordinates):
self.yCoordinate = coordinates[0]
self.xCoordinate = coordinates[1]
def setSurroundings(self, surroundings):
for i in range(len(surroundings)):
if surroundings[i] == WATER:
self.adjacentWater = str(int(self.adjacentWater) + 1)
elif surroundings[i] == RIVER[0] or surroundings[i] == RIVER[1] or surroundings[i] == RIVER[2]:
self.adjacentRivers = str(int(self.adjacentRivers) + 1)
elif surroundings[i] == PLAINS:
self.adjacentPlains = str(int(self.adjacentPlains) + 1)
elif surroundings[i] == MOUNTAIN:
self.adjacentMountains = str(int(self.adjacentMountains) + 1)
elif surroundings[i] == FOREST:
self.adjacentForests = str(int(self.adjacentForests) + 1)
def GetPrimaryPer(self, outpost):
if outpost == "farmland":
return int(self.op_farmlandPrimaryUnits) * (int(self.op_farmlandTier) + 1)
if outpost == "fishery":
return int(self.op_fisheryPrimaryUnits) * (int(self.op_fisheryTier) + 1)
if outpost == "lumberMill":
return int(self.op_lumberMillPrimaryUnits) * (int(self.op_lumberMillTier) + 1)
if outpost == "mine":
return int(self.op_minePrimaryUnits) * (int(self.op_mineTier) + 1)
def GetSecondaryPer(self, outpost):
if outpost == "farmland":
return int(self.op_farmlandSecondaryUnits) * int(self.op_farmlandTier) * VENDOR_GOLD_PER_HOUR
if outpost == "lumberMill":
return int(self.op_lumberMillSecondaryUnits) * int(self.op_lumberMillTier) * HUNTER_FOOD_MOD
if outpost == "mine":
return int(self.op_mineSecondaryUnits) * int(self.op_mineTier)
#SW: I am splitting this to safely determine if it is necessary to keep the above stuff or not
class Stronghold:
name = 'Default Stronghold'
ruler = 'Unclaimed'
home = False
defenders = 100
gold = 500
wood = 0
stone = 0
food = 0
ore = 0
defLevel = 0
defType = "Open Camp"
attLevel = 0
attType = "Angry Mob"
goldMod = '1'
defenderMod = '1'
farmType = "Dirt Patch"
thieves = 0
biome = '0'
xCoordinate = 0
yCoordinate = 0
color = 'red'
strongholdMessage = 'message not set'
#take the current stronghold and write it to the /strongholds directory
def write(self):
strongholdFile = 'strongholds/' + self.name + '.txt'
#this part creates a file if it isn't made yet
try:
with open(strongholdFile, 'x') as f:
f.write(self.name + '\n')
f.write(self.ruler + '\n')
f.write(str(self.home) + '\n')
f.write(str(self.defenders) + '\n')
f.write(str(self.gold) + '\n')
f.write(str(self.wood) + '\n')
f.write(str(self.stone) + '\n')
f.write(str(self.food) + '\n')
f.write(str(self.ore) + '\n')
f.write(str(self.defLevel) + '\n')
f.write(str(self.defType) + '\n')
f.write(str(self.attLevel) + '\n')
f.write(str(self.attType) + '\n')
f.write(str(self.goldMod) + '\n')
f.write(str(self.defenderMod) + '\n')
f.write(str(self.farmType) + '\n')
f.write(str(self.thieves) + '\n')
f.write(str(self.biome) + '\n')
f.write(str(self.xCoordinate) + '\n')
f.write(str(self.yCoordinate) + '\n')
f.write(str(self.color) + '\n')
f.write(str(self.strongholdMessage) + '\n')
except:
pass
#write the class variables down line by line in the text file
try:
with open(strongholdFile, 'w') as f:
f.write(self.name + '\n')
f.write(self.ruler + '\n')
f.write(str(self.home) + '\n')
f.write(str(self.defenders) + '\n')
f.write(str(self.gold) + '\n')
f.write(str(self.wood) + '\n')
f.write(str(self.stone) + '\n')
f.write(str(self.food) + '\n')
f.write(str(self.ore) + '\n')
f.write(str(self.defLevel) + '\n')
f.write(str(self.defType) + '\n')
f.write(str(self.attLevel) + '\n')
f.write(str(self.attType) + '\n')
f.write(str(self.goldMod) + '\n')
f.write(str(self.defenderMod) + '\n')
f.write(str(self.farmType) + '\n')
f.write(str(self.thieves) + '\n')
f.write(str(self.biome) + '\n')
f.write(str(self.xCoordinate) + '\n')
f.write(str(self.yCoordinate) + '\n')
f.write(str(self.color) + '\n')
f.write(str(self.strongholdMessage) + '\n')
except:
pass
#read class variables line by line
def read(self):
strongholdFile = 'strongholds/' + self.name + '.txt'
try:
with open(strongholdFile, 'r') as f:
self.name = f.readline().strip()
self.ruler = f.readline().strip()
self.home = f.readline().strip()
self.defenders = f.readline().strip()
self.gold = f.readline().strip()
self.wood = f.readline().strip()
self.stone = f.readline().strip()
self.food = f.readline().strip()
self.ore = f.readline().strip()
self.defLevel = f.readline().strip()
self.defType = f.readline().strip()
self.attLevel = f.readline().strip()
self.attType = f.readline().strip()
self.goldMod = f.readline().strip()
self.defenderMod = f.readline().strip()
self.farmType = f.readline().strip()
self.thieves = f.readline().strip()
self.biome = f.readline().strip()
self.xCoordinate = f.readline().strip()
self.yCoordinate = f.readline().strip()
self.color = f.readline().strip()
self.strongholdMessage = f.readline().strip()
except:
self.write()
def setCoordinates(self, coordinates):
self.yCoordinate = coordinates[0]
self.xCoordinate = coordinates[1]
class Map:
seed = '00555'
name = 'default'
width = 5
height = 5
numWater = 0
numRivers = 0
numPlains = 0
numForests = 0
numMountains = 0
usedPlains = 0
usedForests = 0
usedMountains = 0
values = []
worldMap = []
success = False #Temporary bool
#--------------------------------------------------------------------------------------------------------------
# Writes a map file as a 2-d list like so:
# [['seed'], ['width'], ['height'], ['numWater'], ['numRivers'], ['numPlains'], ['numForests'],
# ['numMountains'], ['usedPlains'], ['usedForests'], ['usedMountains'], ['worldMap ROW 1'], [worldMap ROW 2],
# [worldMap ROW 3], [...], [worldMap ROW height]
#--------------------------------------------------------------------------------------------------------------
def write(self):
mapFile = 'map/' + self.name + '.txt'
#this part creates a file if it isn't made yet. SW: This has not been tested.
try:
with open(mapFile, 'x') as f:
f.write(str("["))
f.write("['" + str(self.seed) + "'],")
f.write("['" + str(self.width) + "'],")
f.write("['" + str(self.height) + "'],")
f.write("['" + str(self.numWater) + "'],")
f.write("['" + str(self.numRivers) + "'],")
f.write("['" + str(self.numPlains) + "'],")
f.write("['" + str(self.numForests) + "'],")
f.write("['" + str(self.numMountains) + "'],")
f.write("['" + str(self.usedPlains) + "'],")
f.write("['" + str(self.usedForests) + "'],")
f.write("['" + str(self.usedMountains) + "'],")
for i in range(int(self.height)):
f.write(str("["))
for j in range(int(self.width)):
if j < int(self.width) - 1:
if self.worldMap[i][j] == RIVER[2]:
f.write("'" + BACKSLASH_SUB + "',")
else:
f.write("'" + str(self.worldMap[i][j]) + "',")
else:
if self.worldMap[i][j] == RIVER[2]:
f.write("'" + BACKSLASH_SUB + "'")
else:
f.write("'" + str(self.worldMap[i][j]) + "'")
if i < int(self.height) - 1:
f.write(str("],"))
else:
f.write(str("]"))
f.write(str("]"))
except:
pass
#write the class variables down line by line in the text file
try:
with open(mapFile, 'w') as f:
f.write(str("["))
f.write("['" + str(self.seed) + "'],")
f.write("['" + str(self.width) + "'],")
f.write("['" + str(self.height) + "'],")
f.write("['" + str(self.numWater) + "'],")
f.write("['" + str(self.numRivers) + "'],")
f.write("['" + str(self.numPlains) + "'],")
f.write("['" + str(self.numForests) + "'],")
f.write("['" + str(self.numMountains) + "'],")
f.write("['" + str(self.usedPlains) + "'],")
f.write("['" + str(self.usedForests) + "'],")
f.write("['" + str(self.usedMountains) + "'],")
for i in range(int(self.height)):
f.write(str("["))
for j in range(int(self.width)):
if j < int(self.width) - 1:
if self.worldMap[i][j] == RIVER[2]:
f.write("'" + BACKSLASH_SUB + "',")
else:
f.write("'" + str(self.worldMap[i][j]) + "',")
else:
if self.worldMap[i][j] == RIVER[2]:
f.write("'" + BACKSLASH_SUB + "'")
else:
f.write("'" + str(self.worldMap[i][j]) + "'")
if i < int(self.height) - 1:
f.write(str("],"))
else:
f.write(str("]"))
f.write(str("]"))
except:
pass
#--------------------------------------------------------------------------------------------------------------
# Opens the map file and reads the whole thing into the variable "readList" before closing it.
# The first 11 variables are stored in a "values" array for sorting into appropriate variables.
# Then, each row of the map is loaded into the worldMap 2d-list.
#--------------------------------------------------------------------------------------------------------------
def read(self):
mapFile = 'map/' + self.name + '.txt'
try:
readMapFile = open(mapFile, 'r')
readList = eval(readMapFile.read())
readMapFile.close()
self.worldMap = [] #Needs to clear the world map if anything happened to be in there before reading.
for count in range(len(readList)):
if count <= 10:
self.values.append(readList[count])
if count > 10:
for i in range(len(readList[count])):
if readList[count][i] == BACKSLASH_SUB:
readList[count][i] = RIVER[2]
self.worldMap.append(readList[count])
self.success = True
except:
print('Could not read map file!')
pass
if self.success == True:
self.seed = str(self.values[0]).lstrip("['").rstrip("']")
self.width = str(self.values[1]).lstrip("['").rstrip("']")
self.height = str(self.values[2]).lstrip("['").rstrip("']")
self.numWater = str(self.values[3]).lstrip("['").rstrip("']")
self.numRivers = str(self.values[4]).lstrip("['").rstrip("']")
self.numPlains = str(self.values[5]).lstrip("['").rstrip("']")
self.numForests = str(self.values[6]).lstrip("['").rstrip("']")
self.numMountains = str(self.values[7]).lstrip("['").rstrip("']")
self.usedPlains = str(self.values[8]).lstrip("['").rstrip("']")
self.usedForests = str(self.values[9]).lstrip("['").rstrip("']")
self.usedMountains = str(self.values[10]).lstrip("['").rstrip("']")
def selfDiagnostic(self):
print('Running diagnostic on map class...')
print('Current attributes are: ')
print('name: ' + str(self.name))
print('seed: ' + str(self.seed))
print('width: ' + str(self.width))
print('height: ' + str(self.height))
print('numWater: ' + str(self.numWater))
print('numRivers: ' + str(self.numRivers))
print('numPlains: ' + str(self.numPlains))
print('numForests: ' + str(self.numForests))
print('numMountains: ' + str(self.numMountains))
print('usedPlains: ' + str(self.usedPlains))
print('usedForests: ' + str(self.usedForests))
print('usedMountains: ' + str(self.usedMountains))
#eof