|
|
|
@ -68,6 +68,9 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
computedActions.add(ca) |
|
|
|
computedActions.add(ca) |
|
|
|
} |
|
|
|
} |
|
|
|
this.addAll(computedActions) |
|
|
|
this.addAll(computedActions) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Adds action |
|
|
|
|
|
|
|
updateFollowupActions(sortedActions.size - 1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
@ -135,7 +138,7 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
} |
|
|
|
} |
|
|
|
else -> {} |
|
|
|
else -> {} |
|
|
|
} |
|
|
|
} |
|
|
|
Timber.d(">>> Sets $type at index: $index") |
|
|
|
// Timber.d(">>> Sets $type at index: $index") |
|
|
|
|
|
|
|
|
|
|
|
computedAction.setType(type) |
|
|
|
computedAction.setType(type) |
|
|
|
|
|
|
|
|
|
|
|
@ -310,14 +313,18 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
|
|
|
|
|
|
|
|
val street = this[index].street |
|
|
|
val street = this[index].street |
|
|
|
|
|
|
|
|
|
|
|
val refAction = getStreetLastSignificantAction(street, index) |
|
|
|
val referenceAction = getStreetLastSignificantAction(street, index) |
|
|
|
?: this.firstStreetAction(street) |
|
|
|
?: this.firstStreetAction(street) |
|
|
|
|
|
|
|
|
|
|
|
val refIndex = refAction.action.index |
|
|
|
val refIndex = referenceAction.action.index |
|
|
|
val refIndexPosition = refAction.position |
|
|
|
val refIndexPosition = referenceAction.position |
|
|
|
|
|
|
|
|
|
|
|
val activePositions = activePositions(refIndex) |
|
|
|
val activePositions = activePositions(refIndex) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove the reference position from acting, UNLESS it's the BB and players have called |
|
|
|
|
|
|
|
if (!(referenceAction.action.type == Action.Type.POST_BB && getStreetNextCalls(refIndex).isNotEmpty())) { |
|
|
|
activePositions.remove(refIndexPosition) |
|
|
|
activePositions.remove(refIndexPosition) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// We want to remove positions that already have an action after [refIndex] |
|
|
|
// We want to remove positions that already have an action after [refIndex] |
|
|
|
for (i in refIndex + 1 until this.size) { |
|
|
|
for (i in refIndex + 1 until this.size) { |
|
|
|
@ -331,7 +338,7 @@ class ActionList(var listener: ActionListListener) : ArrayList<ComputedAction>() |
|
|
|
activePositions.indexOfFirst { it.ordinal > refIndexPosition.ordinal }) |
|
|
|
activePositions.indexOfFirst { it.ordinal > refIndexPosition.ordinal }) |
|
|
|
for (i in 0 until activePositions.size) { |
|
|
|
for (i in 0 until activePositions.size) { |
|
|
|
val position = activePositions[(firstPositionAfterCurrent + i) % activePositions.size] |
|
|
|
val position = activePositions[(firstPositionAfterCurrent + i) % activePositions.size] |
|
|
|
this.addNewEmptyAction(position, refAction.street, refAction.totalPotSize) |
|
|
|
this.addNewEmptyAction(position, referenceAction.street, referenceAction.totalPotSize) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (activePositions.isNotEmpty()) { |
|
|
|
if (activePositions.isNotEmpty()) { |
|
|
|
|