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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdfea85f6f2b2b796bedf4d2908e40e840d029f6
4
- data.tar.gz: ded5cd67c1bfcaffd5623e89defe8d25572370a2
3
+ metadata.gz: bb9195e91a0eab277871fd488bfabf53ca12209f
4
+ data.tar.gz: 6deeed0a81977dc0e4da3cbe0cf3f957eba0215f
5
5
  SHA512:
6
- metadata.gz: 8d7329740b7ddd8e217fb9aebba88ee13e673ba2c60d536d7873fa837a0b2677009caf39e7f4184ac14cce1b35a98652e8b80f2b2e6ee96a3eda5202b1a26900
7
- data.tar.gz: 27c04ec8f3b44a0e11ddd0ecc863d33eedb7be4b0b061f839215bd7c2be2bf77ed903150a19fc2b60390ac1d06f5c6af4c664cbf7697bc4d30b6a8295b7784a1
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
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '7.7.2'
2
+ VERSION = '7.8.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.7.2
4
+ version: 7.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill