Class: BitPoker::BotInterface
- Inherits:
-
Object
- Object
- BitPoker::BotInterface
- Defined in:
- lib/bitpoker/bot_interface.rb
Instance Method Summary collapse
-
#agree_one(stake_to_call) ⇒ Mixed
Bot decides whether to call opponent’s bet after first betting.
-
#agree_two(stake_to_call) ⇒ Mixed
Bot decides whether to call opponent’s stake after second betting.
-
#bet_one(min_stake) ⇒ Integer
Bot decides on a first bet.
-
#bet_two(min_stake) ⇒ Integer
Bot decides on a second bet.
-
#end_of_duel(total_score, opponent_score) ⇒ NilKlass
Bot receives result of a duel when it is over.
-
#end_of_round(score) ⇒ NilKlass
Bot receives his score after round 0 when round ended with draw, - last_bet_value when folded or lost + opponent_last_bet_value when opponent folded + last_bet_value or when won in a showdown.
-
#get_card(card) ⇒ NilKlass
Bot receives card from a croupier.
-
#introduce(rules) ⇒ NilKlass
Bot gets to know about duel rules Rules hash have following structure: { “min_card” => ?, - Minimal value from a card range “max_card” => ?, - Maximal value from the card range “max_stake” => ? - Maximal stake value to set during betting rounds “timeout” => ?, - Maximal duration (in seconds) of bot response }.
-
#name ⇒ String
Name of the bot (should be a class name).
-
#showdown(opponent_card) ⇒ NilKlass
Bot gets to know about opponent’s card.
Instance Method Details
#agree_one(stake_to_call) ⇒ Mixed
Bot decides whether to call opponent’s bet after first betting
48 49 50 |
# File 'lib/bitpoker/bot_interface.rb', line 48 def agree_one( stake_to_call ) raise NotImplementedError end |
#agree_two(stake_to_call) ⇒ Mixed
Bot decides whether to call opponent’s stake after second betting
64 65 66 |
# File 'lib/bitpoker/bot_interface.rb', line 64 def agree_two( stake_to_call ) raise NotImplementedError end |
#bet_one(min_stake) ⇒ Integer
Bot decides on a first bet
40 41 42 |
# File 'lib/bitpoker/bot_interface.rb', line 40 def bet_one( min_stake ) raise NotImplementedError end |
#bet_two(min_stake) ⇒ Integer
Bot decides on a second bet
56 57 58 |
# File 'lib/bitpoker/bot_interface.rb', line 56 def bet_two( min_stake ) raise NotImplementedError end |
#end_of_duel(total_score, opponent_score) ⇒ NilKlass
Bot receives result of a duel when it is over
93 94 95 |
# File 'lib/bitpoker/bot_interface.rb', line 93 def end_of_duel( total_score, opponent_score ) raise NotImplementedError end |
#end_of_round(score) ⇒ NilKlass
Bot receives his score after round
0 when round ended with draw,
- last_bet_value when folded or lost
+ opponent_last_bet_value when opponent folded
+ last_bet_value or when won in a showdown
84 85 86 |
# File 'lib/bitpoker/bot_interface.rb', line 84 def end_of_round( score ) raise NotImplementedError end |
#get_card(card) ⇒ NilKlass
Bot receives card from a croupier
32 33 34 |
# File 'lib/bitpoker/bot_interface.rb', line 32 def get_card( card ) raise NotImplementedError end |
#introduce(rules) ⇒ NilKlass
Bot gets to know about duel rules
Rules hash have following structure:
{
"min_card" => ?, - Minimal value from a card range
"max_card" => ?, - Maximal value from the card range
"max_stake" => ? - Maximal stake value to set during betting rounds
"timeout" => ?, - Maximal duration (in seconds) of bot response
}
22 23 24 |
# File 'lib/bitpoker/bot_interface.rb', line 22 def introduce( rules ) raise NotImplementedError end |
#name ⇒ String
Name of the bot (should be a class name)
8 9 10 |
# File 'lib/bitpoker/bot_interface.rb', line 8 def name self.class.to_s.split( '::' ).last end |
#showdown(opponent_card) ⇒ NilKlass
Bot gets to know about opponent’s card
72 73 74 |
# File 'lib/bitpoker/bot_interface.rb', line 72 def showdown( opponent_card ) raise NotImplementedError end |