-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsers.java
More file actions
53 lines (49 loc) · 1.37 KB
/
Copy pathUsers.java
File metadata and controls
53 lines (49 loc) · 1.37 KB
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
50
51
52
53
import java.util.ArrayList;
import java.util.UUID;
/**
* A class to hold all of the Registered Users
* @author rcd1
*/
public class Users {
private static Users rUsers = null;
private static ArrayList<RegisteredUser> rUserList = new ArrayList<>();
/**
* Create a new Users()
*/
private Users() {
rUserList = DataLoader.loadUsers();
}
/**
* Set your Users to THE Users object
* @return the only Users object
*/
public static Users getInstance() {
if (rUsers == null) {
rUsers = new Users();
}
return rUsers;
}
//Getters
/**
* Get ArrayList of Registered Users
* @return The giant list of all our users
*/
public ArrayList<RegisteredUser> getRegisteredUsers(){
return rUserList;
}
/**
* Add a new RegisteredUser to the LIST
* @param userID user's ID
* @param userInfo user's info
* @param partyMembers user's bestest friends and family (maybe)
*/
public void addRegisteredUser(UUID userID, RegistrationInfo userInfo, BookingList savedBookings, ArrayList<PartyMember> partyMembers) {
rUserList.add(new RegisteredUser(userID, userInfo, savedBookings, partyMembers));
}
/**
* We're done here, save the Users where you do
*/
public void logout() {
DataWriter.saveUsers();
}
}