Fixed broken tests

This commit is contained in:
Yair Morgenstern
2020-08-09 21:37:09 +03:00
parent 38490ca1cc
commit be51735fdf
2 changed files with 6 additions and 5 deletions

View File

@ -88,7 +88,7 @@
"terrainsCanBeBuiltOn": ["Plains","Grassland","Desert","Hill","Tundra","Snow"], "terrainsCanBeBuiltOn": ["Plains","Grassland","Desert","Hill","Tundra","Snow"],
"turnsToBuild": 6, "turnsToBuild": 6,
"techRequired": "Engineering", "techRequired": "Engineering",
"uniques": ["Gives a defensive bonus of [50]%", "Can be built outside your borders"]] "uniques": ["Gives a defensive bonus of [50]%", "Can be built outside your borders"]
}, },
// Transportation // Transportation

View File

@ -197,7 +197,8 @@ object ImageGetter {
fun getResourceImage(resourceName: String, size:Float): Actor { fun getResourceImage(resourceName: String, size:Float): Actor {
val iconGroup = getImage("ResourceIcons/$resourceName").surroundWithCircle(size) val iconGroup = getImage("ResourceIcons/$resourceName").surroundWithCircle(size)
val resource = ruleset.tileResources[resourceName]!! val resource = ruleset.tileResources[resourceName]
if(resource==null) throw Exception("No resource $resourceName found in ruleset!")
when { when {
resource.food > 0 -> iconGroup.circle.color = foodCircleColor resource.food > 0 -> iconGroup.circle.color = foodCircleColor
resource.production > 0 -> iconGroup.circle.color = productionCircleColor resource.production > 0 -> iconGroup.circle.color = productionCircleColor