Update von dem ganzen Projekt auf 1.1
This commit is contained in:
parent
f9c67cb2e0
commit
5574ea06ea
4 changed files with 25 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package game.map;
|
||||
|
||||
import base.GraphAlgorithm;
|
||||
import base.Node;
|
||||
import base.Edge;
|
||||
import base.Graph;
|
||||
import game.Player;
|
||||
|
|
@ -52,6 +53,12 @@ public class PathFinding extends GraphAlgorithm<Castle> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isPassable(Node<Castle> node) {
|
||||
return node.getValue().getOwner() == currentPlayer;
|
||||
}
|
||||
|
||||
public List<Edge<Castle>> getPath(Castle targetCastle) {
|
||||
return this.getPath(getGraph().getNode(targetCastle));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue