This commit is contained in:
yairm210 2025-02-20 21:28:25 +02:00
parent f872150da4
commit 7a35388e7a
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class ResourceSupplyList(
/** Fetch a [ResourceSupply] entry or `null` if no match found */
fun get(resource: TileResource, origin: String) =
firstOrNull { it.resource == resource && it.origin == origin }
firstOrNull { it.resource.name == resource.name && it.origin == origin }
/** Get the total amount for a resource by [resourceName] */
fun sumBy(resourceName: String) =

View File

@ -57,7 +57,7 @@ class ResourcesOverviewTab(
private val resourceDrilldown: ResourceSupplyList = viewingPlayer.detailedCivResources
private val extraDrilldown: ResourceSupplyList = getExtraDrilldown()
private val allResources = ResourceSupplyList().apply { addAll(resourceDrilldown.asSequence() + extraDrilldown.asSequence()) }
private val allResources = ResourceSupplyList().apply { add(resourceDrilldown); add(extraDrilldown) }
// Order of source ResourceSupplyList: by tiles, enumerating the map in that spiral pattern
// UI should not surprise player, thus we need a deterministic and guessable order