|
|
|
|
@ -13,7 +13,6 @@ import net.pokeranalytics.android.model.interfaces.TimeFilterable |
|
|
|
|
import net.pokeranalytics.android.model.realm.Session |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.CardHolder |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import timber.log.Timber |
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
open class HandHistory : RealmObject(), RowRepresentable, Identifiable, Filterable, TimeFilterable, CardHolder { |
|
|
|
|
@ -61,7 +60,7 @@ open class HandHistory : RealmObject(), RowRepresentable, Identifiable, Filterab |
|
|
|
|
/*** |
|
|
|
|
* Number of players in the hand |
|
|
|
|
*/ |
|
|
|
|
var numberOfPlayers: Int = 4 |
|
|
|
|
var numberOfPlayers: Int = 10 |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
* Number of players in the hand |
|
|
|
|
@ -113,7 +112,6 @@ open class HandHistory : RealmObject(), RowRepresentable, Identifiable, Filterab |
|
|
|
|
|
|
|
|
|
val positions = Position.positionsPerPlayers(this.numberOfPlayers) |
|
|
|
|
|
|
|
|
|
Timber.d("noa 1 = ${this.actions.size}") |
|
|
|
|
|
|
|
|
|
var lastStraddler: Int? = null |
|
|
|
|
handSetup.straddlePositions.forEach { position -> // position are sorted here |
|
|
|
|
@ -121,7 +119,6 @@ open class HandHistory : RealmObject(), RowRepresentable, Identifiable, Filterab |
|
|
|
|
this.addAction(positionIndex, Action.Type.STRADDLE) |
|
|
|
|
lastStraddler = positionIndex |
|
|
|
|
} |
|
|
|
|
Timber.d("noa 2 = ${this.actions.size}") |
|
|
|
|
|
|
|
|
|
val totalActions = this.actions.size |
|
|
|
|
val startingPosition = lastStraddler?.let { it + 1 } ?: totalActions |
|
|
|
|
@ -129,7 +126,6 @@ open class HandHistory : RealmObject(), RowRepresentable, Identifiable, Filterab |
|
|
|
|
for (i in 0 until this.numberOfPlayers) { |
|
|
|
|
this.addAction((startingPosition + i) % this.numberOfPlayers) |
|
|
|
|
} |
|
|
|
|
Timber.d("noa 3 = ${this.actions.size}") |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|