acpc_poker_player_proxy 1.6.6 → 1.6.7

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: 3799cd38eaca1932d666751c36ed76b2106b55cd
4
- data.tar.gz: 15a02ab8197510c09a0d09d38c0f5fd72d37df64
3
+ metadata.gz: fafb026573537a012b90db1b3a64eb2220212179
4
+ data.tar.gz: 73d877faa717b1d21cfc555a4c27b8b4adacc528
5
5
  SHA512:
6
- metadata.gz: 83973f32ca3bebe4111cc6d0b7753e19b175bb0cf840ec80d56b55fd8d1198b9f1bfc9fa3433c8d0b07b367c664261526a3d1ca8579d13893c786e826d398c90
7
- data.tar.gz: 52180df276e1b824aa1c38d2dab2165e7d5108115d47211ae73a95764baf00199ff334c13fe6332f8d1947e0415364a6055077681da8ffd44bb0c943ad5e19d1
6
+ metadata.gz: 4d33bb5dbad36873fb0565065c314c18aae5446502cb1b26ab44beba32b342dd26b7f25c092da7da38f84677350a0b514a6e8a06ecae9658249608995f428c3b
7
+ data.tar.gz: '08ac659e94aa51ce71bb5b52663d5fbedb1d0ac94ba86afb893f648aaf513a8cc3a43aeab15452ce494728ecf2cdf12801e1efc5c9d5035b8c95d1c79e2b2024'
@@ -57,15 +57,17 @@ class PlayerProxy < DelegateClass(AcpcPokerTypes::PlayersAtTheTable)
57
57
  # Player action interface
58
58
  # @param [PokerAction] action The action to take.
59
59
  def play!(action)
60
- begin
61
- @basic_proxy.send_action action
62
- rescue AcpcPokerBasicProxy::DealerStream::UnableToWriteToDealer => e
63
- raise MatchEnded.with_context(
64
- "Cannot take action #{action} because the match has ended!",
65
- e
66
- )
60
+ if users_turn_to_act?
61
+ begin
62
+ @basic_proxy.send_action action
63
+ rescue AcpcPokerBasicProxy::DealerStream::UnableToWriteToDealer => e
64
+ raise MatchEnded.with_context(
65
+ "Cannot take action #{action} because the match has ended!",
66
+ e
67
+ )
68
+ end
69
+ update_match_state! { yield self if block_given? }
67
70
  end
68
- update_match_state! { yield self if block_given? }
69
71
  end
70
72
 
71
73
  def match_ended?(max_num_hands = nil)
@@ -76,7 +78,7 @@ class PlayerProxy < DelegateClass(AcpcPokerTypes::PlayersAtTheTable)
76
78
  end
77
79
 
78
80
  def next_hand!
79
- if @must_send_ready
81
+ if @must_send_ready && hand_ended?
80
82
  begin
81
83
  @basic_proxy.send_ready
82
84
  rescue AcpcPokerBasicProxy::DealerStream::UnableToWriteToDealer => e
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerPlayerProxy
2
- VERSION = "1.6.6"
2
+ VERSION = "1.6.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_player_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7
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-02-04 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acpc_poker_basic_proxy