From 250d92d225cdd944a7c329e86ad7bd539ef2b466 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 5 Jan 2025 04:13:27 -0500 Subject: [PATCH] [+] toDict --- .../chusan/model/userdata/Chu3NetBattleLog.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3NetBattleLog.kt b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3NetBattleLog.kt index c7f3e7b8..93fd5207 100644 --- a/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3NetBattleLog.kt +++ b/src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3NetBattleLog.kt @@ -53,3 +53,24 @@ class Chu3NetBattleLog( var monthPoLong: Int = 0, var eventPoLong: Int = 0 ) : Chu3UserEntity() { + + // musicId, difficultyId, userName, score, memberName{1-3}, memberScore{1-3}, selectedMemberNum + fun toDict() = mapOf( + "musicId" to musicId, + "difficultyId" to difficultyId, + "score" to score, + "userName" to selectUserName, + "memberName1" to opponentUserName1, + "memberScore1" to opponentScore1, + "memberName2" to opponentUserName2, + "memberScore2" to opponentScore2, + "memberName3" to opponentUserName3, + "memberScore3" to opponentScore3, + "selectedMemberNum" to listOf( + true, + selectUserId == opponentUserId1, + selectUserId == opponentUserId2, + selectUserId == opponentUserId3 + ).lastIndexOf(true) + ) +}