CellNode.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2004-2015 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.pathfinding.cellnodes;
  20. import com.l2jserver.gameserver.pathfinding.AbstractNode;
  21. public class CellNode extends AbstractNode<NodeLoc>
  22. {
  23. private CellNode _next = null;
  24. private boolean _isInUse = true;
  25. private float _cost = -1000;
  26. public CellNode(NodeLoc loc)
  27. {
  28. super(loc);
  29. }
  30. public boolean isInUse()
  31. {
  32. return _isInUse;
  33. }
  34. public void setInUse()
  35. {
  36. _isInUse = true;
  37. }
  38. public CellNode getNext()
  39. {
  40. return _next;
  41. }
  42. public void setNext(CellNode next)
  43. {
  44. _next = next;
  45. }
  46. public float getCost()
  47. {
  48. return _cost;
  49. }
  50. public void setCost(double cost)
  51. {
  52. _cost = (float) cost;
  53. }
  54. public void free()
  55. {
  56. setParent(null);
  57. _cost = -1000;
  58. _isInUse = false;
  59. _next = null;
  60. }
  61. }