HCenArr

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.

Companion:
object
trait TileCenArr[A]
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def apply(hc: HCen)(implicit grid: HGrid): A
final def completeRow(row: Int, cStart: Int, tileValues: Multiple[A]*)(implicit grid: HGrid): HCen

Completes the given row from the given starting c column value to the end of the row. An exception is thrown if the tile values don't match with the end of the row.

Completes the given row from the given starting c column value to the end of the row. An exception is thrown if the tile values don't match with the end of the row.

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 <: SeqImut[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 rc(r: Int, c: Int)(implicit grid: HGrid): A
def rowCombine(implicit grid: HGrid): Arr[HCenRowValue[A]]
final def setRowPart(row: Int, cStart: Int, numOfCens: Int, tileValue: A)(implicit grid: HGrid): HCen

Sets the given row from the given starting c column value, for the given number of tile centre values. An exception is thrown if the numOfCens overflows the row end.

Sets the given row from the given starting c column value, for the given number of tile centre values. An exception is thrown if the numOfCens overflows the row end.

def sideFlatMap[BB <: SeqImut[_]](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 <: SeqImut[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 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.

Inherited methods

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

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

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

Inherited from:
TileCenArr
final def length: Int

The number of tile centres this array of data represents.

The number of tile centres this array of data represents.

Inherited from:
TileCenArr
def map[B, BB <: SeqImut[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.

Inherited from:
TileCenArr
final def mutSetAll(value: A): Unit

Set all tiles to the given value.

Set all tiles to the given value.

Inherited from:
TileCenArr

Concrete fields