SaleRoute.java 929 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package pathgame.algorithm;
  2. import java.util.ArrayList;
  3. /** Class for storing one value of the Dijkstra results table
  4. *
  5. */
  6. public class SaleRoute {
  7. private ArrayList<Coord> path;
  8. private int totalCost;
  9. /** Creates a new SaleRoute with the given parameters
  10. *
  11. * @param path the list of coordinates making up this path
  12. * @param totalCost the total cost of this path
  13. */
  14. SaleRoute(ArrayList<Coord> path, int totalCost) {
  15. this.path = path;
  16. this.totalCost = totalCost;
  17. }
  18. /** Returns a list of coordinates making up this path
  19. *
  20. * @return a list of coordinates making up this path
  21. */
  22. public ArrayList<Coord> getPath() {
  23. return path;
  24. }
  25. /** Returns the total cost of this path
  26. *
  27. * @return the total cost of this path
  28. */
  29. public int getTotalCost() {
  30. return totalCost;
  31. }
  32. }