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.

47 lines
1.5 KiB

package org.poopki.duckdns.user_db;
import org.bukkit.Bukkit;
import java.util.*;
public class PartyArray {
private static Map<UUID, Party> m_PartyArray = new HashMap<UUID, Party>();
private static Map<String, UUID> m_PartyNameList = new HashMap<String, UUID>();
public void CreateParty(UUID PartyUUID, String Name, UUID PlayerUUID){
m_PartyArray.put(PartyUUID, new Party(Name, PlayerUUID));
m_PartyNameList.put(Name, PartyUUID);
}
public void SignUpParty(UUID PartyUUID, UUID PlayerUUID){
Party m_Party = m_PartyArray.get(PartyUUID);
m_Party.SignUp(PlayerUUID);
}
public void ExpulsionParty(UUID PartyUUID, UUID PlayerUUID){
Party m_Party = m_PartyArray.get(PartyUUID);
m_Party.Expulsion(PlayerUUID);
}
public List<String> GetPartyMembers(UUID PartyUUID){
List<String> MembersName = new ArrayList<>();
for (UUID key : m_PartyArray.get(PartyUUID).getGroupMembers()){
MembersName.add(Bukkit.getPlayer(key).getDisplayName());
}
return MembersName;
}
public boolean isPartyMember(UUID PartyUUID, UUID PlayerUUID){
Party m_Party = m_PartyArray.get(PartyUUID);
return m_Party.isMember(PlayerUUID);
}
public Set<String> GetPartyNameList(){
return m_PartyNameList.keySet();
}
public String GetPartyName(UUID PartyUUID){
Party m_Party = m_PartyArray.get(PartyUUID);
return m_Party.getGroupName();
}
}