acpc_poker_types 7.4.1 → 7.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a231e94fa16122e7bd34d12668fbbf6cab813b44
4
- data.tar.gz: 794c655074c14a83f5a1453167b23fa953917d85
3
+ metadata.gz: 099f30853711e2a7c0a65e11d50ab3a966d464cf
4
+ data.tar.gz: e2c91e822ac94287934c5ff12a337e1e4561be5d
5
5
  SHA512:
6
- metadata.gz: c4f7ed5a0550ad0d0e7bee9c2891f1cab1873731ab33977aeb4d4abc4f90caeb9ca5a3b0550a79835db7d5f918a47a86eabcef14463c541c8a1aed3da2999897
7
- data.tar.gz: 41ee0ab039393231f9cd748275f32c3a5f8af73ad11b77301dc4f4c694dcefff4aae41cee17373c95e0f1f949c4736c6e71d66e89951f1a9baffdf14dc89eece
6
+ metadata.gz: 48808756581261ee187fc168ea47d83d65809df856d1bd09388217832907bc6f41cafce431b2bb98521a210abb74594c42f42ad6386dcb7dac7eb909ae696fc1
7
+ data.tar.gz: c7ec858f2451f4cb4502686eeeb5d5d00f29c0c74a4aac469751e1d810528297157450f6e0b22a83bd917e548bf8ce8b40f3a3c14bd8bf51768329ac2508adc9
@@ -442,17 +442,21 @@ class MatchState < DelegateClass(String)
442
442
  cost: cost
443
443
  )
444
444
 
445
+ @player_acting_sequence[current_round] << @next_to_act
446
+ @next_to_act = @players.next_to_act(@next_to_act)
447
+
445
448
  adjust_min_wager!(
446
449
  @precise_betting_sequence[current_round].last,
447
- @next_to_act
450
+ @player_acting_sequence[current_round].last
448
451
  )
449
452
 
450
- @players[@next_to_act].append_action!(
453
+ @players[@player_acting_sequence[current_round].last].append_action!(
451
454
  @precise_betting_sequence[current_round].last, current_round
452
455
  )
453
456
 
454
- @player_acting_sequence[current_round] << @next_to_act
455
- @next_to_act = @players.next_to_act(@next_to_act)
457
+ if @next_to_act && @players[@next_to_act].stack < (@players.amount_to_call(@next_to_act) + @min_wager_by)
458
+ @min_wager_by = @players[@next_to_act].stack - @players.amount_to_call(@next_to_act)
459
+ end
456
460
 
457
461
  self
458
462
  end
@@ -500,18 +504,12 @@ class MatchState < DelegateClass(String)
500
504
  end
501
505
 
502
506
  def adjust_min_wager!(action, acting_player_position)
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
507
+ return self unless PokerAction::MODIFIABLE_ACTIONS.include?(action.action)
511
508
 
512
- if @players[acting_player_position].stack < @min_wager_by
513
- @min_wager_by = @players[acting_player_position].stack
514
- end
509
+ wager_size = ChipStack.new(
510
+ action.cost.to_f - @players.amount_to_call(acting_player_position)
511
+ )
512
+ @min_wager_by = wager_size if wager_size > @min_wager_by
515
513
 
516
514
  self
517
515
  end
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '7.4.1'
2
+ VERSION = '7.4.2'
3
3
  end
@@ -1091,7 +1091,7 @@ describe MatchState do
1091
1091
  wager_size = 10
1092
1092
  x_game_def = GameDefinition.new(
1093
1093
  first_player_positions: [0, 0, 0],
1094
- chip_stacks: [100, 200, 150],
1094
+ chip_stacks: [10000, 20000, 15000],
1095
1095
  blinds: [0, 10, 5],
1096
1096
  raise_sizes: [wager_size]*3,
1097
1097
  number_of_ranks: 3
@@ -1137,6 +1137,10 @@ describe MatchState do
1137
1137
  MatchState.parse(
1138
1138
  "MATCHSTATE:1:1:r11000c/cr19950c/c:|KhKc/Js4c9d/Jc"
1139
1139
  ).min_wager_by(game_def).must_equal 50
1140
+
1141
+ MatchState.parse(
1142
+ "MATCHSTATE:0:0:r15212:Jh7d|"
1143
+ ).min_wager_by(game_def).must_equal 4788
1140
1144
  end
1141
1145
  end
1142
1146
  describe '#next_to_act' 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.1
4
+ version: 7.4.2
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-18 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: process_runner