class BitPoker::BotInterface

Public Instance Methods

agree_one( stake_to_call ) click to toggle source

Bot decides whether to call opponent’s bet after first betting

@param [Integer] stake_to_call Opponent’s bet after betting round @return [Mixed] True of false

# File lib/bitpoker/bot_interface.rb, line 48
def agree_one( stake_to_call )
   raise NotImplementedError
end
agree_two( stake_to_call ) click to toggle source

Bot decides whether to call opponent’s stake after second betting

@param [Integer] stake_to_call Opponent’s bet @return [Mixed] True of false

# File lib/bitpoker/bot_interface.rb, line 64
def agree_two( stake_to_call )
   raise NotImplementedError
end
bet_one( min_stake ) click to toggle source

Bot decides on a first bet

@param [Integer] min_stake Minimal stake to bet @return [Integer] Bet value that is a number from range (min_stake; max_stake)

# File lib/bitpoker/bot_interface.rb, line 40
def bet_one( min_stake )
   raise NotImplementedError
end
bet_two( min_stake ) click to toggle source

Bot decides on a second bet

@param [Integer] min_stake Minimal stake to bet @return [Integer] Bet value that is a number from range (min_stake; max_stake)

# File lib/bitpoker/bot_interface.rb, line 56
def bet_two( min_stake )
   raise NotImplementedError
end
end_of_duel( total_score, opponent_score ) click to toggle source

Bot receives result of a duel when it is over

@param [Integer] total_score Total score received in the duel @param [Integer] opponent_score Total score received by a opponent @return [NilKlass] Response is not required

# File lib/bitpoker/bot_interface.rb, line 93
def end_of_duel( total_score, opponent_score )
    raise NotImplementedError
end
end_of_round( score ) click to toggle source

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

@param [Integer]

@return [NilKlass] Response is not required

# File lib/bitpoker/bot_interface.rb, line 84
def end_of_round( score )
    raise NotImplementedError
end
get_card( card ) click to toggle source

Bot receives card from a croupier

@param [Integer] card Random number from the card range @param [Integer] card Minimal number from the card range @param [Integer] card Maximal number from the card range @return [NilKlass] Response is not required

# File lib/bitpoker/bot_interface.rb, line 32
def get_card( card )
   raise NotImplementedError
end
introduce( rules ) click to toggle source

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
   }

@param [Hash] rules @return [NilKlass] Response is not required

# File lib/bitpoker/bot_interface.rb, line 22
def introduce( rules )
   raise NotImplementedError
end
name() click to toggle source

Name of the bot (should be a class name)

@return [String]

# File lib/bitpoker/bot_interface.rb, line 8
def name
   self.class.to_s.split( '::' ).last
end
showdown( opponent_card ) click to toggle source

Bot gets to know about opponent’s card

@param [Integer] opponent_card @return [NilKlass] Response is not required

# File lib/bitpoker/bot_interface.rb, line 72
def showdown( opponent_card )
   raise NotImplementedError
end