acpc_poker_types 7.7.2 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/acpc_poker_types/players_at_the_table.rb +19 -0
- data/lib/acpc_poker_types/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb9195e91a0eab277871fd488bfabf53ca12209f
|
|
4
|
+
data.tar.gz: 6deeed0a81977dc0e4da3cbe0cf3f957eba0215f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2a3a26c6167e142e29d7254fc8546058f52af048b81b91bc3eb4e5964fb5a7d9b12c46ae81b408696a913437231ddba4e2899fc8c2082564411e128d74cb314
|
|
7
|
+
data.tar.gz: a881d2dffd8b6abd89a6f8eeba07e0d2c30ffa5e8b26e7a7e097d2d239597c0ca2dec1e3678a3513c0068a553117e661135e760deea3913ea14ecd1f4b67b5c1
|
|
@@ -44,10 +44,12 @@ class PlayersAtTheTable
|
|
|
44
44
|
@game_def = game_def
|
|
45
45
|
@seat = Seat.new(seat, game_def.number_of_players)
|
|
46
46
|
@match_state = nil
|
|
47
|
+
@match_has_ended = false
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
# @param [MatchState] match_state The next match state.
|
|
50
51
|
def update!(match_state)
|
|
52
|
+
@match_has_ended = false
|
|
51
53
|
@match_state = MatchState.new(match_state, @match_state, @game_def)
|
|
52
54
|
|
|
53
55
|
update_players!
|
|
@@ -60,6 +62,23 @@ class PlayersAtTheTable
|
|
|
60
62
|
@match_state.hand_ended? @game_def
|
|
61
63
|
end
|
|
62
64
|
|
|
65
|
+
def match_ended?(max_num_hands = nil)
|
|
66
|
+
@match_has_ended ||= (
|
|
67
|
+
(
|
|
68
|
+
max_num_hands &&
|
|
69
|
+
hand_ended? &&
|
|
70
|
+
match_state.hand_number >= max_num_hands - 1
|
|
71
|
+
) ||
|
|
72
|
+
(
|
|
73
|
+
match_state && match_state.stack_sizes && (
|
|
74
|
+
players.any? do |player|
|
|
75
|
+
!((player.stack + player.winnings.to_f) > 0)
|
|
76
|
+
end
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
63
82
|
# @return [Player] The player with the dealer button.
|
|
64
83
|
def dealer_player
|
|
65
84
|
return Player.new(nil) unless @match_state
|