2021-08-17 12:17:43 +02:00
|
|
|
package be.kuleuven.howlongtobeat.hltb
|
|
|
|
|
|
|
|
import kotlinx.serialization.Serializable
|
2021-08-17 15:58:19 +02:00
|
|
|
import java.net.URL
|
2021-08-17 12:17:43 +02:00
|
|
|
|
|
|
|
@Serializable
|
2021-08-19 09:46:03 +02:00
|
|
|
data class HowLongToBeatResult(val title: String, val cartCode: String, val howlong: Double, val boxartUrl: String = "") : java.io.Serializable {
|
2021-08-17 12:17:43 +02:00
|
|
|
companion object {
|
|
|
|
const val RESULT = "HowLongToBeatResult"
|
2021-08-19 09:46:03 +02:00
|
|
|
const val SNAPSHOT_URI = "SnapshotUri"
|
2021-08-17 12:17:43 +02:00
|
|
|
}
|
2021-08-17 15:58:19 +02:00
|
|
|
|
2021-08-19 17:41:02 +02:00
|
|
|
fun hasBoxart(): Boolean = boxartUrl.startsWith(HLTBClientImpl.DOMAIN)
|
2021-08-19 09:46:03 +02:00
|
|
|
fun boxartUrl(): URL = URL(boxartUrl)
|
2021-08-17 15:58:19 +02:00
|
|
|
override fun toString(): String = "$title ($howlong hrs)"
|
2021-08-17 12:17:43 +02:00
|
|
|
}
|