Allow data class conversions from Beatmap to ScoreBeatmap
This commit is contained in:
parent
7d44e4014b
commit
31f301eab2
@ -205,6 +205,7 @@ class OsuApiModels {
|
||||
data class Beatmap(
|
||||
val beatmapset_id: Int,
|
||||
val difficulty_rating: Double?,
|
||||
val checksum: String?,
|
||||
val id: Int,
|
||||
val version: String?,
|
||||
val beatmapset: BeatmapSet,
|
||||
@ -222,6 +223,7 @@ class OsuApiModels {
|
||||
|
||||
@Serializable
|
||||
data class BeatmapSet(
|
||||
val id: Int,
|
||||
val artist: String?,
|
||||
val creator: String?,
|
||||
val source: String?,
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.nisemoe.nise.osu
|
||||
|
||||
fun OsuApiModels.Beatmap.toScoreBeatmap(): OsuApiModels.ScoreBeatmap =
|
||||
OsuApiModels.ScoreBeatmap(
|
||||
id = this.id,
|
||||
checksum = this.checksum,
|
||||
difficulty_rating = this.difficulty_rating,
|
||||
version = this.version,
|
||||
max_combo = this.max_combo,
|
||||
total_length = this.total_length,
|
||||
bpm = this.bpm,
|
||||
accuracy = this.accuracy,
|
||||
ar = this.ar,
|
||||
cs = this.cs,
|
||||
drain = this.drain,
|
||||
count_circles = this.count_circles,
|
||||
count_sliders = this.count_sliders,
|
||||
count_spinners = this.count_spinners,
|
||||
)
|
||||
|
||||
fun OsuApiModels.BeatmapSet.toScoreBeatmapSet(): OsuApiModels.ScoreBeatmapset =
|
||||
OsuApiModels.ScoreBeatmapset(
|
||||
id = this.id,
|
||||
title = this.title,
|
||||
artist = this.artist,
|
||||
creator = this.creator,
|
||||
source = this.source,
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user