Prioritize powered networks, fixes a glitch with tunnels connecting.

This commit is contained in:
AlgorithmX2
2014-06-08 11:26:33 -05:00
parent 009417ca4f
commit fbe4eebe17
3 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -62,7 +62,7 @@ public class GridConnection implements IGridConnection, IPathItem
GridPropagator gp = new GridPropagator( a.getInternalGrid() );
b.beginVisition( gp );
}
else if ( a.myGrid.size() > b.myGrid.size() )
else if ( isNetworkABetter( a, b ) )
{
GridPropagator gp = new GridPropagator( a.getInternalGrid() );
b.beginVisition( gp );
@@ -82,6 +82,11 @@ public class GridConnection implements IGridConnection, IPathItem
sideB.addConnection( this );
}
private boolean isNetworkABetter(GridNode a, GridNode b)
{
return ((Grid) a.myGrid).isImportant > ((Grid) b.myGrid).isImportant || a.myGrid.size() > b.myGrid.size();
}
@Override
public void destroy()
{