Example #1
0
        public GridCoord2D(GridSize2D size, int index)
        {
            Index = index;

            int x = (index % size.X);

            index /= size.X;
            int y = index;

            Point = new GridPoint2D(x, y);
        }
Example #2
0
        public GridCoord2D Set(GridSize2D size, EGridAxis2D axis, int value)
        {
            switch (axis)
            {
            case EGridAxis2D.X:
                return(new GridCoord2D(size, value, Point.Y));

            case EGridAxis2D.Y:
                return(new GridCoord2D(size, Point.X, value));

            default:
                throw new NotImplementedException();
            }
        }
Example #3
0
 public GridBounds2D(GridSize2D size)
 {
     Min = new GridPoint2D(0, 0);
     Max = new GridPoint2D(size.X, size.Y);
 }
Example #4
0
 public GridIterator2D(GridSize2D size)
 {
     X = 1;
     Y = size.X;
 }
Example #5
0
        public static GridCoord2D Create(GridSize2D size, GridAxes2D axes, int a, int b)
        {
            GridPoint2D point = GridPoint2D.Create(axes, a, b);

            return(new GridCoord2D(size, point));
        }
Example #6
0
 public GridCoord2D(GridSize2D size, GridPoint2D point)
 {
     Point = point;
     Index = (point.Y * size.X) + point.X;
 }
Example #7
0
 public GridCoord2D(GridSize2D size, int x, int y)
     : this(size, new GridPoint2D(x, y))
 {
 }