You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
811 B

package model
import korlibs.time.*
sealed interface HistoryEntry: Comparable<HistoryEntry> {
val timestamp: TimeSpan
val pendingEffects: List<BattleEffect>
val battlers: List<Battler.Saved>
override fun compareTo(other: HistoryEntry): Int {
return timestamp.compareTo(other.timestamp)
}
}
data class ActionHistoryEntry(
val action: BattleAction,
override val pendingEffects: List<BattleEffect>,
override val battlers: List<Battler.Saved>,
): HistoryEntry {
override val timestamp: TimeSpan get() = action.timestamp
}
data class EffectHistoryEntry(
val effect: BattleEffect,
override val pendingEffects: List<BattleEffect>,
override val battlers: List<Battler.Saved>,
): HistoryEntry {
override val timestamp: TimeSpan get() = effect.timestamp
}