HCenArr

class HCenArr[A <: AnyRef](val unsafeArr: Array[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.

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(hc: HCen)(implicit grid: HGrid): A
def cForeach[U](f: (A, HCen) => U)(implicit grid: HGrid): Unit

Short for coordinate-foreach. For each element in the underlying array, with its respective HCen coordinate performs the side effecting function.

Short for coordinate-foreach. For each element in the underlying array, with its respective HCen coordinate performs the side effecting function.

def foreach[U](f: A => U): Unit

For each element in the underlying array performs the side effecting function. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid HGrid from which this HCenArr was created.

For each element in the underlying array performs the side effecting function. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid HGrid from which this HCenArr was created.

def length: Int
def map[B, BB <: ArrBase[B]](f: A => B)(implicit build: ArrBuilder[B, BB]): BB

Each element in the underlying array is mapped by the parameter function to an element of type B. This method treat the HCenArr class like a standard Arr or Array. It does not utilise the grid HGrid from which this HCenArr was created.

Each element in the underlying array is mapped by the parameter function to an element of type B. This method treat the HCenArr class like a standard Arr or Array. It does not utilise the grid HGrid from which this HCenArr was created.

def mapHC[B, BB <: ArrBase[B]](f: (A, HCen) => B)(implicit grid: HGrid, build: ArrBuilder[B, BB]): BB

Short for map with hex centre coordinate-map. Each element in the underlying array, with its corresponding HCen coordinate is mapped by the parameter function to an element of type B.

Short for map with hex centre coordinate-map. Each element in the underlying array, with its corresponding HCen coordinate is mapped by the parameter function to an element of type B.

def mutSetAll(value: A): Unit
def rc(r: Int, c: Int)(implicit grid: HGrid): A
def rowCombine(implicit grid: HGrid): Arr[HCenRowValue[A]]
final
def setRow(row: Int, cStart: Int, tileValues: Multiple[A]*)(implicit grid: HGrid): HCen

Note set Row starts with the r (row) parameter.

Note set Row starts with the r (row) parameter.

def sideFlatMap[BB <: ArrBase[_]](f1: (HSide, A) => BB, f2: (HSide, A, A) => BB)(implicit grid: HGrid, build: ArrFlatBuilder[BB]): BB

Maps the sides to an immutable Array, using the data of this HCenArr. It takes two functions, one for the edges of the grid, that takes the HSide and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

Maps the sides to an immutable Array, using the data of this HCenArr. It takes two functions, one for the edges of the grid, that takes the HSide and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

def sideMap[B, BB <: ArrBase[B]](f1: (HSide, A) => B, f2: (HSide, A, A) => B)(implicit grid: HGrid, build: ArrBuilder[B, BB]): BB

Maps the sides to an immutable Array, using the data of this HCenArr. It takes two functions, one for the edges of the grid, that tkaes the HSide and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

Maps the sides to an immutable Array, using the data of this HCenArr. It takes two functions, one for the edges of the grid, that tkaes the HSide and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

Concrete fields

val unsafeArr: Array[A]