ostrat.prid.phex

Package ofr hex grids.

Type members

Classlikes

class HCen(val r: Int, val c: Int) extends HCenOrSide with TileCen

A Hex tile centre hexG grid HGrid coordinate.

A Hex tile centre hexG grid HGrid coordinate.

Companion:
object
object HCen

Companion object of HCen trait, contains HVert values for hex tile 0, 0. As well as apply method and Show implicit.

Companion object of HCen trait, contains HVert values for hex tile 0, 0. As well as apply method and Show implicit.

Companion:
class
final class HCenArr[A <: AnyRef](val unsafeArray: Array[A]) extends AnyVal with TileCenArr[A]

An array of hex tile or hex centre data. For efficiency the data is stored as a flat Array. No run time information distinguishes this from an ordinary linear sequence array of data. Whether in a game or a non game application the data of the grid tiles is likely to change much more frequently than the size, shape, structure of the grid. The compiler knows this is hex grid array and hence the data should be set and retrieved through the HGrid hex grid. So nearly all the methods take the HGrid as an implicit parameter.

An array of hex tile or hex centre data. For efficiency the data is stored as a flat Array. No run time information distinguishes this from an ordinary linear sequence array of data. Whether in a game or a non game application the data of the grid tiles is likely to change much more frequently than the size, shape, structure of the grid. The compiler knows this is hex grid array and hence the data should be set and retrieved through the HGrid hex grid. So nearly all the methods take the HGrid as an implicit parameter.

Companion:
object
object HCenArr

Companion object for HCenArr, contains an apply factory method.

Companion object for HCenArr, contains an apply factory method.

Companion:
class
class HCenArrArr[A](val unsafeArray: Array[Array[A]])

A Hex grid array class of Arrs.

A Hex grid array class of Arrs.

class HCenArrOfBuff[A <: AnyRef](val unsafeArr: Array[ArrayBuffer[A]])

An HCen hex tile centre grid Arr of ArrayBuffers corresponding to the centres of an HGrid hex tile grid.

An HCen hex tile centre grid Arr of ArrayBuffers corresponding to the centres of an HGrid hex tile grid.

Companion:
object

Companion object for the hex (centres) grid Array of ArrayBuffer classes.

Companion object for the hex (centres) grid Array of ArrayBuffer classes.

Companion:
class
final class HCenArrOpt[A <: AnyRef](val unsafeArr: Array[A]) extends AnyVal with TileArrOpt[A]

An immutable Arr of Opt Tile data for a specific hex tile grid HGrid. This is specialised for OptRef[A]. The tileGrid can map the HCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit HGrid hex grid parameter.

An immutable Arr of Opt Tile data for a specific hex tile grid HGrid. This is specialised for OptRef[A]. The tileGrid can map the HCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit HGrid hex grid parameter.

final class HCenBuff(val unsafeBuffer: ArrayBuffer[Int]) extends AnyVal with BuffInt2s[HCen]
trait HCenOrSide extends HNotVert with TileCenOrSide

Common trait for hex centre and hex side coordinate. The position of these coordinates is proportional, unlike the Hex vertices positions.

Common trait for hex centre and hex side coordinate. The position of these coordinates is proportional, unlike the Hex vertices positions.

Companion:
object
object HCenOrSide

Companion object for HCenOrSide trait, contains factory apply method and implicit PersistDec instance.

Companion object for HCenOrSide trait, contains factory apply method and implicit PersistDec instance.

Companion:
class
final class HCenPath(val arrayUnsafe: Array[Int]) extends AnyVal with HCenPathTr
case class HCenRow(r: Int, c: Int, num: Int) extends HCenRowLike

A row or a segment a row of Hex tiles in a grid. The start / left centre HexGrid coordinate and the number of tiles in the row..

A row or a segment a row of Hex tiles in a grid. The start / left centre HexGrid coordinate and the number of tiles in the row..

case class HCenRowValue[A](r: Int, c: Int, num: Int, value: A) extends HCenRowLike
final class HCens(val unsafeArray: Array[Int]) extends AnyVal with ArrInt2s[HCen]

An efficient array[Int] based collection for HCens hex grid centre coordinates.

An efficient array[Int] based collection for HCens hex grid centre coordinates.

Companion:
object

Companion object for HCens trait efficient array[Int] based collection for HCens hex grid centre coordinates, contains factory apply and uninitialised methods..

Companion object for HCens trait efficient array[Int] based collection for HCens hex grid centre coordinates, contains factory apply and uninitialised methods..

Companion:
class
trait HCoord extends TileCoord

A coordinate with in a Hex grid. It may be a Hex tile centre HCen, a HexSide HSide or Hex tile vertice HVert.

A coordinate with in a Hex grid. It may be a Hex tile centre HCen, a HexSide HSide or Hex tile vertice HVert.

Companion:
object
object HCoord

Companion object for Hex coordinate trait, contains apply factory method and persist and PolygonBuilder implicit instances.

Companion object for Hex coordinate trait, contains apply factory method and persist and PolygonBuilder implicit instances.

Companion:
class
final class HCoordBuff(val unsafeBuffer: ArrayBuffer[Int]) extends AnyVal with BuffInt2s[HCoord]
class HCoordOther(val r: Int, val c: Int) extends HNotVert

The only purpose of this class is to ensure that all HCoord combinations of r and c are valid. Thisis for the combinations where r is even and c is odd.

The only purpose of this class is to ensure that all HCoord combinations of r and c are valid. Thisis for the combinations where r is even and c is odd.

final class HCoords(val unsafeArray: Array[Int]) extends AnyVal with ArrInt2s[HCoord]
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.

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

class HGridIrr(val bottomCenRow: Int, val unsafeRowsArray: Array[Int]) extends HGrid

An irregular hex grid, where the rows have different lengths and irregular start row coordinates. This is backed by an Array[Int]. The length of this Array is twice the number of tile rows in the grid. Each row from lowest to highest has two values length of the row in the number of tile centres HCens and the rTileMin coordinate for the row.

An irregular hex grid, where the rows have different lengths and irregular start row coordinates. This is backed by an Array[Int]. The length of this Array is twice the number of tile rows in the grid. Each row from lowest to highest has two values length of the row in the number of tile centres HCens and the rTileMin coordinate for the row.

Value parameters:
tileRowsStartEnd

the Array contains 2 values per Tile Row, the cStart Tile and the cEnd Tile

yTileMin

The y value for the bottom tile row of the TileGrid

Constructor:

creates a new HexGridIrr with a defined grid.

Companion:
object
object HGridIrr
Companion:
class
class HGridReg(val bottomCenRow: Int, val topCenRow: Int, val leftCenCol: Int, val rightCenCol: Int) extends HGrid

A Regular hex grid where the tile rows have the same length, except the tile rows where r %% 4 == 2 may differ in length by 1 from tile rows where r %% 4 == 0 rows.

A Regular hex grid where the tile rows have the same length, except the tile rows where r %% 4 == 2 may differ in length by 1 from tile rows where r %% 4 == 0 rows.

Companion:
object
object HGridReg

Companion object for the HGridReg class. Contains an applr method that corrects the r and Y minimum and maximum values.

Companion object for the HGridReg class. Contains an applr method that corrects the r and Y minimum and maximum values.

Companion:
class
class HGridView(val r: Int, val c: Int, val pxScale: Double) extends Show2[HCoord, Double]

A view of a hex grid, currently representing the HCoord focus and the pixels/dx scale.

A view of a hex grid, currently representing the HCoord focus and the pixels/dx scale.

Companion:
object
object HGridView

Companion object for HGridView class. Contains factory apply method overloads and implicit Persist instance.

Companion object for HGridView class. Contains factory apply method overloads and implicit Persist instance.

Companion:
class
trait HGrids
class HGridsFlat(val grids: Arr[HGrid]) extends HGrids
trait HNotVert extends HCoord
class HSide(val r: Int, val c: Int) extends HCenOrSide with TileSide

A Hex side coordinate in a Hex Grid. So Side 1 on its primary Hex tile goes from Vert 6 to 1 while it is Side 4 on its secondary Hex tile and goes from Vertex 4 to vertex 3 So Side 2 on its primary Hex tile goes from Vert 1 to 2 while it is Side 5 on its secondary Hex tile and goes from Vertex 5 to vertex 4 So Side 3 on its primary Hex tile goes from Vert 2 to 3 while it is Side 4 on its secondary Hex tile and goes from Vertex 6 to vertex 4

A Hex side coordinate in a Hex Grid. So Side 1 on its primary Hex tile goes from Vert 6 to 1 while it is Side 4 on its secondary Hex tile and goes from Vertex 4 to vertex 3 So Side 2 on its primary Hex tile goes from Vert 1 to 2 while it is Side 5 on its secondary Hex tile and goes from Vertex 5 to vertex 4 So Side 3 on its primary Hex tile goes from Vert 2 to 3 while it is Side 4 on its secondary Hex tile and goes from Vertex 6 to vertex 4

Companion:
object
object HSide

Companion object for the HSide class, provides an apply factory method that throws an exception for an invalid Hex side coordinate.

Companion object for the HSide class, provides an apply factory method that throws an exception for an invalid Hex side coordinate.

Companion:
class
class HSideArr[A <: AnyRef](val unsafeArr: Array[A])
final class HSideBooleans(val unsafeArray: Array[Boolean]) extends AnyVal

Boolean data corresponding to the sides of a hex grid, stored using an underlying Array[Boolean]. Thhese classes should be created, initalised and used using an [HGrid]] class. For convenience the HGrid is passed as an implicit parameter.

Boolean data corresponding to the sides of a hex grid, stored using an underlying Array[Boolean]. Thhese classes should be created, initalised and used using an [HGrid]] class. For convenience the HGrid is passed as an implicit parameter.

final class HSides(val unsafeArray: Array[Int]) extends AnyVal with ArrInt2s[HSide]

An efficient array[Int] based collection for HSides hex grid centre coordinates.

An efficient array[Int] based collection for HSides hex grid centre coordinates.

Companion:
object

Companion object for HSides trait efficient array[Int] based collection for HSides hex grid centre coordinates, contains factory apply and uninitialised methods.

Companion object for HSides trait efficient array[Int] based collection for HSides hex grid centre coordinates, contains factory apply and uninitialised methods.

Companion:
class
sealed trait HStep extends TileStep with ElemInt1

A step on a hex tile grid HGrid can take 6 values: upright right, downright, downleft, left and upleft.

A step on a hex tile grid HGrid can take 6 values: upright right, downright, downleft, left and upleft.

Companion:
object
object HStep
Companion:
class
case object HStepDL extends HStep

A step downleft on a hex tile grid HGrid.

A step downleft on a hex tile grid HGrid.

case object HStepDR extends HStep

A step downright on a hex tile grid HGrid.

A step downright on a hex tile grid HGrid.

case object HStepLt extends HStep

A step left on a hex tile grid HGrid.

A step left on a hex tile grid HGrid.

case object HStepRt extends HStep

A step right on a hex tile grid HGrid.

A step right on a hex tile grid HGrid.

case object HStepUL extends HStep

A step upleft on a hex tile grid HGrid.

A step upleft on a hex tile grid HGrid.

case object HStepUR extends HStep

A step upright on a hex tile grid HGrid.

A step upright on a hex tile grid HGrid.

final class HSteps(val unsafeArray: Array[Int]) extends AnyVal with ArrInt1s[HStep] with HStepsTr
Companion:
object
object HSteps extends HStepsCompanion[HSteps]
Companion:
class
trait HStepsTr

A trait for HSteps. The purpose of the trait rather than a class is to allow the consumer to mix in their own traits. Its not clear whether this is useful in Scala 3 or its bettter to use union types with the HSteps class.

A trait for HSteps. The purpose of the trait rather than a class is to allow the consumer to mix in their own traits. Its not clear whether this is useful in Scala 3 or its bettter to use union types with the HSteps class.

final class HVert extends AnyVal with HCoord with TileCoord

A hex tile vertex coordinate.

A hex tile vertex coordinate.

Companion:
object
object HVert
Companion:
class
final class HVertBuff(val unsafeBuffer: ArrayBuffer[Int]) extends AnyVal with BuffInt2s[HVert]
final class HVerts(val unsafeArray: Array[Int]) extends AnyVal with HVertsLike with ArrInt2s[HVert]

An array[Int] based collection for HVert.

An array[Int] based collection for HVert.

Companion:
object
Companion:
class
trait HVertsLike extends DataInt2s[HVert]

Common trait for Hverts and PolygonHC

Common trait for Hverts and PolygonHC

case class HexAndStep(r1: Int, c1: Int, step: HStep)

Hex centre coordinate and hex step.

Hex centre coordinate and hex step.

Companion:
object
object HexAndStep
Companion:
class
trait HexMem[A]

Not sure about this trait for occupants of a hex tile.

Not sure about this trait for occupants of a hex tile.

implicit implicit class IntGridImplicit(thisInt: Int)
case class LineSegHC(r1: Int, c1: Int, r2: Int, c2: Int) extends LineSegLike[HCoord]

A 2d line upon a HexGrid defined by its start and end HGrid HCoords.

A 2d line upon a HexGrid defined by its start and end HGrid HCoords.

Companion:
object
object LineSegHC
Companion:
class
case class Node(tile: HCen, var gCost: Int, var hCost: Int, var parent: OptRef[Node])
final class PolygonHC(val unsafeArray: Array[Int]) extends AnyVal with PolygonInt2s[HCoord]

A polygon with the vertices defined by hex tile coordinates HCoords.

A polygon with the vertices defined by hex tile coordinates HCoords.

Companion:
object

Companion object for the polygon whose vertices are defined by hex tile coordinates PolygonHC trait.

Companion object for the polygon whose vertices are defined by hex tile coordinates PolygonHC trait.

Companion:
class

Value members

Concrete fields

The hex centre step values.

The hex centre step values.

Implicits

Implicits

final implicit def IntGridImplicit(thisInt: Int): IntGridImplicit