-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.java
More file actions
42 lines (34 loc) · 744 Bytes
/
Copy pathCard.java
File metadata and controls
42 lines (34 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* This class defines Card interface which consists of Suit and Pips
* @author Titi Gu
*
*/
class Card
{
Suit suit;
Pips pip;
Card() {}
Card(Suit s, Pips p) { suit = s; pip = p; discarded = false;}
Card(Card c) { suit = c.suit; pip = c.pip; discarded = false;}
private boolean discarded;
/*
* Return Suit
*/
public Suit getSuit() { return suit; }
/*
* Return Pip
*/
public Pips getPip() { return pip; }
/*
* Return Card is a discarded card
*/
public boolean isDiscarded() { return discarded; }
/*
* Set a card to discarded card
*/
public void setDiscarded(boolean value) { discarded = value; }
public String toString()
{
return pip.toString() +":" + suit.toString()+ " ";
}
}