Class CardImpl

java.lang.Object
ca.uqam.info.student.skyjo.model.CardImpl
All Implemented Interfaces:
ca.uqam.info.max.skyjo.model.Card

public class CardImpl extends Object implements ca.uqam.info.max.skyjo.model.Card
Implementation of the Card's interface. Represents a numeric Skyjo card identified by its integer value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CardImpl(int numberCard)
    Creates a Card with the given int.
  • Method Summary

    Modifier and Type
    Method
    Description
    ca.uqam.info.max.skyjo.model.CardType
    Returns the type of this card.
    int
    Returns the numeric value of this card.
    Returns a formatted string representations of the card value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CardImpl

      public CardImpl(int numberCard)
      Creates a Card with the given int.
      Parameters:
      numberCard - number of the card.
  • Method Details

    • getType

      public ca.uqam.info.max.skyjo.model.CardType getType()
      Returns the type of this card.
      Specified by:
      getType in interface ca.uqam.info.max.skyjo.model.Card
      Returns:
      the type correspondig to this card's value.
    • getValue

      public int getValue()
      Returns the numeric value of this card.
      Specified by:
      getValue in interface ca.uqam.info.max.skyjo.model.Card
      Returns:
      the integer value of the card.
    • toString

      public String toString()
      Returns a formatted string representations of the card value. Single-digit values are padded with a leading space to ensure alignment in the game display.
      Specified by:
      toString in interface ca.uqam.info.max.skyjo.model.Card
      Overrides:
      toString in class Object
      Returns:
      formatted string representation of the card value.