-
Notifications
You must be signed in to change notification settings - Fork 1
/
ListPlayers.java
47 lines (39 loc) · 892 Bytes
/
ListPlayers.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
import java.util.ArrayList;
import java.util.*;
import java.io.*;
/**
* Write a description of class ListPlayers here.
*
* @author github.com/fiekzz
* @version (a version number or a date)
*/
public class ListPlayers
{
private static ArrayList<PlayerObj> Players;
ListPlayers(){}
public ListPlayers(ArrayList<PlayerObj> Players)
{
setPlayers(Players);
}
void setPlayers (ArrayList<PlayerObj> Players)
{
this.Players = Players;
Collections.sort(Players);
}
static ArrayList<PlayerObj> getPlayers()
{
return Players;
}
static String getPlayerName(int i)
{
return Players.get(i).getName();
}
static int getPlayerScore(int i)
{
return Players.get(i).getScore();
}
void clearPlayers()
{
Players.clear();
}
}