Class Card

java.lang.Object
it.polimi.ingsw.model.Card
All Implemented Interfaces:
Serializable

public class Card extends Object implements Serializable
class that represent the cards, both in the library and in the board. Mutable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    the color of the card, 6 types + EMPTY
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    the most simple constructor, used to initialize the empty cards
    copy constructor for this class, used for deep copying objects
    Card(Color col)
    standard constructor to initialize card with the right color
    Card(Color col, String image)
    constructor that initialize both the color and the image
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    method used to draw the card itself (TUI)

    Methods inherited from class java.lang.Object

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

    • color

      public Color color
      the color of the card, 6 types + EMPTY
    • imagePath

      public String imagePath
  • Constructor Details

    • Card

      public Card(Color col, String image)
      constructor that initialize both the color and the image
      Parameters:
      col - the color of the card
      image - the path of the image file
    • Card

      public Card(Color col)
      standard constructor to initialize card with the right color
      Parameters:
      col - the color to set
    • Card

      public Card()
      the most simple constructor, used to initialize the empty cards
    • Card

      public Card(Card c)
      copy constructor for this class, used for deep copying objects
      Parameters:
      c - the object to copy
  • Method Details

    • draw

      public void draw()
      method used to draw the card itself (TUI)