-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
43 lines (34 loc) · 759 Bytes
/
Player.java
File metadata and controls
43 lines (34 loc) · 759 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
43
import java.net.Socket;
import java.util.ArrayList;
public class Player {
private String name;
private ArrayList<Card> hand;
private ArrayList<Card> wonCards;
private Socket socket;
public Player(String name) {
this.name = name;
this.hand = new ArrayList<>();
this.wonCards = new ArrayList<>();
}
public String getName() {
return name;
}
public void addToHand(Card card) {
hand.add(card);
}
public ArrayList<Card> getHand() {
return hand;
}
public void addToWonCards(Card card) {
wonCards.add(card);
}
public ArrayList<Card> getWonCards() {
return wonCards;
}
public void setSocket(Socket socket) {
this.socket = socket;
}
public Socket getSocket() {
return socket;
}
}