|
|
|
@ -17,7 +17,6 @@ enum class HHKeyboard { |
|
|
|
ACTION, |
|
|
|
ACTION, |
|
|
|
AMOUNT, |
|
|
|
AMOUNT, |
|
|
|
CARD; |
|
|
|
CARD; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class HHSelection(var index: Int, var keyboard: HHKeyboard) |
|
|
|
class HHSelection(var index: Int, var keyboard: HHKeyboard) |
|
|
|
@ -43,13 +42,15 @@ class HHBuilder : BoardChangedListener { |
|
|
|
* The board cards sorted by position |
|
|
|
* The board cards sorted by position |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private lateinit var boardManager: BoardManager |
|
|
|
private lateinit var boardManager: BoardManager |
|
|
|
// private var sortedBoardCards: MutableList<Card> = mutableListOf() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
|
|
|
* A LinkedHashSet containing the sorted positions at the table |
|
|
|
|
|
|
|
*/ |
|
|
|
var positions: LinkedHashSet<Position> = linkedSetOf() |
|
|
|
var positions: LinkedHashSet<Position> = linkedSetOf() |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
* Creates a builder using a [handSetup] |
|
|
|
* Creates a builder using a [handSetup] |
|
|
|
* Creates a new Hand History and configures it according to the [handSetup] |
|
|
|
* Also creates a new Hand History and configures it according to the [handSetup] |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
constructor(handSetup: HandSetup) { |
|
|
|
constructor(handSetup: HandSetup) { |
|
|
|
val handHistory = HandHistory() |
|
|
|
val handHistory = HandHistory() |
|
|
|
@ -69,7 +70,6 @@ class HHBuilder : BoardChangedListener { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun actionForIndex(index: Int) : ComputedAction { |
|
|
|
private fun actionForIndex(index: Int) : ComputedAction { |
|
|
|
return this.sortedActions[index] |
|
|
|
return this.sortedActions[index] |
|
|
|
// return this.sortedActions.first { it.action.index == index } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
@ -705,9 +705,13 @@ class HHBuilder : BoardChangedListener { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.rowRepresentables = rows |
|
|
|
this.rowRepresentables = rows |
|
|
|
// return rows |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
|
|
|
* This function evaluates whether the street, identified by an action [index], |
|
|
|
|
|
|
|
* has its action closed, meaning no more player are required to play. |
|
|
|
|
|
|
|
* In case of closing, the function returns the next logical Street |
|
|
|
|
|
|
|
*/ |
|
|
|
private fun isStreetActionClosed(index: Int) : Street? { |
|
|
|
private fun isStreetActionClosed(index: Int) : Street? { |
|
|
|
|
|
|
|
|
|
|
|
val currentStreet = this.actionForIndex(index).action.street |
|
|
|
val currentStreet = this.actionForIndex(index).action.street |
|
|
|
@ -751,6 +755,9 @@ class HHBuilder : BoardChangedListener { |
|
|
|
return null |
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
|
|
|
* Adds a [street] header to a [rowRepresentables] list with a given [potSize] |
|
|
|
|
|
|
|
*/ |
|
|
|
private fun addStreetHeader(rowRepresentables: MutableList<RowRepresentable>, street: Street, potSize: Double) { |
|
|
|
private fun addStreetHeader(rowRepresentables: MutableList<RowRepresentable>, street: Street, potSize: Double) { |
|
|
|
val headerView = CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = street.resId) |
|
|
|
val headerView = CustomizableRowRepresentable(customViewType = HandRowType.HEADER, resId = street.resId) |
|
|
|
rowRepresentables.add(headerView) |
|
|
|
rowRepresentables.add(headerView) |
|
|
|
|