/// <summary>Callback struct for <see cref="ForEachCellIn3DArray"/></summary>
publicinterfaceICellAction{
voidExecute(uintidx,intx,inty,intz);
}
/// <summary>
/// Iterates over a slice of a 3D array.
///
/// This is a helper for iterating over grid graph data, which is typically stored in an array of size width*layers*depth (x*y*z).
///
/// In burst-compiled code, this will be essentially as fast as writing the loop code yourself. In C#, it is marginally slower than writing the loop code yourself.
///
/// [Open online documentation to see images]
/// </summary>
/// <param name="slice">Bounds of the slice and the size of the outer array it is relative to.</param>
/// <param name="action">Your callback struct. The Execute method on the callback struct will be called for each element in the slice. It will be passed both the index in the slice and the index in the outer array.</param>
/// This is a helper for iterating over grid graph data, which is typically stored in an array of size width*layers*depth (x*y*z).
///
/// In burst-compiled code, this will be essentially as fast as writing the loop code yourself. In C#, it is marginally slower than writing the loop code yourself.
///
/// [Open online documentation to see images]
/// </summary>
/// <param name="slice">Bounds of the slice and the size of the outer array it is relative to.</param>
/// <param name="action">Your callback struct. The Execute method on the callback struct will be called for each element in the slice. It will be passed both the index in the slice and the index in the outer array.</param>
/// This is a helper for iterating over grid graph data, which is typically stored in an array of size width*layers*depth (x*y*z).
///
/// In burst-compiled code, this will be essentially as fast as writing the loop code yourself. In C#, it is marginally slower than writing the loop code yourself.
/// </summary>
/// <param name="size">Size of the array.</param>
/// <param name="action">Your callback struct. The Execute method on the callback struct will be called for each element in the array. It will be passed the x, y and z coordinates of the element as well as the index in the array.</param>
/// This is used by the <see cref="GridIterationUtilities.ForEachNode"/> function.
/// </summary>
publicinterfaceINodeModifier{
/// <summary>
/// Called for every node that is being updated.
///
/// See: gridgraphrule-burst (view in online documentation for working links) for example usage.
/// </summary>
/// <param name="dataIndex">Index of the node. This is the index in the data arrays for the graph update, not necessarily the index in the graph.</param>
/// <param name="dataX">X coordinate of the node, relative to the updated region.</param>
/// <param name="dataLayer">Layer (Y) coordinate of the node, relative to the updated region.</param>
/// <param name="dataZ">Z coordinate of the node, relative to the updated region.</param>
/// <param name="dataIndex">Index of the node for which the connection is being tested. This is the index in the data arrays for the graph update, not necessarily the index in the graph.</param>
/// <param name="dataX">X coordinate of the node for which the connection is being tested, relative to the updated region.</param>
/// <param name="dataLayer">Layer (Y) coordinate of the node for which the connection is being tested, relative to the updated region.</param>
/// <param name="dataZ">Z coordinate of the node for which the connection is being tested, relative to the updated region.</param>
/// <param name="direction">Direction to the neighbour. See \reflink{GridNode.HasConnectionInDirection}.</param>
/// <param name="neighbourDataIndex">Index of the neighbour node. This is the index in the data arrays for the graph update, not necessarily the index in the graph.</param>
/// Iterate through all enabled connections of all nodes.
///
/// See: grid-rules-write (view in online documentation for working links) for example usage.
/// </summary>
/// <param name="bounds">Sub-rectangle of the grid graph that is being updated/scanned</param>
/// <param name="nodeConnections">Data with all node connections.</param>
/// <param name="layeredDataLayout">Should be true for layered grid graphs and false otherwise.</param>
/// <param name="filter">Your callback struct. The IsValidConnection method on the callback struct will be called for each connection. If false is returned, the connection will be disabled.</param>
// For valid nodeConnections arrays this is not necessary as out of bounds connections are not valid and it will thus be caught above in the 'has connection' check.
// But let's be safe in case users do something weird
if(nx<0||nz<0||nx>=bounds.size.x||nz>=bounds.size.z)thrownewSystem.Exception("Node has an invalid connection to a node outside the bounds of the graph");
if(nx<0||nz<0||nx>=bounds.size.x||nz>=bounds.size.z)thrownewSystem.Exception("Node has an invalid connection to a node outside the bounds of the graph");