package pathgame.algorithm; import pathgame.tilemap.TileType; import java.util.ArrayList; public class Node2D { private final int weight; private int costSoFar = Integer.MAX_VALUE; private char prevOfPath = '\0'; private int prevBoatPath = -1; private TileType type = TileType.LAND; private boolean isQAdded = false; private boolean hasExtraPaths = false; private boolean isBlocked = false; private boolean isTown = false; private final ArrayList extraPaths = new ArrayList<>(); public Node2D(int weight) { this.weight = weight; } public int getWeight() { return weight; } public int getCostSoFar() { return costSoFar; } public void setCostSoFar(int costSoFar) { this.costSoFar = costSoFar; } public char getPrevOfPath() { return prevOfPath; } public void setPrevOfPath(char prevOfPath) { this.prevOfPath = prevOfPath; } public ArrayList getExtraPaths() { return extraPaths; } public void addExtraPath(Coord dest, int pathWeight, ArrayList pathCoords) { hasExtraPaths = true; extraPaths.add(new ExtraPath(dest.getX(), dest.getY(), pathWeight, pathCoords)); } public boolean hasExtraPaths() { return hasExtraPaths; } public boolean isQAdded() { return isQAdded; } public void setQAdded(boolean QAdded) { isQAdded = QAdded; } public boolean isBlocked() { return isBlocked; } public void setBlocked(boolean blocked) { isBlocked = blocked; } public TileType getType() { return type; } public void setType(TileType type) { this.type = type; } public int getPrevBoatPath() { return prevBoatPath; } public void setPrevBoatPath(int prevBoatPath) { this.prevBoatPath = prevBoatPath; } public boolean isTown() { return isTown; } public void setTown(boolean town) { isTown = town; } }