acpc_dealer_data 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -80,13 +80,7 @@ class PokerMatchData
80
80
  match_def.game_def.number_of_players.times do |seat|
81
81
  @seat = seat
82
82
 
83
- @players = @match_def.player_names.length.times.map do |seat_j|
84
- Player.join_match(
85
- @match_def.player_names[seat_j],
86
- seat_j,
87
- @match_def.game_def.chip_stacks[seat_j]
88
- )
89
- end
83
+ initialize_players!
90
84
 
91
85
  yield seat
92
86
  end
@@ -102,7 +96,9 @@ class PokerMatchData
102
96
  def all_in?(seat=@seat) @players[seat].all_in? end
103
97
  def active?(seat=@seat) @players[seat].active? end
104
98
 
105
- def for_every_hand!
99
+ def for_every_hand!(num_hands=@data.length)
100
+ initialize_players!
101
+
106
102
  @data.each_index do |i|
107
103
  @hand_number = i
108
104
 
@@ -115,6 +111,8 @@ class PokerMatchData
115
111
  end
116
112
 
117
113
  yield @hand_number
114
+
115
+ break if @hand_number + 1 >= num_hands
118
116
  end
119
117
 
120
118
  if @chip_distribution != @players.map { |p| p.chip_balance }
@@ -170,6 +168,8 @@ class PokerMatchData
170
168
  @match_def.game_def.chip_stacks[seat]
171
169
  )
172
170
  end
171
+
172
+ self
173
173
  end
174
174
 
175
175
  def set_chip_distribution!(final_score)
@@ -1,3 +1,3 @@
1
1
  module AcpcDealerData
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_dealer_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  segments:
166
166
  - 0
167
- hash: -2795180141698548601
167
+ hash: -3064166929746132527
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  segments:
175
175
  - 0
176
- hash: -2795180141698548601
176
+ hash: -3064166929746132527
177
177
  requirements: []
178
178
  rubyforge_project:
179
179
  rubygems_version: 1.8.24