Class Table

java.lang.Object
backend.blackjack.Table

public class Table extends Object
This class represents a table of game with abstract action then send an instruction what used to gui
  • Constructor Summary

    Constructors
    Constructor
    Description
    Table(int puntata)
    This constructor grate card and set turn and bet
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    This method checks a situation for determined a winner
    void
    This method adds card 2 for dealer and user
    int
    This method represents a double action of user
    int
    This method stops game with forfeit
    int
    This method returns a bet of user
    This method returns an array list of card for dealer
    int
    This method gets a value of game of dealer
    This method returns an array list of card for player
    int
    This method gets a value of game of player
    void
    This method represents a hit action fo dealer
    int
    This method represents a hit of player
    void
    setDealerTurn(boolean A)
    This set turn for dealer
    void
    This method represents stand action of user
    int
    win()
    This method used to calculate a win

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Table

      public Table(int puntata)
      This constructor grate card and set turn and bet
      Parameters:
      puntata - passing a bet
  • Method Details

    • getbet

      public int getbet()
      This method returns a bet of user
      Returns:
      int of a bet
    • deal

      public void deal()
      This method adds card 2 for dealer and user
    • hitPlayer

      public int hitPlayer()
      This method represents a hit of player
      Returns:
      int if user win
    • Double

      public int Double()
      This method represents a double action of user
      Returns:
      int if user win
    • stand

      public void stand()
      This method represents stand action of user
    • hitDealer

      public void hitDealer()
      This method represents a hit action fo dealer
    • getPlayerValue

      public int getPlayerValue()
      This method gets a value of game of player
      Returns:
      int of value
    • getDealerValue

      public int getDealerValue()
      This method gets a value of game of dealer
      Returns:
      int of value
    • check

      public int check()
      This method checks a situation for determined a winner
      Returns:
      int value to appeasement situation
    • win

      public int win()
      This method used to calculate a win
      Returns:
      int of value of reward
    • setDealerTurn

      public void setDealerTurn(boolean A)
      This set turn for dealer
      Parameters:
      A - true or false
    • getDealerCard

      public ArrayList<Card> getDealerCard()
      This method returns an array list of card for dealer
      Returns:
      ArrayList of card dealer
    • getPlayerCard

      public ArrayList<Card> getPlayerCard()
      This method returns an array list of card for player
      Returns:
      ArrayList of card player
    • forfeit

      public int forfeit()
      This method stops game with forfeit
      Returns:
      int 1/2 of a bet