acpc_poker_match_state 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -3
- data/acpc_poker_match_state.gemspec +1 -1
- data/lib/acpc_poker_match_state/players_at_the_table.rb +14 -11
- data/lib/acpc_poker_match_state/version.rb +1 -1
- metadata +2 -3
- data/tasks.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b99cb18af5d5209190310006d6fedcb99de6659
|
4
|
+
data.tar.gz: 0b0d99312c5bd4fcfba3f22d0a8ec82d1a2f4cdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6518c6631753952423fb7a0f52bfd9c10dab4762853af855c981d1a3a6470c73cc1c88c0c142522ec3c4a28be12307598efdf7b43a52cbec9454a8fb07b0ae87
|
7
|
+
data.tar.gz: d043a2a7de1b4c712a1cd027d3aacf93e376ee3949c4c7a530814993aa7fb724153a3c0050d4b4e9d6a341deba4f5b8fb280e25eb346800e238f5a0202040d5f
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.rubyforge_project = "acpc_poker_match_state"
|
17
17
|
|
18
|
-
s.files = Dir.glob("lib/**/*") + Dir.glob("ext/**/*") + %w(Rakefile acpc_poker_match_state.gemspec
|
18
|
+
s.files = Dir.glob("lib/**/*") + Dir.glob("ext/**/*") + %w(Rakefile acpc_poker_match_state.gemspec README.md)
|
19
19
|
s.test_files = Dir.glob "spec/**/*"
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
@@ -261,9 +261,9 @@ class PlayersAtTheTable
|
|
261
261
|
|
262
262
|
def cost_of_action(player, action, round=round_in_which_last_action_taken)
|
263
263
|
ChipStack.new(
|
264
|
-
if action.
|
264
|
+
if action.to_acpc_character == 'c'
|
265
265
|
amount_to_call player
|
266
|
-
elsif action.
|
266
|
+
elsif action.to_acpc_character == 'b' || action.to_acpc_character == 'r'
|
267
267
|
if action.modifier
|
268
268
|
action.modifier - player.chip_contributions.sum
|
269
269
|
else
|
@@ -277,18 +277,18 @@ class PlayersAtTheTable
|
|
277
277
|
|
278
278
|
# @return [Set] The set of legal actions for the currently acting player.
|
279
279
|
def legal_actions
|
280
|
-
|
280
|
+
list_of_actions = if next_player_to_act.nil?
|
281
281
|
[]
|
282
282
|
elsif player_sees_wager?
|
283
|
-
[
|
283
|
+
['c', 'f', 'r']
|
284
284
|
elsif chips_contributed_to_pot_this_round?
|
285
|
-
[
|
285
|
+
['k', 'r']
|
286
286
|
else
|
287
|
-
[
|
287
|
+
['k', 'b']
|
288
288
|
end
|
289
289
|
|
290
|
-
|
291
|
-
set << PokerAction.new(
|
290
|
+
list_of_actions.inject(Set.new) do |set, action|
|
291
|
+
set << PokerAction.new(action)
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
@@ -365,10 +365,12 @@ class PlayersAtTheTable
|
|
365
365
|
acting_player_sees_wager: chips_contributed_to_pot_this_round?(@transition.next_state.round_in_which_last_action_taken)
|
366
366
|
}
|
367
367
|
)
|
368
|
-
|
368
|
+
unless action_with_context.to_acpc_character == 'f'
|
369
|
+
last_amount_called = amount_to_call(player_who_acted_last)
|
370
|
+
@min_wager = ChipStack.new [@min_wager.to_r, action_with_context.amount_to_put_in_pot.to_r - last_amount_called].max
|
371
|
+
end
|
369
372
|
|
370
|
-
|
371
|
-
@min_wager = ChipStack.new [@min_wager.to_i, action_with_context.amount_to_put_in_pot.to_i].max
|
373
|
+
player_who_acted_last.take_action! action_with_context
|
372
374
|
|
373
375
|
if @transition.new_round?
|
374
376
|
active_players.each { |player| player.start_new_round! }
|
@@ -403,6 +405,7 @@ class PlayersAtTheTable
|
|
403
405
|
end.map { |player_with_hand_strength| player_with_hand_strength.first }
|
404
406
|
|
405
407
|
amount_each_player_wins = pot/winning_players.length.to_r
|
408
|
+
|
406
409
|
winning_players.each do |player|
|
407
410
|
player.take_winnings! amount_each_player_wins
|
408
411
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_poker_match_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acpc_poker_types
|
@@ -149,7 +149,6 @@ files:
|
|
149
149
|
- lib/acpc_poker_match_state/match_state_transition.rb
|
150
150
|
- Rakefile
|
151
151
|
- acpc_poker_match_state.gemspec
|
152
|
-
- tasks.rb
|
153
152
|
- README.md
|
154
153
|
- spec/support/dealer_logs/3p.limit.h1000.r0.actions.log
|
155
154
|
- spec/support/dealer_logs/3p.limit.h1000.r0.log
|