Pathfinding.LevelGridNode.FloodFill C# (CSharp) Method

FloodFill() public method

public FloodFill ( Stack stack, uint region ) : void
stack Stack
region uint
return void
		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);
					}
				}
			}
		}