package com.craigvg.lichun_android.domain.models import kotlinx.serialization.Serializable /** * End-of-life summary surfaced via the `lifeSummaryEvent` message (and persisted * on `player.lifeSummary`). Drives the death recap screen and the New Life * chooser. Field names mirror the server's `LifeSummary` interface exactly * (server/src/services/health/health_manager.ts). */ @Serializable data class LifeSummary( val finalAge: Int = 0, val netWorth: Double = 0.0, val peakCareer: PeakCareer? = null, val relationshipsCount: Int = 0, val childrenCount: Int = 0, val notableEvents: List = emptyList(), val achievementsEarned: Int = 0, val lifetimeEarnings: Double = 0.0, val score: Int = 0, val diedAt: String = "", val legacy: LegacyData? = null ) /** Highest career role reached this life. */ @Serializable data class PeakCareer( val title: String = "", val bestIncome: Double = 0.0 ) /** * The heir designate (eldest living child). When present, the death screen can * offer "Continue as " via `startNewLife` mode "heir". */ @Serializable data class HeirInfo( val id: String = "", val name: String = "", val sex: String = "", val ageYears: Int = 0, val affinity: Int = 0 ) /** * Generational legacy payload computed at death and embedded in [LifeSummary]. * Tells the client whether a heir exists and how much wealth + prestige carries * forward to the next life. */ @Serializable data class LegacyData( val heir: HeirInfo? = null, val inheritance: Double = 0.0, val familyPrestige: Double = 0.0, val prestigeGained: Double = 0.0, val familyTree: List = emptyList() ) /** * One ancestor's record in the persistent family tree. Carried across the * per-life wipe; appended on each death. Mirrors the server `FamilyTreeEntry`. */ @Serializable data class FamilyTreeEntry( val name: String = "", val sex: String = "", val finalAge: Int = 0, val peakCareer: String? = null, val score: Int = 0, val netWorth: Double = 0.0, val diedAt: String = "", val generation: Int = 0 ) /** * Welcome-back offline digest delivered via the `offlineDigest` message (also * embedded in `player.offlineStats.digest`). Mirrors the server `OfflineDigest`. */ @Serializable data class OfflineDigest( val minutesAway: Int = 0, val moneyDelta: Double = 0.0, val ageYearsDelta: Int = 0, val notableEvents: List = emptyList(), val generatedAt: String = "" )