Fixes straddle regression + define default number of players to 9

hh
Laurent 6 years ago
parent 968a694df9
commit ada7ec05b8
  1. 18
      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

Loading…
Cancel
Save