ExtraPath.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package pathgame.algorithm;
  2. import java.util.ArrayList;
  3. /** Class that stores data on paths to nodes that are not adjacent to each other
  4. *
  5. */
  6. public class ExtraPath {
  7. private int pathWeight;
  8. private int destX, destY;
  9. private ArrayList<Coord> pathCoords;
  10. /** Creates an ExtraPath with the given parameters
  11. *
  12. * @param destX x position of the other end of the path
  13. * @param destY y position of the other end of the path
  14. * @param pathWeight total weight of the path
  15. * @param pathCoords list of all coordinates that make up the path, in order
  16. */
  17. public ExtraPath(int destX, int destY, int pathWeight, ArrayList<Coord> pathCoords) {
  18. this.destX = destX;
  19. this.destY = destY;
  20. this.pathWeight = pathWeight;
  21. this.pathCoords = pathCoords;
  22. }
  23. /** Returns x position of path destination
  24. *
  25. * @return x position of path destination
  26. */
  27. public int getDestX() {
  28. return destX;
  29. }
  30. /** Returns y position of path destination
  31. *
  32. * @return y position of path destination
  33. */
  34. public int getDestY() {
  35. return destY;
  36. }
  37. /** Returns total weight of the path
  38. *
  39. * @return total weight of the path
  40. */
  41. public int getPathWeight() {
  42. return pathWeight;
  43. }
  44. /** Returns a list of the coordinates that make up the path
  45. *
  46. * @return coordinates of path
  47. */
  48. public ArrayList<Coord> getPathCoords() {
  49. return pathCoords;
  50. }
  51. }