public class LongGrid2D extends AbstractGrid2D
height, width
Constructor and Description |
---|
LongGrid2D(int width,
int height)
Constructs new boolean grid.
|
LongGrid2D(long[][] values)
Constructs new boolean grid by copying values from given field.
|
LongGrid2D(LongGrid2D other)
Constructs new boolean grid by copying values from other boolean grid.
|
Modifier and Type | Method and Description |
---|---|
long |
get(int x,
int y)
Gets the value at given coordinate.
|
void |
set(int x,
int y,
long value)
Sets the value at given coordinate.
|
LongGrid2D |
setTo(long value)
Sets all the locations in the grid to the provided value.
|
LongGrid2D |
setTo(long[][] field)
Sets this grid to the values from the given array.
|
long[][] |
toField()
Converts this grid to a two-dimensional array.
|
String |
toString() |
buildMap, buildMap, checkBounds, dlx, dly, downx, downy, drx, dry, getHeight, getHexagonalLocations, getMooreLocations, getNeighborsHamiltonianDistance, getNeighborsHexagonalDistance, getNeighborsMaxDistance, getRadialLocations, getRadialLocations, getVonNeumannLocations, getWidth, removeOrigin, removeOriginToroidal, stx, sty, trb, trt, tx, ty, ulx, uly, upx, upy, urx, ury
public LongGrid2D(int width, int height)
width
- height
- public LongGrid2D(LongGrid2D other)
other
- public LongGrid2D(long[][] values)
values
- the values for this gridpublic long get(int x, int y)
x
- the x-coordinatey
- the y-coordinatepublic void set(int x, int y, long value)
x
- the x-coordinatey
- the y-coordinatevalue
- the value to be set at given coordinatepublic LongGrid2D setTo(long value)
value
- the value to setpublic LongGrid2D setTo(long[][] field)
field
- a two-dimensional arraypublic long[][] toField()