package org.poopki.duckdns.user_db; import org.bukkit.Bukkit; import java.util.*; public class PartyArray { private static Map m_PartyArray = new HashMap(); private static Map m_PartyNameList = new HashMap(); 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 GetPartyMembers(UUID PartyUUID){ List 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 GetPartyNameList(){ return m_PartyNameList.keySet(); } public String GetPartyName(UUID PartyUUID){ Party m_Party = m_PartyArray.get(PartyUUID); return m_Party.getGroupName(); } }