12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package pathgame.algorithm;
- import java.util.ArrayList;
- /** Class that stores data on paths to nodes that are not adjacent to each other
- *
- */
- public class ExtraPath {
- private int pathWeight;
- private int destX, destY;
- private ArrayList<Coord> pathCoords;
- /** Creates an ExtraPath with the given parameters
- *
- * @param destX x position of the other end of the path
- * @param destY y position of the other end of the path
- * @param pathWeight total weight of the path
- * @param pathCoords list of all coordinates that make up the path, in order
- */
- public ExtraPath(int destX, int destY, int pathWeight, ArrayList<Coord> pathCoords) {
- this.destX = destX;
- this.destY = destY;
- this.pathWeight = pathWeight;
- this.pathCoords = pathCoords;
- }
- /** Returns x position of path destination
- *
- * @return x position of path destination
- */
- public int getDestX() {
- return destX;
- }
- /** Returns y position of path destination
- *
- * @return y position of path destination
- */
- public int getDestY() {
- return destY;
- }
- /** Returns total weight of the path
- *
- * @return total weight of the path
- */
- public int getPathWeight() {
- return pathWeight;
- }
- /** Returns a list of the coordinates that make up the path
- *
- * @return coordinates of path
- */
- public ArrayList<Coord> getPathCoords() {
- return pathCoords;
- }
- }
|