public override void FloodFill (Stack<GraphNode> stack, uint region) {
int index = NodeInGridIndex;
LayerGridGraph graph = GetGridGraph (GraphIndex);
int[] neighbourOffsets = graph.neighbourOffsets;
LevelGridNode[] nodes = graph.nodes;
for (int i=0;i<4;i++) {
int conn = GetConnectionValue(i);//(gridConnections >> i*4) & 0xF;
if (conn != LevelGridNode.NoConnection) {
LevelGridNode other = nodes[index+neighbourOffsets[i] + graph.width*graph.depth*conn];
if (other != null && other.Area != region) {
other.Area = region;
stack.Push (other);
}
}
}
}