@@ -28,7 +28,7 @@ class TileResource : NamedStats(), ICivilopediaText {
28
28
override fun getCivilopediaTextLines (ruleset : Ruleset ): List <FormattedLine > {
29
29
val textList = ArrayList <FormattedLine >()
30
30
31
- textList + = FormattedLine (" ${resourceType.name} resource" , header= 4 , color= resourceType.color)
31
+ textList + = FormattedLine (" ${resourceType.name} resource" , header = 4 , color = resourceType.color)
32
32
textList + = FormattedLine ()
33
33
34
34
textList + = FormattedLine (this .clone().toString())
@@ -37,27 +37,29 @@ class TileResource : NamedStats(), ICivilopediaText {
37
37
textList + = FormattedLine ()
38
38
if (terrainsCanBeFoundOn.size == 1 ) {
39
39
with (terrainsCanBeFoundOn[0 ]) {
40
- textList + = FormattedLine (" {Can be found on} {$this }" , link= " Terrain/$this " )
40
+ textList + = FormattedLine (" {Can be found on} {$this }" , link = " Terrain/$this " )
41
41
}
42
42
} else {
43
43
textList + = FormattedLine (" {Can be found on}:" )
44
44
terrainsCanBeFoundOn.forEach {
45
- textList + = FormattedLine (it, link= " Terrain/$it " , indent= 1 )
45
+ textList + = FormattedLine (it, link = " Terrain/$it " , indent = 1 )
46
46
}
47
47
}
48
48
}
49
49
50
- textList + = FormattedLine ()
51
- textList + = FormattedLine (" Improved by [$improvement ]" , link= " Improvement/$improvement " )
52
- if (improvementStats != null && ! improvementStats!! .isEmpty())
53
- textList + = FormattedLine (" {Bonus stats for improvement}: " + improvementStats.toString())
50
+ if (improvement != null ) {
51
+ textList + = FormattedLine ()
52
+ textList + = FormattedLine (" Improved by [$improvement ]" , link = " Improvement/$improvement " )
53
+ if (improvementStats != null && ! improvementStats!! .isEmpty())
54
+ textList + = FormattedLine (" {Bonus stats for improvement}: " + improvementStats.toString())
55
+ }
54
56
55
57
val buildingsThatConsumeThis = ruleset.buildings.values.filter { it.getResourceRequirements().containsKey(name) }
56
58
if (buildingsThatConsumeThis.isNotEmpty()) {
57
59
textList + = FormattedLine ()
58
60
textList + = FormattedLine (" {Buildings that consume this resource}:" )
59
61
buildingsThatConsumeThis.forEach {
60
- textList + = FormattedLine (it.name, link= " Building/${it.name} " , indent= 1 )
62
+ textList + = FormattedLine (it.name, link = " Building/${it.name} " , indent = 1 )
61
63
}
62
64
}
63
65
@@ -66,7 +68,7 @@ class TileResource : NamedStats(), ICivilopediaText {
66
68
textList + = FormattedLine ()
67
69
textList + = FormattedLine (" {Units that consume this resource}: " )
68
70
unitsThatConsumeThis.forEach {
69
- textList + = FormattedLine (it.name, link= " Unit/${it.name} " , indent= 1 )
71
+ textList + = FormattedLine (it.name, link = " Unit/${it.name} " , indent = 1 )
70
72
}
71
73
}
72
74
@@ -77,7 +79,7 @@ class TileResource : NamedStats(), ICivilopediaText {
77
79
textList + = FormattedLine ()
78
80
textList + = FormattedLine (" {Buildings that require this resource worked near the city}: " )
79
81
buildingsRequiringThis.forEach {
80
- textList + = FormattedLine (it.name, link= " Building/${it.name} " , indent= 1 )
82
+ textList + = FormattedLine (it.name, link = " Building/${it.name} " , indent = 1 )
81
83
}
82
84
}
83
85
0 commit comments