HGrid

trait HGrid extends TGrid with HGridBased

A grid of Hexs. The grid may be a regular rectangle of hexs or an irregular grid with variable length rows.

trait TGrid
class Any

Document{}

@inline
final def bottomSideRow: Int

The bottom, lowest or minimum Side Row of this TileGrid. The r value, the row number value.

The bottom, lowest or minimum Side Row of this TileGrid. The r value, the row number value.

Inherited from:
TGrid
@inline
final def numOfSideRows: Int

The number of Rows of Sides.

The number of Rows of Sides.

Inherited from:
TGrid
def numSides: Int

The number of Sides in the TileGrid. Needs reimplementing.

The number of Sides in the TileGrid. Needs reimplementing.

The Hex Sides of the Hex Grid defined in integer constructed LineSegHC..

The Hex Sides of the Hex Grid defined in integer constructed LineSegHC..

def sideRowForeach(f: Int => Unit): Unit

Foreachs over each Row of Sides. Users will not normally need to use this method directly.

Foreachs over each Row of Sides. Users will not normally need to use this method directly.

Inherited from:
TGrid
final def sidesDraw(colour: Colour, lineWidth: Double): LinesDraw

This gives the all tile grid lines in a single colour and line width.

This gives the all tile grid lines in a single colour and line width.

Inherited from:
TGrid
final def sidesFlatMap[ArrT <: SeqImut[_]](f: HSide => ArrT)(implicit build: ArrFlatBuilder[ArrT]): ArrT

maps over each Hex Side's coordinate HSide in the given Row.

maps over each Hex Side's coordinate HSide in the given Row.

final def sidesForeach(f: HSide => Unit): Unit

foreach Hex side's coordinate HSide, calls the effectfull function.

foreach Hex side's coordinate HSide, calls the effectfull function.

final def sidesMap[B, ArrT <: SeqImut[B]](f: HSide => B)(implicit build: ArrBuilder[B, ArrT]): ArrT

maps over each Hex Side's coordinate HSide in the given Row.

maps over each Hex Side's coordinate HSide in the given Row.

@inline
final def topSideRow: Int

The top, highest or maximum Side Row of this TileGrid. The r value, the row number.

The top, highest or maximum Side Row of this TileGrid. The r value, the row number.

Inherited from:
TGrid

Value members

Abstract methods

def arrIndex(r: Int, c: Int): Int

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

override def coordCen: HCoord
Definition Classes
def numRow0s: Int

The number of tile centre rows where r %% 4 == 0.

The number of tile centre rows where r %% 4 == 0.

def numRow2s: Int

The number of tile centre rows where r %% 4 == 2.

The number of tile centre rows where r %% 4 == 2.

def rowCenLeft(row: Int): Int

The start (or by default left column) of the tile centre of the given row.

The start (or by default left column) of the tile centre of the given row.

def rowCenRight(row: Int): Int

The end (or by default right) column number of the tile centre of the given row.

The end (or by default right) column number of the tile centre of the given row.

def rowForeach(r: Int)(f: HCen => Unit): Unit

Carries out the procedure function on each HCen hex tile centre coordinate in the given tile row. This method is defined here rather than on TileGrid so it can take the specific narrow HCen parameter to the foreach function.

Carries out the procedure function on each HCen hex tile centre coordinate in the given tile row. This method is defined here rather than on TileGrid so it can take the specific narrow HCen parameter to the foreach function.

def rowForeachSide(r: Int)(f: HSide => Unit): Unit

Calls the Foreach procedure on every Hex Side in the row given by the input parameter.

Calls the Foreach procedure on every Hex Side in the row given by the input parameter.

def rowIForeach(r: Int, count: Int)(f: (HCen, Int) => Unit): Int

Carries out the procedure function on each HCen hex tile centre coordinate and an index counter in the given tile row. This method is defined here rather than on TileGrid so it can take the specific narrow HCen parameter to the foreach function.

Carries out the procedure function on each HCen hex tile centre coordinate and an index counter in the given tile row. This method is defined here rather than on TileGrid so it can take the specific narrow HCen parameter to the foreach function.

def rowNumTiles(row: Int): Int

The number of tile centres in the given row.

The number of tile centres in the given row.

def sideArrIndex(r: Int, c: Int): Int

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

def sideRowIndexArray: Array[Int]

Array of indexs for Side data Arrs giving the index value for the start of each side row.

Array of indexs for Side data Arrs giving the index value for the start of each side row.

Concrete methods

The active tiles without any PaintElems.

The active tiles without any PaintElems.

Combine adjacent tiles of the same value.

Combine adjacent tiles of the same value.

@inline
final def arrIndex(hc: HCen): Int

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

final override def bottom: Double
Definition Classes
final def cenRowEmpty(row: Int): Boolean

Is the specified tile centre row empty?

Is the specified tile centre row empty?

def defaultView(pxScale: Double): HGridView
def findPath(startRoord: HCen, endRoord: HCen)(fTerrCost: (HCen, HCen) => OptInt): Option[List[HCen]]
final def flatMap[ArrT <: SeqImut[_]](f: HCen => ArrT)(implicit build: ArrFlatBuilder[ArrT]): ArrT

flatMaps from all hex tile centre coordinates to an Arr of type ArrT. The elements of this array can not be accessed from this grid class as the TileGrid structure is lost in the flatMap operation.

flatMaps from all hex tile centre coordinates to an Arr of type ArrT. The elements of this array can not be accessed from this grid class as the TileGrid structure is lost in the flatMap operation.

final def foreach(f: HCen => Unit): Unit

foreachs over each HCen hex tile centre, applying the side effecting function.

foreachs over each HCen hex tile centre, applying the side effecting function.

override def foreachCenCoord(f: TileCoord => Unit): Unit
Definition Classes
def getHCost(startRoord: HCen, endRoord: HCen): Int

H cost for A* path finding. To move 1 tile has a cost 2. This is because the G cost or actual cost is the sum of the terrain cost of tile of departure and the tile of arrival.

H cost for A* path finding. To move 1 tile has a cost 2. This is because the G cost or actual cost is the sum of the terrain cost of tile of departure and the tile of arrival.

final def iForeach(f: (HCen, Int) => Unit): Unit

foreachs with index over each HCen hex tile centre, apply the side effecting function.

foreachs with index over each HCen hex tile centre, apply the side effecting function.

final override def left: Double
Definition Classes
final def map[B, ArrB <: SeqImut[B]](f: HCen => B)(implicit build: ArrBuilder[B, ArrB]): ArrB

Maps over the HCen hex centre tile coordinates. B is used rather than A as a type parameter, as this method maps from HCen => B, corresponding to the standard Scala map function of A => B.

Maps over the HCen hex centre tile coordinates. B is used rather than A as a type parameter, as this method maps from HCen => B, corresponding to the standard Scala map function of A => B.

final def newHCenArrOfBuff[A <: AnyRef](implicit ct: ClassTag[A]): HCenArrOfBuff[A]

Creates a new HCenArrOfBuff An [[HCen] hex tile centre corresponding Arr of empty ArrayBuffers of the given or inferred type.

Creates a new HCenArrOfBuff An [[HCen] hex tile centre corresponding Arr of empty ArrayBuffers of the given or inferred type.

final def newTileArr[A <: AnyRef](value: A)(implicit ct: ClassTag[A]): HCenArr[A]

New immutable Arr of Tile data.

New immutable Arr of Tile data.

final def newTileArrArr[A <: AnyRef](implicit ct: ClassTag[A]): HCenArrArr[A]

New immutable Arr of Tile data.

New immutable Arr of Tile data.

final def newTileArrOpt[A <: AnyRef](implicit ct: ClassTag[A]): HCenArrOpt[A]

New Tile immutable Tile Arr of Opt data values.

New Tile immutable Tile Arr of Opt data values.

final override def right: Double
Definition Classes
@inline
final def sideArrIndex(hc: HSide): Int

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

Gives the index into an Arr / Array of Tile data from its tile HCen. Use sideIndex and vertIndex methods to access Side and Vertex Arr / Array data.

override def sideLines: LineSegs
Definition Classes
final override def top: Double
Definition Classes
final override def yCen: Double

The centre of the hex grid along the Y axis after the yRatio has been applied to the r row value.

The centre of the hex grid along the Y axis after the yRatio has been applied to the r row value.

Definition Classes
override def yRatio: Double

The conversion factor for c column tile grid coordinates. 1.0 / sqrt(3).

The conversion factor for c column tile grid coordinates. 1.0 / sqrt(3).

Definition Classes

Inherited methods

def bottomCenRow: Int

The bottom or lowest tile centre row, r coordinate.

The bottom or lowest tile centre row, r coordinate.

Inherited from:
TGrid
def cCen: Int

The centre of the hex grid in terms of c column coordinates.

The centre of the hex grid in terms of c column coordinates.

Inherited from:
TGrid

The centre point as a Vec2. Not sure why this id implemented here.

The centre point as a Vec2. Not sure why this id implemented here.

Inherited from:
TGrid
final def flatMapRows[ArrT <: SeqImut[_]](f: Int => ArrT)(implicit build: ArrFlatBuilder[ArrT]): ArrT

flatMaps over each row number.

flatMaps over each row number.

Inherited from:
TGrid
final def foldRows[B](init: B)(f: (B, Int) => B): B

foldLefts over each row number.

foldLefts over each row number.

Inherited from:
TGrid
final def foreachRow(f: Int => Unit): Unit

Foreach grid Row y coordinate.

Foreach grid Row y coordinate.

Inherited from:
TGrid
def fullDisplayScale(dispWidth: Double, dispHeight: Double, padding: Double): Double
Inherited from:
TGrid
def hCenExists(r: Int, c: Int): Boolean

Boolean. True if the specified hex centre exists in this hex grid.

Boolean. True if the specified hex centre exists in this hex grid.

Inherited from:
HGridBased
final def hCenExists(hc: HCen): Boolean

Boolean. True if the HCen hex centre exists in this hex grid.

Boolean. True if the HCen hex centre exists in this hex grid.

Inherited from:
HGridBased
def height: Double

Height of the tile grid from furthest tile edge or vertex to furthest tile edge or vertex.

Height of the tile grid from furthest tile edge or vertex to furthest tile edge or vertex.

Inherited from:
TGrid
def leftCenCol: Int

The minimum or lowest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

The minimum or lowest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

Inherited from:
TGrid
def mapCenCoords[B, BB <: SeqImut[B]](f: TileCoord => B)(implicit build: ArrBuilder[B, BB]): BB
Inherited from:
TGrid
final def mapRows[B, BB <: SeqImut[B]](f: Int => B)(implicit build: ArrBuilder[B, BB]): BB

maps over each row number.

maps over each row number.

Inherited from:
TGrid
@inline
final def numOfVertRows: Int

The number of Rows of vertices.

The number of Rows of vertices.

Inherited from:
TGrid
def numTileRows: Int

Number of rows of tile centres. This will be different to the number of rows of sides and and will be different to the number of rows of vertices for HexGrids.

Number of rows of tile centres. This will be different to the number of rows of sides and and will be different to the number of rows of vertices for HexGrids.

Inherited from:
TGrid
def numTiles: Int

The total number of tile centres in this tile Grid.

The total number of tile centres in this tile Grid.

Inherited from:
TGrid
def rCen: Int

The centre of the hex grid in terms of r row coordinates.

The centre of the hex grid in terms of r row coordinates.

Inherited from:
TGrid

Gives the text graphics for the row and column of each tile centre.

Gives the text graphics for the row and column of each tile centre.

Inherited from:
TGrid
def rightCenCol: Int

the Maximum or highest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

the Maximum or highest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

Inherited from:
TGrid
@inline
final def sideRowBottom: Int

The bottom or lowest tile side row, r coordinate.

The bottom or lowest tile side row, r coordinate.

Inherited from:
TGrid
@inline
def sideRowTop: Int

The top of highest tile side row, r coordinate.

The top of highest tile side row, r coordinate.

Inherited from:
TGrid
def topCenRow: Int

The top of highest tile centre row, r coordinate.

The top of highest tile centre row, r coordinate.

Inherited from:
TGrid
def width: Double

Width of the tile Grid from furthest tile edge to furthest tile edge.

Width of the tile Grid from furthest tile edge to furthest tile edge.

Inherited from:
TGrid
@inline
def xCen: Double

The centre of this grid in the X axis. this will be equal to the cCen Int value.

The centre of this grid in the X axis. this will be equal to the cCen Int value.

Inherited from:
TGrid