Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        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);
                    }
                }
            }
        }
Esempio n. 3
0
 public void Set(NeighborDirection nd, T item)
 {
     this[center + CubeNeighbors6.Relative(nd)] = item;
 }
Esempio n. 4
0
 public T Get(NeighborDirection nd)
 {
     return(this[center + CubeNeighbors6.Relative(nd)]);
 }