summaryrefslogtreecommitdiff
path: root/sw-client/src/commonMain/kotlin
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2020-01-05 12:31:46 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2020-01-05 18:19:32 +0100
commit0adc5ecf270905d565ff7dfc460f0967f356d32a (patch)
tree2a6b87c32728cb0632cfb290903c4f1a5af28b72 /sw-client/src/commonMain/kotlin
parentRemove unnecessary EAP Kotlin repository (diff)
downloadseven-wonders-0adc5ecf270905d565ff7dfc460f0967f356d32a.tar.gz
seven-wonders-0adc5ecf270905d565ff7dfc460f0967f356d32a.tar.bz2
seven-wonders-0adc5ecf270905d565ff7dfc460f0967f356d32a.zip
Upgrade to Krossbow 0.4.1
Diffstat (limited to 'sw-client/src/commonMain/kotlin')
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
index 70cefbcc..691a3f0a 100644
--- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
+++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
@@ -3,8 +3,8 @@ package org.luxons.sevenwonders.client
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.map
import org.hildan.krossbow.client.KrossbowClient
-import org.hildan.krossbow.engines.KrossbowSession
-import org.hildan.krossbow.engines.KrossbowSubscription
+import org.hildan.krossbow.client.KrossbowSession
+import org.hildan.krossbow.client.KrossbowSubscription
import org.luxons.sevenwonders.model.CustomizableSettings
import org.luxons.sevenwonders.model.GameState
import org.luxons.sevenwonders.model.PlayerTurnInfo
@@ -29,12 +29,12 @@ class SevenWondersClient {
}
}
-suspend inline fun <reified T : Any> KrossbowSession.request(
+suspend inline fun <reified T : Any, reified U : Any> KrossbowSession.request(
sendDestination: String,
receiveDestination: String,
- payload: Any? = null
-): T {
- val sub = subscribe<T>(receiveDestination)
+ payload: T? = null
+): U {
+ val sub = subscribe<U>(receiveDestination)
send(sendDestination, payload)
val msg = sub.messages.receive()
sub.unsubscribe()
bgstack15