public static IEnumerable <IntVector3> IteratorXZWithNeighborsAtY(IntBounds3 bounds, int y) { foreach (var pos in bounds.IteratorXZ) { var p = pos.ToIntVector3XZWithY(y); yield return(p); foreach (var relEscape in CubeNeighbors6.EscapeFacesXZ(bounds.RelativeOrigin(p), bounds.size)) { yield return(p + relEscape); } } }
public static IEnumerable <IntVector3> IteratorXZYWithNeighbors(IntBounds3 bounds) { foreach (var pos in bounds.IteratorXZYTopDown) { yield return(pos); foreach (var nei in CubeNeighbors6.NeighborsOf(pos)) { if (!bounds.Contains(nei)) { yield return(nei); } } } }
public void Set(NeighborDirection nd, T item) { this[center + CubeNeighbors6.Relative(nd)] = item; }
public T Get(NeighborDirection nd) { return(this[center + CubeNeighbors6.Relative(nd)]); }