Package cards
Klasse Card
java.lang.Object
cards.Card
This class provides the main functionalities of the cards
- Version:
- 1.0
- Autor:
- Isabell Hans
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungchoosePlayer
(Scanner scanner, ArrayList<Player> players, Player turn, boolean selfPossible) This method is used to select a playergetName()
Returns the name of this cardint
getValue()
Returns the value of this cardvoid
Holds the effect of this card To be overridden by child classesvoid
Shows the function of this card To be overridden by child classes
-
Konstruktordetails
-
Card
Constructor for the class Card- Parameter:
name
- The name of this cardvalue
- The value of this card
-
-
Methodendetails
-
getName
Returns the name of this card- Gibt zurück:
- The name of this card
-
getValue
public int getValue()Returns the value of this card- Gibt zurück:
- The value of this card
-
showFunction
public void showFunction()Shows the function of this card To be overridden by child classes -
play
public void play(Scanner scanner, ArrayList<Player> players, Player turn, Deck deck, Card firstCard) Holds the effect of this card To be overridden by child classes- Parameter:
scanner
- The scanner used by the calling methodplayers
- The list of players to play withturn
- The player whose turn it isdeck
- The current deck of cardsfirstCard
- The card drawn in the beginning
-
choosePlayer
public Player choosePlayer(Scanner scanner, ArrayList<Player> players, Player turn, boolean selfPossible) This method is used to select a player- Parameter:
scanner
- The scanner used in the calling methodplayers
- The list of players to play withturn
- The player whose turn it isselfPossible
- True if the player is allowed to select his/her self- Gibt zurück:
- The chosen player
-