{"size": 1307, "ext": "js", "max_stars_repo_path": "player_actions.js", "max_stars_repo_name": "kbence/poker-player-big-fish", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "player_actions.js", "max_issues_repo_name": "kbence/poker-player-big-fish", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "player_actions.js", "max_forks_repo_name": "kbence/poker-player-big-fish", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.803030303, "max_line_length": 72, "alphanum_fraction": 0.6182096404}
module.exports = function(game_state){

  //module object
  var g = this;
  
  //current game_state
  g.game_state = game_state;
  
  g.bet = parseInt(game_state.players[game_state.in_action]["bet"], 10);
  g.current_buy_in = parseInt(game_state.current_buy_in, 10);
  g.minimum_raise = parseInt(game_state.minimum_raise, 10);
  
  //fold cards
  g.doFold = function() {
    return 0;
  };
  
  //check available in this turn?
  g.checkAvailable = function() {
    return (g.current_buy_in == g.bet);
  };
  
  // call only if checkAvailable is true! otherwise cards folded
  g.doCheck = function() {
    return 0;
  };
  
  g.doCall = function() {
    return g.minimumBet();
  };

  g.minimumBet = function() {
    var min_bet = g.current_buy_in-g.bet;
    if (min_bet <= 0) {
      return g.doCheck();
    } else {
      return min_bet;
    }
  };
  
  g.doRaiseMin = function() {
    return g.current_buy_in - g.bet + g.minimum_raise;
  };

  g.doRaiseNum = function(num) {
    return g.doRaiseMin()+num;
  };

  //TODO: FIX MAX RAISE!
  g.doRaiseMax = function() {
    return g.doRaiseMin();
  };
  
  g.doAllIn = function() {
    return 10000;
  };
  
  //TODO: RAISE BASED ON PERCENT OF STACK
  g.doRaisePercent = function() {
  	return g.doRaiseMin();
  };
  
  //export module object
  return g;
};
