NodeLoc.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 net.sf.l2j.gameserver.pathfinding.cellnodes;
  16. import net.sf.l2j.gameserver.model.L2World;
  17. import net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc;
  18. /**
  19. *
  20. * @author -Nemesiss-
  21. */
  22. public class NodeLoc extends AbstractNodeLoc
  23. {
  24. private final int _x;
  25. private final int _y;
  26. private short _z;
  27. public NodeLoc(int x, int y, short z)
  28. {
  29. _x = x;
  30. _y = y;
  31. _z = z;
  32. }
  33. /**
  34. * @see net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc#getX()
  35. */
  36. @Override
  37. public int getX()
  38. {
  39. return (_x << 4) + L2World.MAP_MIN_X;
  40. }
  41. /**
  42. * @see net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc#getY()
  43. */
  44. @Override
  45. public int getY()
  46. {
  47. return (_y << 4) + L2World.MAP_MIN_Y;
  48. }
  49. /**
  50. * @see net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc#getZ()
  51. */
  52. @Override
  53. public short getZ()
  54. {
  55. return _z;
  56. }
  57. @Override
  58. public void setZ(short z)
  59. {
  60. _z = z;
  61. }
  62. /**
  63. * @see net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc#getNodeX()
  64. */
  65. @Override
  66. public int getNodeX()
  67. {
  68. // TODO Auto-generated method stub
  69. return _x;
  70. }
  71. /**
  72. * @see net.sf.l2j.gameserver.pathfinding.AbstractNodeLoc#getNodeY()
  73. */
  74. @Override
  75. public int getNodeY()
  76. {
  77. // TODO Auto-generated method stub
  78. return _y;
  79. }
  80. }