PartyMatchWaitingList.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.model;
  16. import java.util.List;
  17. import javolution.util.FastList;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. /**
  20. * @author Gnacik
  21. *
  22. */
  23. public class PartyMatchWaitingList
  24. {
  25. private List<L2PcInstance> _members;
  26. private PartyMatchWaitingList()
  27. {
  28. _members = new FastList<L2PcInstance>();
  29. }
  30. public void addPlayer(L2PcInstance player)
  31. {
  32. // player.setPartyWait(1);
  33. if (!_members.contains(player))
  34. _members.add(player);
  35. }
  36. public void removePlayer(L2PcInstance player)
  37. {
  38. //player.setPartyWait(0);
  39. if (_members.contains(player))
  40. _members.remove(player);
  41. }
  42. public List<L2PcInstance> getPlayers()
  43. {
  44. return _members;
  45. }
  46. public static PartyMatchWaitingList getInstance()
  47. {
  48. return SingletonHolder._instance;
  49. }
  50. @SuppressWarnings("synthetic-access")
  51. private static class SingletonHolder
  52. {
  53. protected static final PartyMatchWaitingList _instance = new PartyMatchWaitingList();
  54. }
  55. }