Resolved #8614 - trades evaluated correctly

This commit is contained in:
Yair Morgenstern
2023-02-13 20:34:04 +02:00
parent 1b22d810c5
commit cc2d1bf6f2
3 changed files with 10 additions and 5 deletions

View File

@ -1275,6 +1275,8 @@ WLTK+ =
Number of your cities celebrating\n'We Love The King Day' thanks\nto access to this resource =
WLTK demand =
WLTK- =
Trade offer =
Resources we're offering in trades =
Number of your cities\ndemanding this resource for\n'We Love The King Day' =
Politics =
Show global politics =

View File

@ -343,11 +343,6 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
newResourceSupplyList.add(resourcesMap[offer.name]!!, "Trade", offer.amount)
}
for (trade in otherCiv().tradeRequests.filter { it.requestingCiv == civInfo.civName }) {
for (offer in trade.trade.theirOffers.filter(isResourceFilter))
newResourceSupplyList.add(resourcesMap[offer.name]!!, "Trade request", -offer.amount)
}
return newResourceSupplyList
}

View File

@ -6,6 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.utils.Align
import com.unciv.UncivGame
import com.unciv.logic.civilization.Civilization
import com.unciv.logic.trade.TradeType
import com.unciv.models.ruleset.tile.ResourceSupplyList
import com.unciv.models.ruleset.tile.ResourceType
import com.unciv.models.ruleset.tile.TileResource
@ -100,6 +101,7 @@ class ResourcesOverviewTab(
"Number of your cities celebrating\n'We Love The King Day' thanks\nto access to this resource"),
DemandingWLTK("WLTK demand", "WLTK-",
"Number of your cities\ndemanding this resource for\n'We Love The King Day'"),
TradeOffer("Trade offer","Trade offer", "Resources we're offering in trades")
;
companion object {
fun safeValueOf(name: String) = values().firstOrNull { it.name == name }
@ -241,6 +243,12 @@ class ResourcesOverviewTab(
newResourceSupplyList.add(tileResource, ExtraInfoOrigin.Unimproved.name)
}
}
for (otherCiv in viewingPlayer.getKnownCivs())
for (trade in otherCiv.tradeRequests.filter { it.requestingCiv == viewingPlayer.civName })
for (offer in trade.trade.theirOffers.filter{it.type == TradeType.Strategic_Resource || it.type == TradeType.Luxury_Resource})
newResourceSupplyList.add(gameInfo.ruleset.tileResources[offer.name]!!, ExtraInfoOrigin.TradeOffer.name, offer.amount)
return newResourceSupplyList
}
}