You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.3 KiB
53 lines
1.3 KiB
2 years ago
|
package org.poopki.duckdns.user_db.Array;
|
||
3 years ago
|
|
||
2 years ago
|
import java.util.Collections;
|
||
3 years ago
|
import java.util.List;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.UUID;
|
||
|
|
||
|
public class Group {
|
||
|
private String m_Name;
|
||
|
private List<UUID> m_MemberList = new ArrayList<>();
|
||
2 years ago
|
UUID ZERO_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000");
|
||
2 years ago
|
int MAX_FARM_NUM = 10;
|
||
3 years ago
|
|
||
2 years ago
|
public Group(String Name, List<UUID> uuid_list){
|
||
|
int index = 0;
|
||
|
for(UUID key: uuid_list){
|
||
|
m_MemberList.add(index,key);
|
||
|
index++;
|
||
|
}
|
||
3 years ago
|
m_Name = Name;
|
||
|
}
|
||
|
|
||
|
public void SignUp(UUID uuid){
|
||
2 years ago
|
m_MemberList.add((UUID)uuid);
|
||
3 years ago
|
}
|
||
|
|
||
|
public void Expulsion(UUID uuid){
|
||
|
m_MemberList.remove(uuid);
|
||
|
}
|
||
|
|
||
|
public boolean isMember(UUID uuid){
|
||
|
return m_MemberList.contains(uuid);
|
||
|
}
|
||
2 years ago
|
public int getMemMaxNUM(){
|
||
|
return MAX_FARM_NUM;
|
||
|
}
|
||
3 years ago
|
public List<UUID> getGroupMembers(){ return m_MemberList;}
|
||
2 years ago
|
public int getMemNUM(){
|
||
|
int num = m_MemberList.size();
|
||
|
return num;
|
||
|
}
|
||
2 years ago
|
|
||
3 years ago
|
public String getGroupName(){ return m_Name; }
|
||
2 years ago
|
public int isEmpty(){return m_MemberList.size();}
|
||
3 years ago
|
public boolean isOwner(UUID uuid){
|
||
2 years ago
|
if(m_MemberList.get(0).equals(uuid)){
|
||
3 years ago
|
return true;
|
||
|
}else{
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|