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 ea338803..73d93282 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 @@ -95,7 +95,7 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable, /*** * Number of players in the hand */ - var numberOfPlayers: Int = 4 + var numberOfPlayers: Int = 9 /*** * Number of players in the hand @@ -169,27 +169,27 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable, this.session = handSetup.session this.date = this.session?.handHistoryAutomaticDate ?: Date() - this.createActions() + this.createActions(handSetup) } /*** * Creates the initial actions of the hand history */ - private fun createActions() { + private fun createActions(handSetup: HandSetup) { this.actions.clear() this.addAction(0, Action.Type.POST_SB, this.smallBlind) this.addAction(1, Action.Type.POST_BB, this.bigBlind) -// val positions = Position.positionsPerPlayers(this.numberOfPlayers) - // var lastStraddler: Int? = null -// straddlePositions.forEach { position -> // position are sorted here -// val positionIndex = positions.indexOf(position) -// this.addAction(positionIndex, Action.Type.STRADDLE) + + val positions = Position.positionsPerPlayers(this.numberOfPlayers) + handSetup.straddlePositions.forEach { position -> // position are sorted here + val positionIndex = positions.indexOf(position) + this.addAction(positionIndex, Action.Type.STRADDLE) // lastStraddler = positionIndex -// } + } // val totalActions = this.actions.size // val startingPosition = lastStraddler?.let { it + 1 } ?: totalActions