2
0

ActionKey.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (C) 2004-2013 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.model;
  20. /**
  21. * Action Key DTO.
  22. * @author mrTJO, Zoey76
  23. */
  24. public class ActionKey
  25. {
  26. private final int _cat;
  27. private int _cmd = 0;
  28. private int _key = 0;
  29. private int _tgKey1 = 0;
  30. private int _tgKey2 = 0;
  31. private int _show = 1;
  32. /**
  33. * @param cat category Id
  34. */
  35. public ActionKey(int cat)
  36. {
  37. _cat = cat;
  38. }
  39. /**
  40. * L2ActionKey Initialization
  41. * @param cat Category ID
  42. * @param cmd Command ID
  43. * @param key User Defined Primary Key
  44. * @param tgKey1 1st Toggled Key (eg. Alt, Ctrl or Shift)
  45. * @param tgKey2 2nd Toggled Key (eg. Alt, Ctrl or Shift)
  46. * @param show Show Action in UI
  47. */
  48. public ActionKey(int cat, int cmd, int key, int tgKey1, int tgKey2, int show)
  49. {
  50. _cat = cat;
  51. _cmd = cmd;
  52. _key = key;
  53. _tgKey1 = tgKey1;
  54. _tgKey2 = tgKey2;
  55. _show = show;
  56. }
  57. public int getCategory()
  58. {
  59. return _cat;
  60. }
  61. public int getCommandId()
  62. {
  63. return _cmd;
  64. }
  65. public void setCommandId(int cmd)
  66. {
  67. _cmd = cmd;
  68. }
  69. public int getKeyId()
  70. {
  71. return _key;
  72. }
  73. public void setKeyId(int key)
  74. {
  75. _key = key;
  76. }
  77. public int getToogleKey1()
  78. {
  79. return _tgKey1;
  80. }
  81. public void setToogleKey1(int tKey1)
  82. {
  83. _tgKey1 = tKey1;
  84. }
  85. public int getToogleKey2()
  86. {
  87. return _tgKey2;
  88. }
  89. public void setToogleKey2(int tKey2)
  90. {
  91. _tgKey2 = tKey2;
  92. }
  93. public int getShowStatus()
  94. {
  95. return _show;
  96. }
  97. public void setShowStatus(int show)
  98. {
  99. _show = show;
  100. }
  101. public String getSqlSaveString(int playerId, int order)
  102. {
  103. return "(" + playerId + ", " + _cat + ", " + order + ", " + _cmd + "," + _key + ", " + _tgKey1 + ", " + _tgKey2 + ", " + _show + ")";
  104. }
  105. }