From c685e0f528e1b37bf020d50f566fd779344e9b44 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 21 Aug 2019 23:44:28 +0300 Subject: [PATCH] Resolved #1007 - trades and alerts now work again, which means they'll also work in multiplayer =) --- android/assets/jsons/Translations/Other.json | 2 +- .../logic/civilization/CivilizationInfo.kt | 2 ++ core/src/com/unciv/logic/trade/Trade.kt | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/android/assets/jsons/Translations/Other.json b/android/assets/jsons/Translations/Other.json index eef6ad033f..880bee42e0 100644 --- a/android/assets/jsons/Translations/Other.json +++ b/android/assets/jsons/Translations/Other.json @@ -1650,7 +1650,7 @@ Simplified_Chinese:"恭喜!你赢得了征服胜利!" Portuguese:"Você ganhou uma vitória de dominação!" } - + "You have achieved victory through the awesome power of your Culture. Your civilization's greatness - the magnificence of its monuments and the power of its artists - have astounded the world! Poets will honor you as long as beauty brings gladness to a weary heart.":{ } diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 9db3cc5dc4..685ef3bbdb 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -91,6 +91,8 @@ class CivilizationInfo { toReturn.exploredTiles.addAll(gameInfo.tileMap.values.asSequence().map { it.position }.filter { it in exploredTiles }) toReturn.notifications.addAll(notifications) toReturn.citiesCreated = citiesCreated + toReturn.popupAlerts.addAll(popupAlerts) + toReturn.tradeRequests.addAll(tradeRequests) return toReturn } diff --git a/core/src/com/unciv/logic/trade/Trade.kt b/core/src/com/unciv/logic/trade/Trade.kt index 308ee216a4..4883cfae4e 100644 --- a/core/src/com/unciv/logic/trade/Trade.kt +++ b/core/src/com/unciv/logic/trade/Trade.kt @@ -41,6 +41,17 @@ class Trade{ } -class TradeRequest(val requestingCiv:String, - /** Their offers are what they offer us, and our offers are what they want in return */ - val trade: Trade) \ No newline at end of file +class TradeRequest { + + lateinit var requestingCiv: String + + /** Their offers are what they offer us, and our offers are what they want in return */ + lateinit var trade: Trade + + constructor() // for json serialization + + constructor(requestingCiv: String, trade: Trade) { + this.requestingCiv = requestingCiv + this.trade = trade + } +}