Fix: notification when city-states advance to a new era (#1813)

* Fix: notification when city-states advance to a new era

* Replaced forEach with for, according with code standards
This commit is contained in:
lyrjie 2020-01-31 15:03:21 +03:00 committed by GitHub
parent a728da6a2a
commit 3362c2128c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,8 +223,14 @@ class TechManager {
val currentEra = civInfo.getEra() val currentEra = civInfo.getEra()
if (previousEra < currentEra) { if (previousEra < currentEra) {
civInfo.addNotification("You have entered the [$currentEra era]!", null, Color.GOLD) civInfo.addNotification("You have entered the [$currentEra era]!", null, Color.GOLD)
civInfo.getKnownCivs().forEach { if (civInfo.isMajorCiv()) {
it.addNotification("[${civInfo.civName}] has entered the [$currentEra era]!", null, Color.BLUE) for (knownCiv in civInfo.getKnownCivs()) {
knownCiv.addNotification(
"[${civInfo.civName}] has entered the [$currentEra era]!",
null,
Color.BLUE
)
}
} }
getRuleset().policyBranches.values.filter { it.era == currentEra } getRuleset().policyBranches.values.filter { it.era == currentEra }
.forEach { civInfo.addNotification("[" + it.name + "] policy branch unlocked!", null, Color.PURPLE) } .forEach { civInfo.addNotification("[" + it.name + "] policy branch unlocked!", null, Color.PURPLE) }