|
|
|
@ -965,6 +965,13 @@ class HandHistoryViewModel : ViewModel(), RowRepresentableDataSource, CardCentra |
|
|
|
* Defines the [player] at the saved [tappedPlayerPositionIndex] |
|
|
|
* Defines the [player] at the saved [tappedPlayerPositionIndex] |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun playerSelected(player: Player) { |
|
|
|
fun playerSelected(player: Player) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove all use of the selected player |
|
|
|
|
|
|
|
this.handHistory.playerSetups.filter { it.player == player }.forEach { |
|
|
|
|
|
|
|
it.player = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Affects the player to the selected position |
|
|
|
this.tappedPlayerPositionIndex?.let { positionIndex -> |
|
|
|
this.tappedPlayerPositionIndex?.let { positionIndex -> |
|
|
|
player.realm.executeTransaction { |
|
|
|
player.realm.executeTransaction { |
|
|
|
val ps = this.handHistory.playerSetupForPosition(positionIndex) ?: this.handHistory.createPlayerSetup(positionIndex) |
|
|
|
val ps = this.handHistory.playerSetupForPosition(positionIndex) ?: this.handHistory.createPlayerSetup(positionIndex) |
|
|
|
|