private void AssertIndexCalculation(GridSize3D gridSize, int x, int y, int z) { GridCoord3D coord = new GridCoord3D(gridSize, x, y, z); GridCoord3D index = new GridCoord3D(gridSize, coord.Index); AssertPoint(coord.Point, index.Point.X, index.Point.Y, index.Point.Z); }
public TCell Get(GridCoord3D coord) { if (Cells.Length <= coord.Index) { throw new System.Exception(); } return(Cells[coord.Index]); }
public void Set(TCell cell, GridCoord3D coord) { if (Cells.Length <= coord.Index) { throw new System.Exception(); } Cells[coord.Index] = cell; }
public GridAxisIterator3D(EGridAxis3D axis, GridCoord3D startCoord, GridSize3D gridSize) { Axis = axis; StartIndex = startCoord.Index; GridIterator3D iterator = new GridIterator3D(gridSize); Step = iterator.Get(axis); }
public void GridTraversal() { GridSize3D size = new GridSize3D(5, 6, 7); GridCoord3D coord = new GridCoord3D(size, 3, 3, 3); GridIterator3D traversal = new GridIterator3D(size); GridCoord3D changed = new GridCoord3D(size, coord.Index + traversal.Y); AssertPoint(changed.Point, 3, 4, 3); changed = new GridCoord3D(size, coord.Index - traversal.Y); AssertPoint(changed.Point, 3, 2, 3); changed = new GridCoord3D(size, coord.Index + traversal.X); AssertPoint(changed.Point, 4, 3, 3); changed = new GridCoord3D(size, coord.Index - traversal.X); AssertPoint(changed.Point, 2, 3, 3); changed = new GridCoord3D(size, coord.Index + traversal.Z); AssertPoint(changed.Point, 3, 3, 4); changed = new GridCoord3D(size, coord.Index - traversal.Z); AssertPoint(changed.Point, 3, 3, 2); }
public void Set(TCell cell, GridPoint3D point) { GridCoord3D coord = new GridCoord3D(Size, point.X, point.Y, point.Z); Set(cell, coord); }
public void Set(TCell cell, int x, int y, int z) { GridCoord3D coord = new GridCoord3D(Size, x, y, z); Set(cell, coord); }
public TCell Get(GridPoint3D point) { GridCoord3D coord = new GridCoord3D(Size, point); return(Get(coord)); }
public TCell Get(int x, int y, int z) { GridCoord3D coord = new GridCoord3D(Size, x, y, z); return(Get(coord)); }