simplify tests

This commit is contained in:
2025-03-08 01:23:08 +01:00
parent 51d857513c
commit 3080e515d6
2 changed files with 16 additions and 27 deletions

View File

@@ -1,14 +1,10 @@
package eventDemo
import eventDemo.app.command.command.GameCommand
import eventDemo.app.entity.Card
import eventDemo.app.entity.Deck
import io.ktor.websocket.Frame
import kotlinx.coroutines.channels.SendChannel
import kotlinx.serialization.json.Json
fun Deck.allCardCount(): Int = stack.size + discard.size + playersHands.values.flatten().size
fun Deck.allCards(): Set<Card> = stack + discard + playersHands.values.flatten()
suspend fun SendChannel<Frame>.send(command: GameCommand) = send(Frame.Text(Json.encodeToString(command)))
// suspend fun SendChannel<Frame>.send(command: GameCommand) = send(Frame.Text(Json.encodeToString(command)))