Location.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 com.l2jserver.gameserver.model.actor.L2Character;
  17. /**
  18. * This class ...
  19. *
  20. * @version $Revision: 1.1.4.1 $ $Date: 2005/03/27 15:29:33 $
  21. */
  22. public final class Location
  23. {
  24. private final int _x;
  25. private final int _y;
  26. private final int _z;
  27. private int _heading;
  28. private int _instanceId;
  29. public Location(int x, int y, int z)
  30. {
  31. _x = x;
  32. _y = y;
  33. _z = z;
  34. }
  35. public Location(L2Object obj)
  36. {
  37. _x = obj.getX();
  38. _y = obj.getY();
  39. _z = obj.getZ();
  40. _instanceId = obj.getInstanceId();
  41. }
  42. public Location(L2Character obj)
  43. {
  44. _x = obj.getX();
  45. _y = obj.getY();
  46. _z = obj.getZ();
  47. _heading = obj.getHeading();
  48. _instanceId = obj.getInstanceId();
  49. }
  50. public Location(int x, int y, int z, int heading)
  51. {
  52. _x = x;
  53. _y = y;
  54. _z = z;
  55. _heading = heading;
  56. }
  57. public Location(int x, int y, int z, int heading, int instanceId)
  58. {
  59. _x = x;
  60. _y = y;
  61. _z = z;
  62. _heading = heading;
  63. _instanceId = instanceId;
  64. }
  65. public int getX()
  66. {
  67. return _x;
  68. }
  69. public int getY()
  70. {
  71. return _y;
  72. }
  73. public int getZ()
  74. {
  75. return _z;
  76. }
  77. public int getHeading()
  78. {
  79. return _heading;
  80. }
  81. public int getInstanceId()
  82. {
  83. return _instanceId;
  84. }
  85. }