Design

PlayerCancellation uses the cancellation betting system. This player allocates their available budget into a sequence of bets that have an accelerating potential gain as well as recouping any losses.

Fields

  • List sequence = new List();

    This List keeps the bet amounts; wins are removed from this list and losses are appended to this list. THe current bet is the first value plus the last value.

  • Outcome outcome ;

    This is the player's preferred outcome.

Constructors

  • PlayerCancellation();

    This uses the resetSequence method to initalize the sequence of numbers used to establish the bet amount. This also picks a suitable even money Outcome, for example, black.

Methods

  • resetSequence();

    Puts the initial sequence of six Integer instances into the sequence variable. These Integers are built from the values 1 through 6.

  • void placeBets();

    Creates a bet from the sum of the first and last values of sequence. The first value is at index 0. The last value's position depends on the size of the List.

  • void win(Bet bet);

    Uses the superclass method to update the stake with an amount won. It then removes the fist and last element from sequence.

  • void lose(Bet bet);

    Uses the superclass method to update the stake with an amount lost. It then appends the sum of the first and list elements of sequence to the end of sequence as a new Integer value.