L2Player.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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.communityserver.model;
  16. import javolution.util.FastList;
  17. /**
  18. * This class describes a player instance
  19. *
  20. */
  21. public class L2Player
  22. {
  23. private int _objId;
  24. private String _name;
  25. private String _accountName;
  26. private int _level;
  27. private int _accessLevel;
  28. private int _clanId;
  29. private boolean _isOnline;
  30. private FastList<Integer> _friends;
  31. private FastList<Integer> _selectedFriends;
  32. private Forum _forum;
  33. public L2Player(int objId, String name, String accountName, int level, int accessLevel, int clanId, boolean isOnline)
  34. {
  35. _objId = objId;
  36. _name = name;
  37. _accountName = accountName;
  38. _level = level;
  39. _accessLevel = accessLevel;
  40. _clanId = clanId;
  41. _isOnline = isOnline;
  42. _forum = null;
  43. _friends = new FastList<Integer>();
  44. _selectedFriends = new FastList<Integer>();
  45. }
  46. public int getObjId()
  47. {
  48. return _objId;
  49. }
  50. public void setName(String val)
  51. {
  52. _name = val;
  53. }
  54. public String getName()
  55. {
  56. return _name;
  57. }
  58. public String getAccountName()
  59. {
  60. return _accountName;
  61. }
  62. // do not use this from here!!!
  63. public Forum getForum()
  64. {
  65. return _forum;
  66. }
  67. public void setLevel(int val)
  68. {
  69. _level = val;
  70. }
  71. public int getLevel()
  72. {
  73. return _level;
  74. }
  75. public void setAccessLevel(int val)
  76. {
  77. _accessLevel = val;
  78. }
  79. public int getAccessLevel()
  80. {
  81. return _accessLevel;
  82. }
  83. public void setClanId(int val)
  84. {
  85. _clanId = val;
  86. }
  87. public int getClanId()
  88. {
  89. return _clanId;
  90. }
  91. public boolean isOnline()
  92. {
  93. return _isOnline;
  94. }
  95. public void setIsOnline(boolean val)
  96. {
  97. _isOnline = val;
  98. }
  99. public void setForum(Forum f)
  100. {
  101. _forum = f;
  102. }
  103. public void addFriend(Integer friendId)
  104. {
  105. _friends.add(friendId);
  106. }
  107. public void removeFriend(Integer friendId)
  108. {
  109. _friends.remove(friendId);
  110. }
  111. public void removeAllFriends()
  112. {
  113. _friends.clear();
  114. }
  115. public FastList<Integer> getFriendList()
  116. {
  117. return _friends;
  118. }
  119. public void selectFriend(Integer friendId)
  120. {
  121. _selectedFriends.add(friendId);
  122. }
  123. public void deSelectFriend(Integer friendId)
  124. {
  125. _selectedFriends.remove(friendId);
  126. }
  127. public FastList<Integer> getSelectedFriendsList()
  128. {
  129. return _selectedFriends;
  130. }
  131. }