package com.atridad.magiccounter.ui.state

import androidx.compose.runtime.Immutable
import kotlinx.serialization.Serializable

@Immutable
@Serializable
data class PlayerState(
    val id: Int,
    val name: String,
    val life: Int,
    val poison: Int,
    val commanderDamages: Map<Int, Int>,
    val scooped: Boolean = false
)

@Immutable
@Serializable
data class GameState(
    val players: List<PlayerState>,
    val startingLife: Int,
    val trackPoison: Boolean,
    val trackCommanderDamage: Boolean,
    val stopped: Boolean = false,
    val winnerPlayerId: Int? = null
)

fun defaultPlayerName(index: Int): String = "Player ${index + 1}"
