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 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 hcForeach[U](f: (HCen, A) => U)(implicit grid: HGrid): Unit

HCen with foreach. Applies the side effecting function to the HCen coordinate with its respective element. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

HCen with foreach. Applies the side effecting function to the HCen coordinate with its respective element. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

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

HCen with map. Applies the function to each HCen coordinate with the corresponding element in the underlying array. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

HCen with map. Applies the function to each HCen coordinate with the corresponding element in the underlying array. Note the function signature follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods' (accumulator, element) => B signature.

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 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]