acpc_dealer_data 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,23 +6,50 @@ require_relative 'match_definition'
6
6
 
7
7
  class ActionMessages
8
8
 
9
- attr_reader :data, :final_score, :match_def
9
+ attr_reader(
10
+ :data, :final_score, :match_def
11
+ )
12
+
13
+ ToMessage = Struct.new(
14
+ # @returns [Integer] Seat of the player receiving the message
15
+ :seat,
16
+ # @returns [MatchState] Match state received by the player
17
+ :state
18
+ )
10
19
 
20
+ FromMessage = Struct.new(
21
+ # @returns [Integer] Seat of the player acting
22
+ :seat,
23
+ # @returns [MatchState] Match state on which the action was taken
24
+ :state,
25
+ # @returns [PokerAction] Action taken
26
+ :action
27
+ )
28
+
29
+ # @param [String] to_message TO message (message to player)
11
30
  def self.parse_to_message(to_message)
12
31
  if to_message.strip.match(
13
32
  /^TO\s*(\d+)\s*at\s*[\d\.]+\s+(\S+)$/
14
33
  )
15
- {seat: $1.to_i - 1, state: MatchState.parse($2)}
34
+ ToMessage.new(
35
+ $1.to_i - 1,
36
+ MatchState.parse($2)
37
+ )
16
38
  else
17
39
  nil
18
40
  end
19
41
  end
20
42
 
43
+ # @param [String] from_message FROM message (message from player)
21
44
  def self.parse_from_message(from_message)
22
45
  if from_message.strip.match(
23
46
  /^FROM\s*(\d+)\s*at\s*[\d\.]+\s*(#{MatchState::LABEL}\S+):([#{PokerAction::LEGAL_ACPC_CHARACTERS.to_a.join('')}]\s*\d*)$/
24
47
  )
25
- {seat: $1.to_i - 1, state: MatchState.parse($2), action: PokerAction.new($3)}
48
+ FromMessage.new(
49
+ $1.to_i - 1,
50
+ MatchState.parse($2),
51
+ PokerAction.new($3)
52
+ )
26
53
  else
27
54
  nil
28
55
  end
@@ -14,10 +14,26 @@ class HandData
14
14
 
15
15
  exceptions :match_definitions_do_not_match, :invalid_data
16
16
 
17
- attr_reader :chip_distribution, :match_def, :turn_number, :data, :seat
17
+ attr_reader(
18
+ # @returns [Array<Numeric>] Chip distribution at the end of the hand
19
+ :chip_distribution,
20
+ # @returns [MatchDefinition] Game definition and match parameters
21
+ :match_def,
22
+ # @returns [Integer] Zero-index turn number within the hand
23
+ :turn_number,
24
+ # @returns [Turn] Turn data
25
+ :data,
26
+ # @returns [Integer] Seat of the active player
27
+ :seat
28
+ )
18
29
 
19
30
  # State messages are organized by seat
20
- Turn = Struct.new :state_messages, :action_message
31
+ Turn = Struct.new(
32
+ # @returns [Array<MatchState>] Match states sent during this turn
33
+ :state_messages,
34
+ # @returns [ActionMessages::FromMessage] Action message sent during this turn
35
+ :action_message
36
+ )
21
37
 
22
38
  def initialize(match_def, action_data, result)
23
39
  @match_def = match_def
@@ -56,6 +72,7 @@ class HandData
56
72
  end
57
73
  end
58
74
 
75
+ # @return [ActionMessage] Next action in the hand to be taken in the current turn.
59
76
  def next_action
60
77
  if @turn_number
61
78
  @data[@turn_number].action_message
@@ -118,7 +135,7 @@ class HandData
118
135
  message_number += number_of_state_messages
119
136
 
120
137
  action_message = if action_data.in_bounds?(message_number) &&
121
- action_data[message_number][:action]
138
+ action_data[message_number].respond_to?(:action)
122
139
 
123
140
  message_number += 1
124
141
  action_data[message_number-1]
@@ -136,15 +153,15 @@ class HandData
136
153
 
137
154
  def process_state_messages(state_messages)
138
155
  state_messages.inject([]) do |messages, raw_messages|
139
- messages[raw_messages[:seat]] = raw_messages[:state]
156
+ messages[raw_messages.seat] = raw_messages.state
140
157
  messages
141
158
  end
142
159
  end
143
160
 
144
161
  def assert_messages_have_no_actions(state_messages)
145
- if state_messages.any? { |message| !message[:action].nil? }
162
+ if state_messages.any? { |message| message.respond_to?(:action) }
146
163
  raise InvalidData, state_messages.find do |message|
147
- !message[:action].nil?
164
+ !message.action.nil?
148
165
  end.inspect
149
166
  end
150
167
  end
@@ -157,7 +174,7 @@ class HandData
157
174
 
158
175
  def assert_message_is_from_final_turn(action_data, message_number, state_messages)
159
176
  if action_data.in_bounds?(message_number+1) &&
160
- state_messages.last.round == action_data[message_number+1][:state].round
177
+ state_messages.last.round == action_data[message_number+1].state.round
161
178
  raise InvalidData, action_data[message_number].inspect
162
179
  end
163
180
  end
@@ -14,9 +14,24 @@ class PokerMatchData
14
14
 
15
15
  exceptions :match_definitions_do_not_match, :final_scores_do_not_match, :player_data_inconsistent
16
16
 
17
- attr_reader :chip_distribution, :match_def, :hand_number, :data, :players
18
- attr_accessor :seat
19
-
17
+ attr_reader(
18
+ # @returns [Array<Numeric>] Chip distribution at the end of the match
19
+ :chip_distribution,
20
+ # @returns [MatchDefinition] Game definition and match parameters
21
+ :match_def,
22
+ # @returns [Integer] Zero-index turn number within the hand
23
+ :hand_number,
24
+ # @returns [HandData] Data from each hand
25
+ :data,
26
+ # @returns [Array<Player>] Player information
27
+ :players
28
+ )
29
+ attr_accessor(
30
+ # @returns [Integer] Seat of the active player
31
+ :seat
32
+ )
33
+
34
+ # @returns [PokerMatchData]
20
35
  def self.parse_files(action_messages_file, result_messages_file, player_names, dealer_directory)
21
36
  parsed_action_messages = Celluloid::Future.new { ActionMessages.parse_file action_messages_file, player_names, dealer_directory }
22
37
  parsed_hand_results = Celluloid::Future.new { HandResults.parse_file result_messages_file, player_names, dealer_directory }
@@ -24,11 +39,12 @@ class PokerMatchData
24
39
  PokerMatchData.new parsed_action_messages.value, parsed_hand_results.value, player_names, dealer_directory
25
40
  end
26
41
 
42
+ # @returns [PokerMatchData]
27
43
  def self.parse(action_messages, result_messages, player_names, dealer_directory)
28
- parsed_action_messages = ActionMessages.parse action_messages, player_names, dealer_directory
29
- parsed_hand_results = HandResults.parse result_messages, player_names, dealer_directory
44
+ parsed_action_messages = Celluloid::Future.new { ActionMessages.parse action_messages, player_names, dealer_directory }
45
+ parsed_hand_results = Celluloid::Future.new { HandResults.parse result_messages, player_names, dealer_directory }
30
46
 
31
- PokerMatchData.new parsed_action_messages, parsed_hand_results, player_names, dealer_directory
47
+ PokerMatchData.new parsed_action_messages.value, parsed_hand_results.value, player_names, dealer_directory
32
48
  end
33
49
 
34
50
  def initialize(parsed_action_messages, parsed_hand_results, player_names, dealer_directory)
@@ -54,14 +70,10 @@ class PokerMatchData
54
70
 
55
71
  set_data! parsed_action_messages, parsed_hand_results
56
72
 
73
+ # Zero-indexed seat
57
74
  @seat = 0
58
- @players = @match_def.player_names.length.times.map do |seat|
59
- Player.join_match(
60
- @match_def.player_names[seat],
61
- seat,
62
- @match_def.game_def.chip_stacks[seat]
63
- )
64
- end
75
+
76
+ initialize_players!
65
77
  end
66
78
 
67
79
  def for_every_seat!
@@ -150,6 +162,16 @@ class PokerMatchData
150
162
 
151
163
  protected
152
164
 
165
+ def initialize_players!
166
+ @players = @match_def.player_names.length.times.map do |seat|
167
+ Player.join_match(
168
+ @match_def.player_names[seat],
169
+ seat,
170
+ @match_def.game_def.chip_stacks[seat]
171
+ )
172
+ end
173
+ end
174
+
153
175
  def set_chip_distribution!(final_score)
154
176
  @chip_distribution = []
155
177
  final_score.each do |player_name, amount|
@@ -1,3 +1,3 @@
1
1
  module AcpcDealerData
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -24,13 +24,25 @@ describe ActionMessages do
24
24
  it 'properly parses a ACPC log "TO . . ." line' do
25
25
  [
26
26
  "TO 1 at 1341695999.222281 MATCHSTATE:0:0::5d5c|\n" =>
27
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:0::5d5c|')},
27
+ ActionMessages::ToMessage.new(
28
+ 0,
29
+ MatchState.parse('MATCHSTATE:0:0::5d5c|')
30
+ ),
28
31
  "TO 2 at 1341695920.914907 MATCHSTATE:1:0:r19686:|9hQd\n" =>
29
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:0:r19686:|9hQd')},
32
+ ActionMessages::ToMessage.new(
33
+ 1,
34
+ MatchState.parse('MATCHSTATE:1:0:r19686:|9hQd')
35
+ ),
30
36
  "TO 3 at 1341696044.566738 MATCHSTATE:2:0:rf:||8dAs\n" =>
31
- {seat: 2, state: MatchState.parse('MATCHSTATE:2:0:rf:||8dAs')},
37
+ ActionMessages::ToMessage.new(
38
+ 2,
39
+ MatchState.parse('MATCHSTATE:2:0:rf:||8dAs')
40
+ ),
32
41
  "TO 1 at 1341715418.808925 MATCHSTATE:0:0:fcr17162:5d5c||\n" =>
33
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:0:fcr17162:5d5c||')}
42
+ ActionMessages::ToMessage.new(
43
+ 0,
44
+ MatchState.parse('MATCHSTATE:0:0:fcr17162:5d5c||')
45
+ )
34
46
  ].each do |to_message_to_data|
35
47
  to_message_to_data.each do |to_message, expected_values|
36
48
  ActionMessages.parse_to_message(to_message).must_equal expected_values
@@ -46,29 +58,29 @@ describe ActionMessages do
46
58
  it 'properly parses a ACPC log "FROM . . ." line' do
47
59
  [
48
60
  "FROM 2 at 1341695999.222410 MATCHSTATE:1:0::|9hQd:c\n" =>
49
- {
50
- seat: 1,
51
- state: MatchState.parse('MATCHSTATE:1:0::|9hQd'),
52
- action: PokerAction.new('c')
53
- },
61
+ ActionMessages::FromMessage.new(
62
+ 1,
63
+ MatchState.parse('MATCHSTATE:1:0::|9hQd'),
64
+ PokerAction.new('c')
65
+ ),
54
66
  "FROM 1 at 1341695920.914935 MATCHSTATE:0:0:r19686:5d5c|:r20000\n" =>
55
- {
56
- seat: 0,
57
- state: MatchState.parse('MATCHSTATE:0:0:r19686:5d5c|'),
58
- action: PokerAction.new('r20000')
59
- },
67
+ ActionMessages::FromMessage.new(
68
+ 0,
69
+ MatchState.parse('MATCHSTATE:0:0:r19686:5d5c|'),
70
+ PokerAction.new('r20000')
71
+ ),
60
72
  "FROM 3 at 1341696044.566938 MATCHSTATE:2:0:rfr:||8dAs:r\n" =>
61
- {
62
- seat: 2,
63
- state: MatchState.parse('MATCHSTATE:2:0:rfr:||8dAs'),
64
- action: PokerAction.new('r')
65
- },
73
+ ActionMessages::FromMessage.new(
74
+ 2,
75
+ MatchState.parse('MATCHSTATE:2:0:rfr:||8dAs'),
76
+ PokerAction.new('r')
77
+ ),
66
78
  "FROM 2 at 1341715418.808896 MATCHSTATE:1:0:fc:|9hQd|:r17162\n" =>
67
- {
68
- seat: 1,
69
- state: MatchState.parse('MATCHSTATE:1:0:fc:|9hQd|'),
70
- action: PokerAction.new('r17162')
71
- }
79
+ ActionMessages::FromMessage.new(
80
+ 1,
81
+ MatchState.parse('MATCHSTATE:1:0:fc:|9hQd|'),
82
+ PokerAction.new('r17162')
83
+ )
72
84
  ].each do |from_message_to_data|
73
85
  from_message_to_data.each do |from_message, expected_values|
74
86
  ActionMessages.parse_from_message(from_message).must_equal expected_values
@@ -173,24 +185,42 @@ describe ActionMessages do
173
185
  ],
174
186
  data: [
175
187
  [
176
- {seat: 0, state: MatchState.parse('MATCHSTATE:1:998:crc/cc/cc/:|TdQd/As6d6h/7h/4s')},
177
- {seat: 1, state: MatchState.parse('MATCHSTATE:0:998:crc/cc/cc/:Jc8d|/As6d6h/7h/4s')},
178
- {
179
- seat: 1,
180
- state: MatchState.parse('MATCHSTATE:0:998:crc/cc/cc/:Jc8d|/As6d6h/7h/4s'),
181
- action: PokerAction.new('r')
182
- }
188
+ ActionMessages::ToMessage.new(
189
+ 0,
190
+ MatchState.parse('MATCHSTATE:1:998:crc/cc/cc/:|TdQd/As6d6h/7h/4s')
191
+ ),
192
+ ActionMessages::ToMessage.new(
193
+ 1,
194
+ MatchState.parse('MATCHSTATE:0:998:crc/cc/cc/:Jc8d|/As6d6h/7h/4s')
195
+ ),
196
+ ActionMessages::FromMessage.new(
197
+ 1,
198
+ MatchState.parse('MATCHSTATE:0:998:crc/cc/cc/:Jc8d|/As6d6h/7h/4s'),
199
+ PokerAction.new('r')
200
+ )
183
201
  ],
184
202
  [
185
- {seat: 0, state: MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s')},
186
- {seat: 1, state: MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/r:Jc8d|/As6d6h/7h/4s')},
187
- {
188
- seat: 0,
189
- state: MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s'),
190
- action: PokerAction.new('c')
191
- },
192
- {seat: 0, state: MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/rc:Jc8d|TdQd/As6d6h/7h/4s')},
193
- {seat: 1, state: MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/rc:Jc8d|TdQd/As6d6h/7h/4s')}
203
+ ActionMessages::ToMessage.new(
204
+ 0,
205
+ MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s')
206
+ ),
207
+ ActionMessages::ToMessage.new(
208
+ 1,
209
+ MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/r:Jc8d|/As6d6h/7h/4s')
210
+ ),
211
+ ActionMessages::FromMessage.new(
212
+ 0,
213
+ MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s'),
214
+ PokerAction.new('c')
215
+ ),
216
+ ActionMessages::ToMessage.new(
217
+ 0,
218
+ MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/rc:Jc8d|TdQd/As6d6h/7h/4s')
219
+ ),
220
+ ActionMessages::ToMessage.new(
221
+ 1,
222
+ MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/rc:Jc8d|TdQd/As6d6h/7h/4s')
223
+ )
194
224
  ]
195
225
  ],
196
226
  final_score: {p1: 455, p2: -455},
@@ -214,26 +244,50 @@ describe ActionMessages do
214
244
  ],
215
245
  data: [
216
246
  [
217
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:998:cc/r5841r19996r20000:Kc6h|/QhAh8d')},
218
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000:|Qc3s/QhAh8d')},
219
- {
220
- seat: 1,
221
- state: MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000:|Qc3s/QhAh8d:c'),
222
- action: PokerAction.new('c')
223
- },
224
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:998:cc/r5841r19996r20000c//:Kc6h|Qc3s/QhAh8d/Th/9d')},
225
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000c//:Kc6h|Qc3s/QhAh8d/Th/9d')}
247
+ ActionMessages::ToMessage.new(
248
+ 0,
249
+ MatchState.parse('MATCHSTATE:0:998:cc/r5841r19996r20000:Kc6h|/QhAh8d')
250
+ ),
251
+ ActionMessages::ToMessage.new(
252
+ 1,
253
+ MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000:|Qc3s/QhAh8d')
254
+ ),
255
+ ActionMessages::FromMessage.new(
256
+ 1,
257
+ MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000:|Qc3s/QhAh8d:c'),
258
+ PokerAction.new('c')
259
+ ),
260
+ ActionMessages::ToMessage.new(
261
+ 0,
262
+ MatchState.parse('MATCHSTATE:0:998:cc/r5841r19996r20000c//:Kc6h|Qc3s/QhAh8d/Th/9d')
263
+ ),
264
+ ActionMessages::ToMessage.new(
265
+ 1,
266
+ MatchState.parse('MATCHSTATE:1:998:cc/r5841r19996r20000c//:Kc6h|Qc3s/QhAh8d/Th/9d')
267
+ )
226
268
  ],
227
269
  [
228
- {seat: 0, state: MatchState.parse('MATCHSTATE:1:999::|TdQd')},
229
- {seat: 1, state: MatchState.parse('MATCHSTATE:0:999::Jc8d|')},
230
- {
231
- seat: 0,
232
- state: MatchState.parse('MATCHSTATE:1:999::|TdQd'),
233
- action: PokerAction.new('f')
234
- },
235
- {seat: 0, state: MatchState.parse('MATCHSTATE:1:999:f:|TdQd')},
236
- {seat: 1, state: MatchState.parse('MATCHSTATE:0:999:f:Jc8d|')}
270
+ ActionMessages::ToMessage.new(
271
+ 0,
272
+ MatchState.parse('MATCHSTATE:1:999::|TdQd')
273
+ ),
274
+ ActionMessages::ToMessage.new(
275
+ 1,
276
+ MatchState.parse('MATCHSTATE:0:999::Jc8d|')
277
+ ),
278
+ ActionMessages::FromMessage.new(
279
+ 0,
280
+ MatchState.parse('MATCHSTATE:1:999::|TdQd'),
281
+ PokerAction.new('f')
282
+ ),
283
+ ActionMessages::ToMessage.new(
284
+ 0,
285
+ MatchState.parse('MATCHSTATE:1:999:f:|TdQd')
286
+ ),
287
+ ActionMessages::ToMessage.new(
288
+ 1,
289
+ MatchState.parse('MATCHSTATE:0:999:f:Jc8d|')
290
+ )
237
291
  ]
238
292
  ],
239
293
  final_score: {p1: -64658, p2: 64658},
@@ -254,17 +308,35 @@ describe ActionMessages do
254
308
  ],
255
309
  data: [
256
310
  [
257
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:999:ccc/ccc/rrcc/rrrfr:QsAs||/4d6d2d/5d/2c')},
258
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:999:ccc/ccc/rrcc/rrrfr:|3s8h|/4d6d2d/5d/2c')},
259
- {seat: 2, state: MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c')},
260
- {
261
- seat: 2,
262
- state: MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c'),
263
- action: PokerAction.new('c')
264
- },
265
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:999:ccc/ccc/rrcc/rrrfrc:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')},
266
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:999:ccc/ccc/rrcc/rrrfrc:|3s8h|Qd3c/4d6d2d/5d/2c')},
267
- {seat: 2, state: MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfrc:|3s8h|Qd3c/4d6d2d/5d/2c')}
311
+ ActionMessages::ToMessage.new(
312
+ 0,
313
+ MatchState.parse('MATCHSTATE:0:999:ccc/ccc/rrcc/rrrfr:QsAs||/4d6d2d/5d/2c')
314
+ ),
315
+ ActionMessages::ToMessage.new(
316
+ 1,
317
+ MatchState.parse('MATCHSTATE:1:999:ccc/ccc/rrcc/rrrfr:|3s8h|/4d6d2d/5d/2c')
318
+ ),
319
+ ActionMessages::ToMessage.new(
320
+ 2,
321
+ MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c')
322
+ ),
323
+ ActionMessages::FromMessage.new(
324
+ 2,
325
+ MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c'),
326
+ PokerAction.new('c')
327
+ ),
328
+ ActionMessages::ToMessage.new(
329
+ 0,
330
+ MatchState.parse('MATCHSTATE:0:999:ccc/ccc/rrcc/rrrfrc:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')
331
+ ),
332
+ ActionMessages::ToMessage.new(
333
+ 1,
334
+ MatchState.parse('MATCHSTATE:1:999:ccc/ccc/rrcc/rrrfrc:|3s8h|Qd3c/4d6d2d/5d/2c')
335
+ ),
336
+ ActionMessages::ToMessage.new(
337
+ 2,
338
+ MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfrc:|3s8h|Qd3c/4d6d2d/5d/2c')
339
+ )
268
340
  ]
269
341
  ],
270
342
  final_score: {p1: -4330, p2: 625, p3: 3705},
@@ -285,19 +357,37 @@ describe ActionMessages do
285
357
  ],
286
358
  data: [
287
359
  [
288
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:998:ccr12926r20000c:QsAs||')},
289
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:998:ccr12926r20000c:|3s8h|')},
290
- {seat: 2, state: MatchState.parse('MATCHSTATE:2:998:ccr12926r20000c:||Qd3c')},
291
- {
292
- seat: 1,
293
- state: MatchState.parse('MATCHSTATE:1:998:ccr12926r20000c:|3s8h|'),
294
- action: PokerAction.new('c')
295
- }
360
+ ActionMessages::ToMessage.new(
361
+ 0,
362
+ MatchState.parse('MATCHSTATE:0:998:ccr12926r20000c:QsAs||')
363
+ ),
364
+ ActionMessages::ToMessage.new(
365
+ 1,
366
+ MatchState.parse('MATCHSTATE:1:998:ccr12926r20000c:|3s8h|')
367
+ ),
368
+ ActionMessages::ToMessage.new(
369
+ 2,
370
+ MatchState.parse('MATCHSTATE:2:998:ccr12926r20000c:||Qd3c')
371
+ ),
372
+ ActionMessages::FromMessage.new(
373
+ 1,
374
+ MatchState.parse('MATCHSTATE:1:998:ccr12926r20000c:|3s8h|'),
375
+ PokerAction.new('c')
376
+ )
296
377
  ],
297
378
  [
298
- {seat: 0, state: MatchState.parse('MATCHSTATE:0:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')},
299
- {seat: 1, state: MatchState.parse('MATCHSTATE:1:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')},
300
- {seat: 2, state: MatchState.parse('MATCHSTATE:2:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')}
379
+ ActionMessages::ToMessage.new(
380
+ 0,
381
+ MatchState.parse('MATCHSTATE:0:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')
382
+ ),
383
+ ActionMessages::ToMessage.new(
384
+ 1,
385
+ MatchState.parse('MATCHSTATE:1:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')
386
+ ),
387
+ ActionMessages::ToMessage.new(
388
+ 2,
389
+ MatchState.parse('MATCHSTATE:2:999:ccr12926r20000cc///:QsAs|3s8h|Qd3c/4d6d2d/5d/2c')
390
+ )
301
391
  ]
302
392
  ],
303
393
  final_score: {p1: 684452, p2: 552584.5, p3: -1237036.5},
@@ -142,22 +142,22 @@ describe HandData do
142
142
  MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/:|TdQd/As6d6h/7h/4s'),
143
143
  MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/:Jc8d|/As6d6h/7h/4s')
144
144
  ],
145
- {
146
- seat: 1,
147
- state: MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/:Jc8d|/As6d6h/7h/4s'),
148
- action: PokerAction.new('r')
149
- }
145
+ ActionMessages::FromMessage.new(
146
+ 1,
147
+ MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/:Jc8d|/As6d6h/7h/4s'),
148
+ PokerAction.new('r')
149
+ )
150
150
  ),
151
151
  HandData::Turn.new(
152
152
  [
153
153
  MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s'),
154
154
  MatchState.parse('MATCHSTATE:0:999:crc/cc/cc/r:Jc8d|/As6d6h/7h/4s')
155
155
  ],
156
- {
157
- seat: 0,
158
- state: MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s'),
159
- action: PokerAction.new('c')
160
- }
156
+ ActionMessages::FromMessage.new(
157
+ 0,
158
+ MatchState.parse('MATCHSTATE:1:999:crc/cc/cc/r:|TdQd/As6d6h/7h/4s'),
159
+ PokerAction.new('c')
160
+ )
161
161
  ),
162
162
  HandData::Turn.new(
163
163
  [
@@ -191,11 +191,11 @@ describe HandData do
191
191
  MatchState.parse('MATCHSTATE:1:999::|TdQd'),
192
192
  MatchState.parse('MATCHSTATE:0:999::Jc8d|')
193
193
  ],
194
- {
195
- seat: 0,
196
- state: MatchState.parse('MATCHSTATE:1:999::|TdQd'),
197
- action: PokerAction.new('f')
198
- }
194
+ ActionMessages::FromMessage.new(
195
+ 0,
196
+ MatchState.parse('MATCHSTATE:1:999::|TdQd'),
197
+ PokerAction.new('f')
198
+ )
199
199
  ),
200
200
  HandData::Turn.new(
201
201
  [
@@ -232,11 +232,11 @@ describe HandData do
232
232
  MatchState.parse('MATCHSTATE:1:999:ccc/ccc/rrcc/rrrfr:|3s8h|/4d6d2d/5d/2c'),
233
233
  MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c')
234
234
  ],
235
- {
236
- seat: 2,
237
- state: MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c'),
238
- action: PokerAction.new('c')
239
- }
235
+ ActionMessages::FromMessage.new(
236
+ 2,
237
+ MatchState.parse('MATCHSTATE:2:999:ccc/ccc/rrcc/rrrfr:||Qd3c/4d6d2d/5d/2c'),
238
+ PokerAction.new('c')
239
+ )
240
240
  ),
241
241
  HandData::Turn.new(
242
242
  [
@@ -274,11 +274,11 @@ describe HandData do
274
274
  MatchState.parse('MATCHSTATE:1:999:ccr12926r20000c:|3s8h|'),
275
275
  MatchState.parse('MATCHSTATE:2:999:ccr12926r20000c:||Qd3c')
276
276
  ],
277
- {
278
- seat: 1,
279
- state: MatchState.parse('MATCHSTATE:1:999:ccr12926r20000c:|3s8h|'),
280
- action: PokerAction.new('c')
281
- }
277
+ ActionMessages::FromMessage.new(
278
+ 1,
279
+ MatchState.parse('MATCHSTATE:1:999:ccr12926r20000c:|3s8h|'),
280
+ PokerAction.new('c')
281
+ )
282
282
  ),
283
283
  HandData::Turn.new(
284
284
  [
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.0.1
4
+ version: 0.1.0
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-07-30 00:00:00.000000000 Z
12
+ date: 2012-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: acpc_dealer
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  segments:
166
166
  - 0
167
- hash: -608405534229312642
167
+ hash: -2795180141698548601
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: -608405534229312642
176
+ hash: -2795180141698548601
177
177
  requirements: []
178
178
  rubyforge_project:
179
179
  rubygems_version: 1.8.24