package pathgame.algorithm;

import pathgame.tilemap.TileType;

import java.util.ArrayList;

public class Node2D {
    private 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 ArrayList<ExtraPath> extraPaths = new ArrayList<>();

    public Node2D(int weight) {
        this.weight = weight;
    }

    public int getWeight() {
        return weight;
    }

    public int getCostSoFar() {
        return costSoFar;
    }

    public char getPrevOfPath() {
        return prevOfPath;
    }

    public ArrayList<ExtraPath> getExtraPaths() {
        return extraPaths;
    }

    public boolean hasExtraPaths() {
        return hasExtraPaths;
    }

    public void setCostSoFar(int costSoFar) {
        this.costSoFar = costSoFar;
    }

    public void setPrevOfPath(char prevOfPath) {
        this.prevOfPath = prevOfPath;
    }

    public void addExtraPath(Coord dest, int pathWeight, ArrayList<Coord> pathCoords) {
        hasExtraPaths = true;
        extraPaths.add(new ExtraPath(dest.getX(), dest.getY(), pathWeight, pathCoords));
    }

    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;
    }
}
