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
+7
View File
@@ -28,6 +28,7 @@ public class Grid implements IGrid
HashMap<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<Class<? extends IGridCache>, GridCacheWrapper>();
GridNode pivot;
int isImportant; // how import is this network?
public Grid(GridNode center) {
this.pivot = center;
@@ -228,4 +229,10 @@ public class Grid implements IGrid
}
}
public void setImportantFlag(int i, boolean publicHasPower)
{
int flag = 1 << i;
isImportant = (isImportant & ~flag) | (publicHasPower ? flag : 0);
}
}