-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.java
49 lines (48 loc) · 900 Bytes
/
Player.java
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
44
45
46
47
48
49
import java.util.*;
public class Player{
String name;
int playerId;
int matches, games, matchPoints, gamePoints;
List<Player> opponents;
public Player(String name, int id){
this.name = name;
playerId = id;
games = 0;
matches = 0;
matchPoints = 0;
gamePoints = 0;
opponents = new LinkedList<Player>();
}
public void addOpp(Player p){
opponents.add(p);
}
public void addMatch(int points){
matches++;
matchPoints += points;
}
public void addGames(int numOfGames, int points){
games += numOfGames;
gamePoints += gamePoints;
}
public List<Player> getOpp(){
return opponents;
}
public int getMatches(){
return matches;
}
public int getGames(){
return games;
}
public int getMatchPoints(){
return matchPoints;
}
public int getGamePoints(){
return gamePoints;
}
public String getName(){
return name;
}
public int getId(){
return playerId;
}
}