|
|
|
|
@ -211,30 +211,32 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable, |
|
|
|
|
|
|
|
|
|
this.actions.clear() |
|
|
|
|
|
|
|
|
|
val blindValues = this.blindValues |
|
|
|
|
var blindValues = this.blindValues |
|
|
|
|
if (blindValues.isNotEmpty()) { |
|
|
|
|
blindValues.forEachIndexed { index, blind -> |
|
|
|
|
val action = when(index) { |
|
|
|
|
0 -> Action.Type.POST_SB |
|
|
|
|
1 -> Action.Type.POST_BB |
|
|
|
|
else -> Action.Type.STRADDLE |
|
|
|
|
else -> null |
|
|
|
|
} |
|
|
|
|
this.addAction(index, action, blind) |
|
|
|
|
action?.let { this.addAction(index, action, blind) } |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.addAction(0, Action.Type.POST_SB, this.oldSmallBlind) |
|
|
|
|
this.addAction(1, Action.Type.POST_BB, this.oldBigBlind) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// var lastStraddler: Int? = null |
|
|
|
|
|
|
|
|
|
blindValues = blindValues.drop(2) |
|
|
|
|
val positions = Position.positionsPerPlayers(this.numberOfPlayers) |
|
|
|
|
handSetup.straddlePositions.forEach { position -> // position are sorted here |
|
|
|
|
handSetup.straddlePositions.forEachIndexed { index, position -> // position are sorted here |
|
|
|
|
val positionIndex = positions.indexOf(position) |
|
|
|
|
this.addAction(positionIndex, Action.Type.STRADDLE) |
|
|
|
|
// lastStraddler = positionIndex |
|
|
|
|
val amount = if (index < blindValues.size) { blindValues[index] } else null |
|
|
|
|
this.addAction(positionIndex, Action.Type.STRADDLE, amount) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// var lastStraddler: Int? = null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// val totalActions = this.actions.size |
|
|
|
|
// val startingPosition = lastStraddler?.let { it + 1 } ?: totalActions |
|
|
|
|
|
|
|
|
|
|