Package backend.blackjack
Class Table
java.lang.Object
backend.blackjack.Table
This class represents a table of game with abstract action then send an instruction what used to gui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
check()
This method checks a situation for determined a winnervoid
deal()
This method adds card 2 for dealer and userint
Double()
This method represents a double action of userint
forfeit()
This method stops game with forfeitint
getbet()
This method returns a bet of userThis method returns an array list of card for dealerint
This method gets a value of game of dealerThis method returns an array list of card for playerint
This method gets a value of game of playervoid
This method represents a hit action fo dealerint
This method represents a hit of playervoid
setDealerTurn
(boolean A) This set turn for dealervoid
stand()
This method represents stand action of userint
win()
This method used to calculate a win
-
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
This method returns an array list of card for dealer- Returns:
- ArrayList of card dealer
-
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
-