|
@@ -3,11 +3,13 @@ package pathgame.algorithm;
|
|
|
|
|
|
import pathgame.gameplay.PlayerAbilities;
|
|
|
import pathgame.tilemap.TileMap;
|
|
|
+import pathgame.tilemap.Tiles;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
public class DijkstraMagic {
|
|
|
- private int townID = 18;
|
|
|
+ private int townID = Tiles.TOWN.getId();
|
|
|
+ private int startID = Tiles.HOME_TOWN.getId();
|
|
|
private ArrayList<Coord> towns = new ArrayList<>();
|
|
|
private TileMap map;
|
|
|
private Node2D[][] weightMap;
|
|
@@ -330,7 +332,7 @@ public class DijkstraMagic {
|
|
|
|
|
|
|
|
|
|
|
|
- if(map.getTile(x, y).getId() == townID) {
|
|
|
+ if(map.getTile(x, y).getId() == townID || map.getTile(x, y).getId() == startID) {
|
|
|
towns.add(new Coord(x, y));
|
|
|
}
|
|
|
|