Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Helpers.Coords.VectorIterators Class Reference

A class of helpers that iterate through vector-space More...

Static Public Member Functions

static IEnumerable< Vector3iIterateCubeFaces (int x, int y, int z)
 Iterate accross the 6 faces of a cube More...
 
static IEnumerable< Vector3iIterateSpace (int w, int l, int h)
 Iterates the space. More...
 
static IEnumerable< Vector3iIterateSpace (int x, int y, int z, int w, int l, int h)
 Iterates across space w,l,h starting at x,y,z More...
 
static IEnumerable< Vector3iInnerIterateSpace (int x, int y, int z, int wl, int h)
 Enumerates through a cubic area starting at the center More...
 

Detailed Description

A class of helpers that iterate through vector-space

Member Function Documentation

static IEnumerable<Vector3i> pluginbase.Helpers.Coords.VectorIterators.InnerIterateSpace ( int  x,
int  y,
int  z,
int  wl,
int  h 
)
static

Enumerates through a cubic area starting at the center

Returns
The iterate space.
Parameters
xX.
yY.
zZ.
wlWl.
hH.
110  {
111  for (int cZ=-h; cZ <= h; ++cZ)
112  yield return new Vector3i(x,y,z+cZ);
113  for (int sz=1; sz <= wl; ++sz )
114  {
115  for (int cX=-sz; cX<=sz; ++cX)
116  {
117  for (int cY=-sz; cY<=sz; ++cY)
118  {
119 
120  if (System.Math.Abs(cX) == sz || System.Math.Abs(cY) == sz )
121  {
122  for (int cZ=-h; cZ <= h; ++cZ)
123  {
124  yield return new Vector3i(x+cX, y+cY, z+cZ);
125  }
126  }
127 
128  }
129  }
130  }
131  }
static readonly Vector3i
All directions, including diagnols
Definition: Vector3i.cs:111
static IEnumerable<Vector3i> pluginbase.Helpers.Coords.VectorIterators.IterateCubeFaces ( int  x,
int  y,
int  z 
)
static

Iterate accross the 6 faces of a cube

Returns
The cube faces.
Parameters
xX.
yY.
zZ.
27  {
28  yield return new Vector3i(x-1,y,z);
29  yield return new Vector3i(x+1,y,z);
30  yield return new Vector3i(x,y-1,z);
31  yield return new Vector3i(x,y+1,z);
32  yield return new Vector3i(x,y,z-1);
33  yield return new Vector3i(x,y,z+1);
34  }
static readonly Vector3i
All directions, including diagnols
Definition: Vector3i.cs:111
static IEnumerable<Vector3i> pluginbase.Helpers.Coords.VectorIterators.IterateSpace ( int  w,
int  l,
int  h 
)
static

Iterates the space.

Returns
The space.
Parameters
wW.
lL.
hH.
52  {
53  return IterateSpace(0,0,0,w,l,h);
54  }
static IEnumerable< Vector3i > IterateSpace(int w, int l, int h)
Iterates the space.
Definition: VectorIterators.cs:51
static IEnumerable<Vector3i> pluginbase.Helpers.Coords.VectorIterators.IterateSpace ( int  x,
int  y,
int  z,
int  w,
int  l,
int  h 
)
static

Iterates across space w,l,h starting at x,y,z

Returns
The space.
Parameters
xX.
yY.
zZ.
wW.
lL.
hH.
81  {
82  for (int i=x; i<x+w; ++i)
83  for (int j=y; j<y+l; ++j)
84  for (int k=z; k<z+h; ++k)
85  yield return new Vector3i(i,j,k);
86  }
static readonly Vector3i
All directions, including diagnols
Definition: Vector3i.cs:111

The documentation for this class was generated from the following file: