From 1d171f213cde5f6ba3075df426dead86d98fd509 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 15 Nov 2023 15:04:08 +0100 Subject: [PATCH] Fixes hand history stuff --- .../android/model/realm/handhistory/HandHistory.kt | 6 ++++-- .../android/ui/modules/handhistory/model/ActionList.kt | 5 +++-- .../android/ui/modules/handhistory/model/EditorViewModel.kt | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt index 6ec84ade..fd31fb77 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt +++ b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt @@ -190,9 +190,11 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable, /*** * Configures a hand history with a [handSetup] */ - fun configure(handSetup: HandSetup) { + fun configure(handSetup: HandSetup, keepPlayers: Boolean = false) { - this.playerSetups.removeAll(this.playerSetups) + if (!keepPlayers) { + this.playerSetups.removeAll(this.playerSetups) + } handSetup.tableSize?.let { this.numberOfPlayers = it } handSetup.ante?.let { this.ante = it } diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt index cae80b2a..4e09f24a 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/ActionList.kt @@ -347,8 +347,9 @@ class ActionList(var listener: ActionListListener? = null) : ArrayList