Skip to content
Snippets Groups Projects
Commit 95fd2410 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #4

parent afadfdf4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -80,51 +80,39 @@ public class Board
//North
if(!containsTileAtPosition(x, y-1))
{
if(!tile.getN().equals(EdgeType.GRASS))
{
if(isCrossCheckValid(playerTile, x, y-1))
{
freeEdges.add(new Point2D(x, y-1));
}
}
}
//East
if(!containsTileAtPosition(x+1, y))
{
if(!tile.getE().equals(EdgeType.GRASS))
{
if(isCrossCheckValid(playerTile, x+1, y))
{
freeEdges.add(new Point2D(x+1, y));
}
}
}
//South
if(!containsTileAtPosition(x, y+1))
{
if(!tile.getS().equals(EdgeType.GRASS))
{
if(isCrossCheckValid(playerTile, x, y+1))
{
freeEdges.add(new Point2D(x, y+1));
}
}
}
//West
if(!containsTileAtPosition(x-1, y))
{
if(!tile.getW().equals(EdgeType.GRASS))
{
if(isCrossCheckValid(playerTile, x-1, y))
{
freeEdges.add(new Point2D(x-1, y));
}
}
}
return freeEdges;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment