@botpoker/engine-holdem
Version:
Texas Hold'em poker engine
21 lines (18 loc) • 600 B
JavaScript
;
/**
* Determines whether the current bet round is completed;
* that is when it remains only one active player, or
* all the active players, but the ones in All in,
* have bet the call amount.
* @name isCurrentBetSessionCompleted
* @param {Player[]} activePlayers
* @param {Number} callAmount
* @return {Boolean}
*/
const isCurrentBetSessionCompleted =
(activePlayers, callAmount) => {
return activePlayers.length === 1 ||
activePlayers.every((player) =>
player.chipsBet === callAmount || player.allin);
};
module.exports = isCurrentBetSessionCompleted;