Advertisement
Guest User

Untitled

a guest
May 26th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  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.actor.appearance;
  16.  
  17. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  18.  
  19. public class PcAppearance
  20. {
  21. // =========================================================
  22. // Data Field
  23. private L2PcInstance _owner;
  24.  
  25. private byte _face;
  26.  
  27. private byte _hairColor;
  28.  
  29. private byte _hairStyle;
  30.  
  31. private boolean _sex; // Female true(1)
  32.  
  33. /** true if the player is invisible */
  34. private boolean _invisible = false;
  35. private boolean _ghostmode = false;
  36.  
  37. /** The current visible name of this player, not necessarily the real one */
  38. private String _visibleName;
  39.  
  40. /** The current visible title of this player, not necessarily the real one */
  41. private String _visibleTitle;
  42.  
  43. /** The hexadecimal Color of players name (white is 0xFFFFFF) */
  44. private int _nameColor = 0xFFFFFF;
  45.  
  46. /** The hexadecimal Color of players name (white is 0xFFFFFF) */
  47. private int _titleColor = 0xFFFF77;
  48.  
  49. // =========================================================
  50. // Constructor
  51. public PcAppearance(byte face, byte hColor, byte hStyle, boolean sex)
  52. {
  53. _face = face;
  54. _hairColor = hColor;
  55. _hairStyle = hStyle;
  56. _sex = sex;
  57. }
  58.  
  59. // =========================================================
  60. // Method - Public
  61.  
  62. // =========================================================
  63. // Method - Private
  64.  
  65. /**
  66. * @param visibleName The visibleName to set.
  67. */
  68. public final void setVisibleName(String visibleName)
  69. {
  70. _visibleName = visibleName;
  71. }
  72.  
  73. /**
  74. * @return Returns the visibleName.
  75. */
  76. public final String getVisibleName()
  77. {
  78. if (_visibleName == null)
  79. {
  80. _visibleName = getOwner().getName();
  81. }
  82. return _visibleName;
  83. }
  84.  
  85. /**
  86. * @param visibleTitle The visibleTitle to set.
  87. */
  88. public final void setVisibleTitle(String visibleTitle)
  89. {
  90. _visibleTitle = visibleTitle;
  91. }
  92.  
  93. /**
  94. * @return Returns the visibleTitle.
  95. */
  96. public final String getVisibleTitle()
  97. {
  98. if (_visibleTitle == null)
  99. {
  100. _visibleTitle = getOwner().getTitle();
  101. }
  102. return _visibleTitle;
  103. }
  104.  
  105. // =========================================================
  106. // Property - Public
  107. public final byte getFace()
  108. {
  109. return _face;
  110. }
  111.  
  112. /**
  113. * @param byte value
  114. */
  115. public final void setFace(int value)
  116. {
  117. _face = (byte) value;
  118. }
  119.  
  120. public final byte getHairColor()
  121. {
  122. return _hairColor;
  123. }
  124.  
  125. /**
  126. * @param byte value
  127. */
  128. public final void setHairColor(int value)
  129. {
  130. _hairColor = (byte) value;
  131. }
  132.  
  133. public final byte getHairStyle()
  134. {
  135. return _hairStyle;
  136. }
  137.  
  138. /**
  139. * @param byte value
  140. */
  141. public final void setHairStyle(int value)
  142. {
  143. _hairStyle = (byte) value;
  144. }
  145.  
  146. /**
  147. * @return true if char is female
  148. */
  149. public final boolean getSex()
  150. {
  151. return _sex;
  152. }
  153.  
  154. /**
  155. * @param boolean isfemale
  156. */
  157. public final void setSex(boolean isfemale)
  158. {
  159. _sex = isfemale;
  160. }
  161.  
  162. public void setInvisible()
  163. {
  164. _invisible = true;
  165. }
  166.  
  167. public void setVisible()
  168. {
  169. _invisible = false;
  170. }
  171.  
  172. public boolean getInvisible()
  173. {
  174. return _invisible;
  175. }
  176.  
  177. public void setGhostMode(boolean b)
  178. {
  179. _ghostmode = b;
  180. }
  181.  
  182. public boolean isGhost()
  183. {
  184. return _ghostmode;
  185. }
  186.  
  187. public int getNameColor()
  188. {
  189. return _nameColor;
  190. }
  191.  
  192. public void setNameColor(int nameColor)
  193. {
  194. if (nameColor < 0)
  195. {
  196. return;
  197. }
  198.  
  199. _nameColor = nameColor;
  200. }
  201.  
  202. public void setNameColor(int red, int green, int blue)
  203. {
  204. _nameColor = (red & 0xFF) + ((green & 0xFF) << 8) + ((blue & 0xFF) << 16);
  205. }
  206.  
  207. public int getTitleColor()
  208. {
  209. return _titleColor;
  210. }
  211.  
  212. public void setTitleColor(int titleColor)
  213. {
  214. if (titleColor < 0)
  215. {
  216. return;
  217. }
  218.  
  219. _titleColor = titleColor;
  220. }
  221.  
  222. public void setTitleColor(int red, int green, int blue)
  223. {
  224. _titleColor = (red & 0xFF) + ((green & 0xFF) << 8) + ((blue & 0xFF) << 16);
  225. }
  226.  
  227. /**
  228. * @param owner The owner to set.
  229. */
  230. public void setOwner(L2PcInstance owner)
  231. {
  232. _owner = owner;
  233. }
  234.  
  235. /**
  236. * @return Returns the owner.
  237. */
  238. public L2PcInstance getOwner()
  239. {
  240. return _owner;
  241. }
  242. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement