acpc_poker_types 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,8 +68,18 @@ class Player
68
68
  @actions_taken_this_hand = [[]]
69
69
  end
70
70
 
71
- def to_s
72
- @name.to_s
71
+ def ==(other)
72
+ equal_on_public_info?(other) &&
73
+ @hole_cards == other.hole_cards
74
+ end
75
+
76
+ def equal_on_public_info?(other)
77
+ @name == other.name &&
78
+ @seat == other.seat &&
79
+ @chip_stack == other.chip_stack &&
80
+ @chip_contributions == other.chip_contributions &&
81
+ @chip_balance == other.chip_balance &&
82
+ @actions_taken_this_hand == other.actions_taken_this_hand
73
83
  end
74
84
 
75
85
  # @param [#to_i] blind_amount The blind amount for this player to pay.
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/spec/player_spec.rb CHANGED
@@ -174,7 +174,8 @@ describe Player do
174
174
  "#{dealer_log_directory}/#{log_description.actions_file_name}",
175
175
  "#{dealer_log_directory}/#{log_description.results_file_name}",
176
176
  log_description.player_names,
177
- AcpcDealer::DEALER_DIRECTORY
177
+ AcpcDealer::DEALER_DIRECTORY,
178
+ 40
178
179
  )
179
180
  match.for_every_seat! do |seat|
180
181
  @patient = Player.join_match(
@@ -191,8 +192,11 @@ describe Player do
191
192
  match.current_hand.data.first.state_messages[seat].users_hole_cards
192
193
  )
193
194
  match.for_every_turn! do
194
- if match.current_hand.next_action && @patient.seat == match.current_hand.next_action.seat
195
- @patient.take_action!(match.current_hand.next_action.action)
195
+ if (
196
+ match.current_hand.last_action &&
197
+ @patient.seat == match.current_hand.last_action.seat
198
+ )
199
+ @patient.take_action!(match.current_hand.last_action.action)
196
200
  end
197
201
 
198
202
  match_state = match.current_hand.current_match_state
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-31 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dmorrill10-utils
@@ -271,7 +271,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
271
  version: '0'
272
272
  segments:
273
273
  - 0
274
- hash: 514413085918503918
274
+ hash: 4187440214746204785
275
275
  required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  none: false
277
277
  requirements:
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  segments:
282
282
  - 0
283
- hash: 514413085918503918
283
+ hash: 4187440214746204785
284
284
  requirements: []
285
285
  rubyforge_project:
286
286
  rubygems_version: 1.8.24