acpc_poker_types 6.0.1 → 6.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acpc_poker_types/match_state.rb +12 -4
- 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: b4356bae466a6937d427c1addffe9b4b56a56752
|
4
|
+
data.tar.gz: 53d930d856434f2e99229eba50d53bb9c49c0777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445658f326cc4a00cfe5dee77be60bf2b88c5d59cb341a7ea7d7d7bbc1656ae49ec5d4fa00829fa1d234391521eddd86b9c896e1bc7c7e9897f9248a2d7e8164
|
7
|
+
data.tar.gz: a5ac949dddab857a288f1b641b91627760d70c4c09e041c8865f5854ea0561d319c0d55a100d551e938758f9d3e681a1cb6eda94e9209d77237481f07bbbc19c
|
@@ -199,11 +199,15 @@ class MatchState
|
|
199
199
|
|
200
200
|
# @return [Boolean] Reports whether or not it is the first state of the first round.
|
201
201
|
def first_state_of_first_round?
|
202
|
-
@first_state_of_first_round
|
202
|
+
return @first_state_of_first_round unless @first_state_of_first_round.nil?
|
203
|
+
|
204
|
+
@first_state_of_first_round = @betting_sequence_string.empty?
|
203
205
|
end
|
204
206
|
|
205
207
|
def first_state_of_round?
|
206
|
-
@first_state_of_round
|
208
|
+
return @first_state_of_round unless @first_state_of_round.nil?
|
209
|
+
|
210
|
+
@first_state_of_round = @betting_sequence_string[-1] == BETTING_SEQUENCE_SEPARATOR
|
207
211
|
end
|
208
212
|
|
209
213
|
# @return [Integer] The number of players in this match.
|
@@ -314,7 +318,9 @@ class MatchState
|
|
314
318
|
|
315
319
|
# @return [Boolean] +true+ if the hand has ended, +false+ otherwise.
|
316
320
|
def hand_ended?(game_def)
|
317
|
-
@hand_ended
|
321
|
+
return @hand_ended unless @hand_ended.nil?
|
322
|
+
|
323
|
+
@hand_ended = reached_showdown? || players(game_def).count { |player| player.inactive? } >= number_of_players - 1
|
318
324
|
end
|
319
325
|
|
320
326
|
def reached_showdown?
|
@@ -322,7 +328,9 @@ class MatchState
|
|
322
328
|
end
|
323
329
|
|
324
330
|
def opponents_cards_visible?
|
325
|
-
@opponents_cards_visible
|
331
|
+
return @opponents_cards_visible unless @opponents_cards_visible.nil?
|
332
|
+
|
333
|
+
@opponents_cards_visible = all_hands.count { |h| !h.empty? } > 1 # At least one opponent hand visible
|
326
334
|
end
|
327
335
|
|
328
336
|
def pot(game_def)
|