/**
 * Copyright (C) 2022 by Martin Robillard. See https://codesample.info/about.html
 */
package e2.chapter2;

/**
 * Implementation of a playing card. This class yields immutable objects.
 */
public class Card {
private Rank aRank; private Suit aSuit;
/** * Creates a new card object. * * @param pRank The rank of the card. * @param pSuit The suit of the card.
* @pre pRank != null * @pre pSuit != null
*/
public Card(Rank pRank, Suit pSuit) { assert pRank != null && pSuit != null; aRank = pRank; aSuit = pSuit; }
/** * @return The rank of the card. */
public Rank getRank() { return aRank; } /** * @return The suit of the card. */ public Suit getSuit() { return aSuit; }
}