Forts and citadels (with AI) (#2325)

* Enabled Forts & Citadels

* Friendly territory checks

* Citadel damage & notifications

* Sprites, Icons, Translation & Atlas

* Obsolete tests are removed

* NullReferenceException code is fixed

* Refactoring: using the static object

* AI for the forts and citadels

* Display defence stats

* Exclude enemies tiles as candidates

Co-authored-by: r3versi <fluo392@gmail.com>
This commit is contained in:
Jack Rainy
2020-04-03 11:22:27 +03:00
committed by GitHub
parent 10762a3873
commit 29a077a803
19 changed files with 197 additions and 111 deletions

View File

@ -45,64 +45,6 @@ class TranslationTests {
allUnitActionsHaveTranslation)
}
@Test
fun allTerrainsHaveTranslation() {
val strings: Set<String> = ruleset.terrains.keys
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all buildings",
allStringsHaveTranslation)
}
@Test
fun allTerrainUniquesHaveTranslation() {
val strings: MutableSet<String> = HashSet()
for (terrain in ruleset.terrains.values) {
strings.addAll(terrain.uniques)
}
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all terrain uniques",
allStringsHaveTranslation)
}
@Test
fun allImprovementsHaveTranslation() {
val strings: Set<String> = ruleset.tileImprovements.keys
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all improvements",
allStringsHaveTranslation)
}
@Test
fun allImprovementUniquesHaveTranslation() {
val strings: MutableSet<String> = HashSet()
for (improvement in ruleset.tileImprovements.values) {
strings.addAll(improvement.uniques)
}
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all improvements uniques",
allStringsHaveTranslation)
}
@Test
fun allTechnologiesHaveTranslation() {
val strings: Set<String> = ruleset.technologies.keys
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all technologies",
allStringsHaveTranslation)
}
@Test
fun allTechnologiesQuotesHaveTranslation() {
val strings: MutableSet<String> = HashSet()
for (tech in ruleset.technologies.values) {
strings.add(tech.quote)
}
val allStringsHaveTranslation = allStringAreTranslated(strings)
Assert.assertTrue("This test will only pass when there is a translation for all technologies quotes",
allStringsHaveTranslation)
}
private fun allStringAreTranslated(strings: Set<String>): Boolean {
var allStringsHaveTranslation = true
for (key in strings) {