acpc_poker_types 7.2.4 → 7.2.5
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/match_state.rb +24 -24
- 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: 9127758f2204df342861cdd5e76c6de58a78fdee
|
|
4
|
+
data.tar.gz: 502b43ac46044d4132f09fe30978d1b1931adbce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ff33a4324600f23aece029bb96fbc40a5fddf4fe545a8145f898c4671aa56a03d70deb50417864726e3820f815624fdcf4b7d7c0c6ed7c2dcc201df88b40ba0
|
|
7
|
+
data.tar.gz: 676bb3d6b95d46da2f8e712d2afa812e9147c840c60d3da179bd49f67742a6470ae8570d8e52d6605543a1399a5b9f6c5c6c11201586a33a96b3cb0cbc712d9c
|
|
@@ -132,15 +132,15 @@ class MatchState < DelegateClass(String)
|
|
|
132
132
|
|
|
133
133
|
# @return [Array<Hand>] The list of hole card hands for each player.
|
|
134
134
|
def all_hands
|
|
135
|
-
@all_hands
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
return @all_hands unless @all_hands.nil?
|
|
136
|
+
|
|
137
|
+
@all_hands = all_string_hands(@hands_string).map do |string_hand|
|
|
138
|
+
Hand.from_acpc string_hand
|
|
139
|
+
end
|
|
140
|
+
while @all_hands.length < number_of_players
|
|
141
|
+
@all_hands.push Hand.new
|
|
142
|
+
end
|
|
143
|
+
@all_hands
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
# @param game_def [GameDefinition] A game definition by which the actions can be interpreted
|
|
@@ -174,17 +174,17 @@ class MatchState < DelegateClass(String)
|
|
|
174
174
|
|
|
175
175
|
# @return [BoardCards] All visible community cards on the board.
|
|
176
176
|
def community_cards
|
|
177
|
-
@community_cards
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
)
|
|
183
|
-
if lcl_community_cards.round < @community_cards_string.count(COMMUNITY_CARD_SEPARATOR)
|
|
184
|
-
lcl_community_cards.next_round!
|
|
177
|
+
return @community_cards unless @community_cards.nil?
|
|
178
|
+
|
|
179
|
+
@community_cards = BoardCards.new(
|
|
180
|
+
all_sets_of_community_cards(@community_cards_string).map do |cards_per_round|
|
|
181
|
+
Card.cards(cards_per_round)
|
|
185
182
|
end
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
)
|
|
184
|
+
if @community_cards.round < @community_cards_string.count(COMMUNITY_CARD_SEPARATOR)
|
|
185
|
+
@community_cards.next_round!
|
|
186
|
+
end
|
|
187
|
+
@community_cards
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
# @return [Integer] The zero indexed current round number.
|
|
@@ -203,11 +203,11 @@ class MatchState < DelegateClass(String)
|
|
|
203
203
|
# @example If there are two opponents, one with AhKs and the other with QdJc, then
|
|
204
204
|
# list_of_opponents_hole_cards == [AhKs:Hand, QdJc:Hand]
|
|
205
205
|
def opponent_hands
|
|
206
|
-
@opponent_hands
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
return @opponent_hands unless @opponent_hands.nil?
|
|
207
|
+
|
|
208
|
+
@opponent_hands = all_hands.dup
|
|
209
|
+
@opponent_hands.delete_at @position_relative_to_dealer
|
|
210
|
+
@opponent_hands
|
|
211
211
|
end
|
|
212
212
|
|
|
213
213
|
# @return [Boolean] Reports whether or not it is the first state of the first round.
|