Merge remote-tracking branch 'origin/feature/casino-holdem-button-moves' into feature/casino-holdem-dealer-batch
This commit is contained in:
@@ -159,7 +159,20 @@ const HoldemState = {
|
|||||||
return ((fromIndex + delta) % count + count) % count;
|
return ((fromIndex + delta) % count + count) % count;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// The button passes to the next player, not the next chair. Moving it one seat at
|
||||||
|
// a time parks it on empty chairs — with four players spread around ten seats it
|
||||||
|
// sits on nobody most hands — and that isn't only untidy: position and blinds are
|
||||||
|
// supposed to come round to each player at the same rate, and they don't if the
|
||||||
|
// button is rotating past chairs nobody is sitting in.
|
||||||
advanceButton(state) {
|
advanceButton(state) {
|
||||||
|
for (let step = 1; step <= state.seatCount; step++) {
|
||||||
|
const index = this.nextSeatIndex(state, state.dealerSeatIndex, step);
|
||||||
|
if (state.seats[index].inHand) {
|
||||||
|
state.dealerSeatIndex = index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Nobody is dealt in; move it along anyway so it doesn't look stuck.
|
||||||
state.dealerSeatIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1);
|
state.dealerSeatIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user