fixed issue so that UserGroup stays as a singleton instance so that all users are stored in it properly

This commit is contained in:
bobbert committed 2025-04-02 13:21:52 +01:00
1 parent eb233f43f9
commit 1ea89164f4
2 files changed
+18 -7

No files matched your search

+9 -2
View File
@@ -4,14 +4,21 @@ import java.util.ArrayList;
public class UserGroup {
private static ArrayList<User> users;
private static UserGroup instance;
private ArrayList<User> users;
private UserGroup() {
users = new ArrayList<>();
}
public static UserGroup getInstance() {
if (instance == null) {
instance = new UserGroup();
}
return instance;
}
public static ArrayList<User> getUsers() {
public ArrayList<User> getUsers() {
return users;
}