acpc_poker_types 7.4.0 → 7.4.1

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: e6d8abfb13245c11549049475c1580e317e5f7c9
4
- data.tar.gz: fa482033db1d70882e3412f5a2a18ddd9e7616ca
3
+ metadata.gz: a231e94fa16122e7bd34d12668fbbf6cab813b44
4
+ data.tar.gz: 794c655074c14a83f5a1453167b23fa953917d85
5
5
  SHA512:
6
- metadata.gz: 4c8f50a9f133902e258aa222184177e1085bae0920925ec47eac2bd9571fb400c485c54942c727334421f3f1897d2dbd8e9cdd48234a235e650a6a0f91da8ccf
7
- data.tar.gz: 2932fe75d0878488e32ec8a2795ff2240957932b5b33c88a8390e84e1854c757e365afb25782375d8fef61ff2cf676dd98e9d619fdfad3a616370c046c9a6203
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
- return self unless PokerAction::MODIFIABLE_ACTIONS.include?(action.action)
504
-
505
- wager_size = ChipStack.new(
506
- action.cost.to_f - @players.amount_to_call(acting_player_position)
507
- )
508
-
509
- return self unless wager_size > @min_wager_by
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
- @min_wager_by = wager_size
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
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '7.4.0'
2
+ VERSION = '7.4.1'
3
3
  end
@@ -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.0
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-16 00:00:00.000000000 Z
11
+ date: 2013-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: process_runner