acpc_poker_types 7.8.5 → 7.8.6
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/hand_player.rb +3 -5
- data/lib/acpc_poker_types/version.rb +1 -1
- data/spec/hand_player_spec.rb +3 -2
- 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: adf52cb90bef01a1dcbd805525dc0c2d8202a5c2
|
4
|
+
data.tar.gz: 71f5d03ae1cbba90710bc6cc7048db272652f9e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0deb35c38b6f913c344ede565a40363ae565a42376bce19d259e952740c60201f368990aa7323a59966ee206d905a3dc7524934115fdf0380e924f8bf5951943
|
7
|
+
data.tar.gz: b71fdbd0981c9202ec48f241c6faed391c39955206869237769ec4918c6fa5d289eb81cf5d1f652a4cb4b36d12501a96a79f6de14feccb51507c893437763a40
|
@@ -10,7 +10,7 @@ module AcpcPokerTypes
|
|
10
10
|
|
11
11
|
# Class to model a player during a hand from information in a +MatchState+
|
12
12
|
class HandPlayer
|
13
|
-
exceptions :
|
13
|
+
exceptions :inactive
|
14
14
|
|
15
15
|
# @return [AcpcPokerTypes::ChipStack] This player's chip stack at the beginning of the
|
16
16
|
# hand before paying their ante.
|
@@ -33,11 +33,9 @@ class HandPlayer
|
|
33
33
|
# @param initial_chip_stack [#to_i]
|
34
34
|
# @param ante [#to_i]
|
35
35
|
def initialize(hand, initial_stack, ante)
|
36
|
-
raise UnableToPayAnte if ante > initial_stack
|
37
|
-
|
38
36
|
@hand = hand
|
39
37
|
@initial_stack = ChipStack.new initial_stack
|
40
|
-
@ante = ChipStack.new ante
|
38
|
+
@ante = ChipStack.new [ante, initial_stack].min
|
41
39
|
@actions = [[]]
|
42
40
|
@winnings = ChipStack.new 0
|
43
41
|
end
|
@@ -162,4 +160,4 @@ class HandPlayer
|
|
162
160
|
betting_type != GameDefinition::BETTING_TYPES[:limit] && min_wager_by_cost < stack
|
163
161
|
end
|
164
162
|
end
|
165
|
-
end
|
163
|
+
end
|
data/spec/hand_player_spec.rb
CHANGED
@@ -26,8 +26,9 @@ describe HandPlayer do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '::new' do
|
29
|
-
it '
|
30
|
-
|
29
|
+
it 'works properly if the player is unable to pay the ante' do
|
30
|
+
patient = HandPlayer.new HAND, INITIAL_CHIP_STACK, INITIAL_CHIP_STACK + 1
|
31
|
+
patient.ante.must_equal INITIAL_CHIP_STACK
|
31
32
|
end
|
32
33
|
it 'works' do
|
33
34
|
[0, 100].each do |ante|
|
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.8.
|
4
|
+
version: 7.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process_runner
|