Interface ITreeBuildingScript


public interface ITreeBuildingScript
The ITreeBuildingScript interface documents the required methods of a HRC tree building script.

General scripting API

Users can write simple scripts to to fully customize the game tree in HRC. During the tree building process HRC queries the script to decide which actions should be added to the game tree at any decision point. The tree creation process will automatically handle the general game rules, such as the order to act and the legal actions and bet sizes. The values returned by the user script should depend only on the game state as provided by the IDecisionContext parameter.

This Java interface is for reference only, the actual tree building scripts have to be written in JavaScript.

  • Field Details

  • Method Details

    • getSizingsPreflop

      long[] getSizingsPreflop(IDecisionContext ctx)
      Calculates raise sizings for a Preflop decision. Raise amounts are specified as raise-to.

      Negative amounts will be discarded by the tree builder. All other amounts will be adjusted to satisfy the minimum legal sizing and to be no larger than a raise for effective stacks.

      Parameters:
      ctx - game state for the current decision point
      Returns:
      Array of zero or more sizings in 1/100th of chips
    • getSizingsPostflop

      long[] getSizingsPostflop(IDecisionContext ctx)
      Calculates the bet or raise sizings for a Postflop decision. Raise amounts are specified as raise-to.

      Negative amounts will be discarded by the tree builder. All other amounts will be adjusted to satisfy the minimum legal sizing and to be no larger than a bet or raise for effective stacks.

      Parameters:
      ctx - game state for the current decision point
      Returns:
      Array of zero or more sizings in 1/100th of chips
    • canFlatCallPreflop

      boolean canFlatCallPreflop(IDecisionContext ctx)
      Tests whether the current player is allowed to limp or flat call Preflop.
      Parameters:
      ctx - game state for the current decision point
      Returns:
      true if the current player is allowed to flat call
    • hasNextStreetBetting

      boolean hasNextStreetBetting(IDecisionContext ctx)
      Tests whether betting can take place on the following streets. If false is returned then the hand will be checked down to showdown.
      Parameters:
      ctx - game state for the current decision point
      Returns:
      true if action continues on the next street, false for a forced check-down