Modifier and Type | Field and Description |
---|---|
static int[][] |
EVEN_COLUMN_NEIGHBOR_OFFSETS |
protected boolean |
mEvenColumn |
static int[][] |
ODD_COLUMN_NEIGHBOR_OFFSETS |
CELL_MAX_NEIGHBORS, mCellRadius, SQRT_3, TAG
mBounds, mData, mScratchList, mSize, mUseCellCenter
Constructor and Description |
---|
VerticalHexGrid(int width,
int height,
boolean evenColumn) |
Modifier and Type | Method and Description |
---|---|
void |
cellToPoint(int cellX,
int cellY,
PointF point) |
void |
cellToPoint(Point cell,
PointF point) |
int |
getCellsDistance(int x1,
int y1,
int x2,
int y2) |
int[][] |
getNeighborOffets() |
int |
getNeighborsAt(Point cell,
Point[] neighbors)
Get neighbors of a cell and fetch them into a pre-created array of Points
|
int |
getNeighborsAt(Point cell,
Point[] neighbors,
boolean emptyFlag)
Get empty only (or not empty only) neighbors of a cell and fetch them into a pre-created array of Points
|
void |
pointToCell(float px,
float py,
Point cell) |
void |
pointToCell(PointF point,
Point cell) |
protected void |
updateBounds() |
getCellSize, setCellSize
cellToPointPath, cellToPointPath, dispose, getBounds, getDataAt, getSize, setDataAt, setSize
public static final int[][] EVEN_COLUMN_NEIGHBOR_OFFSETS
public static final int[][] ODD_COLUMN_NEIGHBOR_OFFSETS
protected boolean mEvenColumn
public VerticalHexGrid(int width, int height, boolean evenColumn)
public void pointToCell(float px, float py, Point cell)
public void pointToCell(PointF point, Point cell)
public void cellToPoint(int cellX, int cellY, PointF point)
public void cellToPoint(Point cell, PointF point)
protected void updateBounds()
updateBounds
in class AbstractGrid<T>
public int[][] getNeighborOffets()
public int getNeighborsAt(Point cell, Point[] neighbors)
cell
- neighbors
- public int getNeighborsAt(Point cell, Point[] neighbors, boolean emptyFlag)
cell
- neighbors
- public int getCellsDistance(int x1, int y1, int x2, int y2)