Class ConstantStrategy

    • Field Detail

      • bet

        protected int bet
        The bet.
      • drawlimit

        protected int drawlimit
        The draw limit.
    • Constructor Detail

      • ConstantStrategy

        public ConstantStrategy​(java.lang.String name,
                                int bet,
                                int drawlimit)
        Create a new strategy.
        Parameters:
        name - The strategy name.
        bet - The bet value.
        drawlimit - The draw limit.
    • Method Detail

      • makeBet

        public int makeBet​(int account)
        Depending on the strategy, this methods calculates the bet-amount.
        Specified by:
        makeBet in interface IStrategy
        Specified by:
        makeBet in class AbstractStrategy
        Parameters:
        account - The account-status of the player.
        Returns:
        how much money the player should bet.
      • drawCard

        public boolean drawCard​(Card[] agentcards,
                                Card dealercard)
        Depending on the strategy, this methods decides whether to draw one more card or not.
        Specified by:
        drawCard in interface IStrategy
        Specified by:
        drawCard in class AbstractStrategy
        Parameters:
        agentcards - A String-array containing all the players cards.
        dealercard - This String represents the dealer's open card.
        Returns:
        whether the player should draw one more card or not.