package com.craigvg.lichun_android.domain.models import kotlinx.serialization.Serializable /** * Date activity model * Ported from iOS DateActivitySelectionView.swift */ @Serializable data class DateActivity( val id: String = "", val name: String = "", val icon: String = "", val energyCost: Int = 0, val moneyCost: Double = 0.0, val diamondCost: Int = 0, val minAffinityGain: Int = 0, val maxAffinityGain: Int = 0, val premium: Boolean = false, val hasMiniGame: Boolean = false, val description: String = "" ) { val affinityRange: String get() = "$minAffinityGain-$maxAffinityGain" } /** * Date question for mini-game */ @Serializable data class DateQuestion( val id: String = "", val text: String = "", val responses: List = emptyList(), val round: Int = 0 ) /** * Date response option */ @Serializable data class DateResponse( val id: String = "", val text: String = "", val isCorrect: Boolean = false, val affinityImpact: Int = 0 ) /** * Date mini-game state */ data class DateMiniGameState( val id: String = "", val partnerId: String = "", val partnerName: String = "", val activityId: String = "", val currentRound: Int = 0, val correctAnswers: Int = 0, val totalAffinity: Int = 0, val questions: List = emptyList(), val isComplete: Boolean = false, val selectedResponse: DateResponse? = null, val showFeedback: Boolean = false ) { val totalRounds: Int get() = questions.size val currentQuestion: DateQuestion? get() = questions.getOrNull(currentRound) val performance: String get() { val percentage = if (totalRounds > 0) correctAnswers.toDouble() / totalRounds * 100 else 0.0 return when { percentage >= 90 -> "Excellent" percentage >= 70 -> "Great" percentage >= 50 -> "Good" else -> "Okay" } } }