Create PlayerNotificationListenerTest

This commit is contained in:
2025-03-18 22:43:08 +01:00
parent c762f31449
commit c28bc00679
5 changed files with 41 additions and 7 deletions

View File

@@ -59,10 +59,9 @@ private fun DefaultWebSocketServerSession.runWebSocket(
}
playerNotificationListener.startListening(
{ outgoingFrameChannel.trySendBlocking(it) },
currentPlayer,
gameId,
)
) { outgoingFrameChannel.trySendBlocking(it) }
}
}

View File

@@ -32,9 +32,9 @@ class PlayerNotificationListener(
private val logger = KotlinLogging.logger {}
fun startListening(
outgoingNotification: (Notification) -> Unit,
currentPlayer: Player,
gameId: GameId,
outgoingNotification: (Notification) -> Unit,
) {
projectionBus.subscribe { currentState ->
if (currentState !is GameState) return@subscribe