Skip to content

Commit e3fdf97

Browse files
Civilopedia phase 7 - Terrain - patch2 for yairm210#4641
1 parent 422dc7d commit e3fdf97

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

core/src/com/unciv/models/ruleset/tile/TileResource.kt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TileResource : NamedStats(), ICivilopediaText {
2828
override fun getCivilopediaTextLines(ruleset: Ruleset): List<FormattedLine> {
2929
val textList = ArrayList<FormattedLine>()
3030

31-
textList += FormattedLine("${resourceType.name} resource", header=4, color=resourceType.color)
31+
textList += FormattedLine("${resourceType.name} resource", header = 4, color = resourceType.color)
3232
textList += FormattedLine()
3333

3434
textList += FormattedLine(this.clone().toString())
@@ -37,27 +37,29 @@ class TileResource : NamedStats(), ICivilopediaText {
3737
textList += FormattedLine()
3838
if (terrainsCanBeFoundOn.size == 1) {
3939
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")
4141
}
4242
} else {
4343
textList += FormattedLine("{Can be found on}:")
4444
terrainsCanBeFoundOn.forEach {
45-
textList += FormattedLine(it, link="Terrain/$it", indent=1)
45+
textList += FormattedLine(it, link = "Terrain/$it", indent = 1)
4646
}
4747
}
4848
}
4949

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+
}
5456

5557
val buildingsThatConsumeThis = ruleset.buildings.values.filter { it.getResourceRequirements().containsKey(name) }
5658
if (buildingsThatConsumeThis.isNotEmpty()) {
5759
textList += FormattedLine()
5860
textList += FormattedLine("{Buildings that consume this resource}:")
5961
buildingsThatConsumeThis.forEach {
60-
textList += FormattedLine(it.name, link="Building/${it.name}", indent=1)
62+
textList += FormattedLine(it.name, link = "Building/${it.name}", indent = 1)
6163
}
6264
}
6365

@@ -66,7 +68,7 @@ class TileResource : NamedStats(), ICivilopediaText {
6668
textList += FormattedLine()
6769
textList += FormattedLine("{Units that consume this resource}: ")
6870
unitsThatConsumeThis.forEach {
69-
textList += FormattedLine(it.name, link="Unit/${it.name}", indent=1)
71+
textList += FormattedLine(it.name, link = "Unit/${it.name}", indent = 1)
7072
}
7173
}
7274

@@ -77,7 +79,7 @@ class TileResource : NamedStats(), ICivilopediaText {
7779
textList += FormattedLine()
7880
textList += FormattedLine("{Buildings that require this resource worked near the city}: ")
7981
buildingsRequiringThis.forEach {
80-
textList += FormattedLine(it.name, link="Building/${it.name}", indent=1)
82+
textList += FormattedLine(it.name, link = "Building/${it.name}", indent = 1)
8183
}
8284
}
8385

0 commit comments

Comments
 (0)