Package cards

Klasse Card

java.lang.Object
cards.Card
Bekannte direkte Unterklassen:
Baron, Countess, Guard, Handmaid, King, Priest, Prince, Princess

public class Card extends Object
This class provides the main functionalities of the cards
Version:
1.0
Autor:
Isabell Hans
  • Konstruktordetails

    • Card

      public Card(String name, int value)
      Constructor for the class Card
      Parameter:
      name - The name of this card
      value - The value of this card
  • Methodendetails

    • getName

      public String 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 method
      players - The list of players to play with
      turn - The player whose turn it is
      deck - The current deck of cards
      firstCard - 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 method
      players - The list of players to play with
      turn - The player whose turn it is
      selfPossible - True if the player is allowed to select his/her self
      Gibt zurück:
      The chosen player