Package model
Class Person
java.lang.Object
model.Person
Parent class of the Player and Dealer Objects.
Contains information about a person in a blackjack game, such as their name and hand.
- Author:
- Michael Neuper michael@michaelneuper.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHand()getName()Returns the name of thePerson.booleanChecks if aPersonhas blackjack.voidprintFilePath(int i) Prints the file path of aCardat a given indexPrints a formatted version of the person'sHand.voidDeprecated.voidSets the name of thePerson.
-
Constructor Details
-
Person
public Person()
-
-
Method Details
-
getHand
-
setHand
Deprecated.- Parameters:
hand- theHandto set
-
getName
Returns the name of thePerson.- Returns:
- the name of the
Person
-
setName
Sets the name of thePerson.- Parameters:
name- the name to set
-
hasBlackjack
public boolean hasBlackjack()Checks if aPersonhas blackjack.- Returns:
trueif theArrayListhas a blackjack,falseotherwise
-
printHand
Prints a formatted version of the person'sHand.- Returns:
- a formatted
Stringrepresenting the person'sHand
-
printFilePath
Prints the file path of aCardat a given index -
hit
-