HCenLayer

ostrat.prid.phex.HCenLayer
See theHCenLayer companion object
final class HCenLayer[A <: AnyRef](val unsafeArray: Array[A]) extends AnyVal with TCenLayer[A]

An HGridSys hex tile grid system of HCen or hex tile 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.

Attributes

Companion:
object
Graph
Supertypes
trait TCenLayer[A]
trait RefsSeqLike[A]
trait SeqLike[A]
class AnyVal
trait Matchable
class Any

Members list

Concise view

Type members

Types

override type ThisT = HCenLayer[A]

Gives the final type of this class.

Gives the final type of this class.

Attributes

Value members

Concrete methods

def ++(operand: HCenLayer[A])(implicit ct: ClassTag[A]): HCenLayer[A]
def apply(hc: HCen)(implicit gridSys: HGridSys): A
def apply(gridSys: HGridSys, hc: HCen): 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.

Attributes

override def elemsStr: String

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

Attributes

Definition Classes
override def fromArray(array: Array[A]): HCenLayer[A]

Attributes

Definition Classes
def hcFlatMap[BB <: Arr[_]](f: (HCen, A) => BB)(implicit grid: HGridSys, build: ArrFlatBuilder[BB]): BB

HCen with flatmap. 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 flatmap. 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.

Attributes

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.

Attributes

def hcMap[B, BB <: Arr[B]](f: (HCen, A) => B)(implicit grid: HGridSys, build: ArrMapBuilder[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.

Attributes

def hcOptFlatMap[BB <: Arr[_]](f: (HCen, A) => Option[BB])(implicit grid: HGridSys, build: ArrFlatBuilder[BB]): BB

HCen with optFlatmap. 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 optFlatmap. 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.

Attributes

def hcOptMap[B, BB <: Arr[B]](f: (A, HCen) => Option[B])(implicit grid: HGridSys, build: ArrMapBuilder[B, BB]): BB

Maps each data element with thw corresponding HCen to an Option of type B. Collects the Some's values. The length of the returned Arr will be between 0 and the lengthof this HCenLayer.

Maps each data element with thw corresponding HCen to an Option of type B. Collects the Some's values. The length of the returned Arr will be between 0 and the lengthof this HCenLayer.

Attributes

def linksFlatMap[BB <: Arr[_]](f: (HSide, A, A) => BB)(implicit grid: HGridSys, build: ArrFlatBuilder[BB]): BB

FlatMaps the links / inner sides to an immutable Array, using the data of this HCenArr. It takes a function, that takes the HSide and the two adjacent hex tile data values.

FlatMaps the links / inner sides to an immutable Array, using the data of this HCenArr. It takes a function, that takes the HSide and the two adjacent hex tile data values.

Attributes

def linksMap[B, BB <: Arr[B]](f: (HSide, A, A) => B)(implicit grid: HGridSys, build: ArrMapBuilder[B, BB]): BB

Maps the links or inner sides to an immutable Array, using the data of this HCenArr. It takes a function for the links or inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

Maps the links or inner sides to an immutable Array, using the data of this HCenArr. It takes a function for the links or inner sides of the grid that takes the HSide and the two adjacent hex tile data values.

Attributes

def projLinksFlatMap[BB <: Arr[_]](f2: (HSide, A, A) => BB)(implicit proj: HSysProjection, 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.

Attributes

def projLinksFlatMap[BB <: Arr[_]](proj: HSysProjection)(f: (HSide, A, A) => BB)(implicit 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.

Attributes

def projLinksLineOptMap[B, BB <: Arr[B]](f: (LineSeg, A, A) => Option[B])(implicit proj: HSysProjection, build: ArrMapBuilder[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.

Attributes

def projLinksLineOptMap[B, BB <: Arr[B]](proj: HSysProjection)(f: (LineSeg, A, A) => Option[B])(implicit build: ArrMapBuilder[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.

Attributes

def projSideFlatMap[BB <: Arr[_]](proj: HSysProjection)(f1: (HSide, A) => BB, f2: (HSide, A, A) => BB)(implicit 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.

Attributes

def rc(r: Int, c: Int)(implicit grid: HGridSys): A
def rowsCombine(implicit grider: HGridSys): RArr[HCenRowTuple[A]]
def scSomesMapPair[B1, ArrB1 <: Arr[B1], B2, B <: ElemPair[B1, B2], ArrB <: PairArr[B1, ArrB1, B2, B]](f1: (HCen, A) => B1)(f2: (HCen, A) => B2)(implicit gridSys: HGridSys, build: PairArrMapBuilder[B1, ArrB1, B2, B, ArrB]): ArrB
def set(hc: HCen, value: A)(implicit gridSys: HGridSys): Unit
def set(r: Int, c: Int, value: A)(implicit gridSys: HGridSys): Unit
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.

Attributes

def sideFlatMap[BB <: Arr[_]](f1: (HSide, A) => BB, f2: (HSide, A, A) => BB)(implicit grid: HGridSys, 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.

Attributes

def sideMap[B, BB <: Arr[B]](f1: (HSide, A) => B, f2: (HSide, A, A) => B)(implicit grid: HGrid, build: ArrMapBuilder[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.

Attributes

override def typeStr: String

String specifying the type of this object.

String specifying the type of this object.

Attributes

Definition Classes

Inherited methods

final override def fElemStr: (A) => String

Attributes

Definition Classes
Inherited from:
RefsSeqLike
def foreach[U](f: A => U): Unit

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

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

Attributes

Inherited from:
TCenLayer
final def length: Int

The number of tile centres this array of data represents.

The number of tile centres this array of data represents.

Attributes

Inherited from:
TCenLayer
def map[B, BB <: Arr[B]](f: A => B)(implicit build: ArrMapBuilder[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.

Attributes

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

Set all tiles to the given value.

Set all tiles to the given value.

Attributes

Inherited from:
TCenLayer
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
SeqLike -> Any
Inherited from:
SeqLike
final override def unsafeSetElem(i: Int, value: A): Unit

Sets / mutates an element in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Sets / mutates an element in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Definition Classes
Inherited from:
RefsSeqLike
def unsafeSetElems(index: Int, elems: A*): Unit

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Attributes

Inherited from:
SeqLike

Concrete fields

The mutable backing Array. End users should rarely if ever have to access this field

The mutable backing Array. End users should rarely if ever have to access this field

Attributes