acpc_poker_types 7.4.0 → 7.4.1
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 +11 -8
- data/lib/acpc_poker_types/version.rb +1 -1
- data/spec/match_state_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a231e94fa16122e7bd34d12668fbbf6cab813b44
|
4
|
+
data.tar.gz: 794c655074c14a83f5a1453167b23fa953917d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4f7ed5a0550ad0d0e7bee9c2891f1cab1873731ab33977aeb4d4abc4f90caeb9ca5a3b0550a79835db7d5f918a47a86eabcef14463c541c8a1aed3da2999897
|
7
|
+
data.tar.gz: 41ee0ab039393231f9cd748275f32c3a5f8af73ad11b77301dc4f4c694dcefff4aae41cee17373c95e0f1f949c4736c6e71d66e89951f1a9baffdf14dc89eece
|
@@ -500,15 +500,18 @@ class MatchState < DelegateClass(String)
|
|
500
500
|
end
|
501
501
|
|
502
502
|
def adjust_min_wager!(action, acting_player_position)
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
503
|
+
if PokerAction::MODIFIABLE_ACTIONS.include?(action.action)
|
504
|
+
wager_size = ChipStack.new(
|
505
|
+
action.cost.to_f - @players.amount_to_call(acting_player_position)
|
506
|
+
)
|
507
|
+
if wager_size > @min_wager_by
|
508
|
+
@min_wager_by = wager_size
|
509
|
+
end
|
510
|
+
end
|
510
511
|
|
511
|
-
@
|
512
|
+
if @players[acting_player_position].stack < @min_wager_by
|
513
|
+
@min_wager_by = @players[acting_player_position].stack
|
514
|
+
end
|
512
515
|
|
513
516
|
self
|
514
517
|
end
|
data/spec/match_state_spec.rb
CHANGED
@@ -1119,6 +1119,25 @@ describe MatchState do
|
|
1119
1119
|
end
|
1120
1120
|
end
|
1121
1121
|
end
|
1122
|
+
it 'becomes the all-in size when there are less chips than the last min wager' do
|
1123
|
+
game_def = GameDefinition.new(
|
1124
|
+
"betting_type"=>"nolimit",
|
1125
|
+
"chip_stacks"=>[20000, 20000],
|
1126
|
+
"number_of_players"=>2,
|
1127
|
+
"blinds"=>[100, 50],
|
1128
|
+
"raise_sizes"=>nil,
|
1129
|
+
"number_of_rounds"=>4,
|
1130
|
+
"first_player_positions"=>[1, 0, 0, 0],
|
1131
|
+
"max_number_of_wagers"=>[255, 255, 255, 255],
|
1132
|
+
"number_of_suits"=>4,
|
1133
|
+
"number_of_ranks"=>13,
|
1134
|
+
"number_of_hole_cards"=>2,
|
1135
|
+
"number_of_board_cards"=>[0, 3, 1, 1]
|
1136
|
+
)
|
1137
|
+
MatchState.parse(
|
1138
|
+
"MATCHSTATE:1:1:r11000c/cr19950c/c:|KhKc/Js4c9d/Jc"
|
1139
|
+
).min_wager_by(game_def).must_equal 50
|
1140
|
+
end
|
1122
1141
|
end
|
1123
1142
|
describe '#next_to_act' do
|
1124
1143
|
it 'works at the start of new rounds' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_poker_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.4.
|
4
|
+
version: 7.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process_runner
|