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

Apply method returns a data element from this data layer for the given HCen. The appropriate index is found from the implicit HGridSys. There is an alterntive nme overload where the HGridSys is passed explicitly as the first paremter.

Apply method returns a data element from this data layer for the given HCen. The appropriate index is found from the implicit HGridSys. There is an alterntive nme overload where the HGridSys is passed explicitly as the first paremter.

Attributes

def apply(gridSys: HGridSys, hc: HCen): A

Apply method returns a data element from this data layer for the given HCen.

Apply method returns a data element from this data layer for the given HCen.

Attributes

final def completeRow(row: Int, tileMultis: Multiple[A]*)(implicit grid: HGrid): HCen

Fills in the whole given row. An exception is thrown if the tile values don't match with the end of the row.

Fills in the whole given 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 projHCenPtMap(f: (HCen, Pt2, A) => GraphicElem)(implicit proj: HSysProjection): GraphicElems

Maps the visible HCens in the projection with their respective projection Pt2 tile centre points and the data layer element form this collection to GraphicElems. This method name overload takes the HSysProjection as an implicit parameter. The other name overload takes it as an explicit first parameter list. In practice this method may be of limited utility. It may be better to use the the HSysProjection or another class as the dispatching object and access these data layer elements by the HCen apply methods.

Maps the visible HCens in the projection with their respective projection Pt2 tile centre points and the data layer element form this collection to GraphicElems. This method name overload takes the HSysProjection as an implicit parameter. The other name overload takes it as an explicit first parameter list. In practice this method may be of limited utility. It may be better to use the the HSysProjection or another class as the dispatching object and access these data layer elements by the HCen apply methods.

Attributes

Maps the visible HCens in the projection with their respective projection Pt2 tile centre points and the data layer element form this collection to GraphicElems. This method name overload takes the HSysProjection as an explicit first parameter list. The other name overload takes it as an implicit parameter.In practice this method may be of limited utility. It may be better to use the the HSysProjection or another class as the dispatching object and access these data layer elements by the HCen apply methods.

Maps the visible HCens in the projection with their respective projection Pt2 tile centre points and the data layer element form this collection to GraphicElems. This method name overload takes the HSysProjection as an explicit first parameter list. The other name overload takes it as an implicit parameter.In practice this method may be of limited utility. It may be better to use the the HSysProjection or another class as the dispatching object and access these data layer elements by the HCen apply methods.

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

Comment no correct, Maps the sides to an immutable Array, using the data of this HCenLayer. 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.

Comment no correct, Maps the sides to an immutable Array, using the data of this HCenLayer. 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 projLinksHsLineOptMap[B, BB <: Arr[B]](proj: HSysProjection)(f: (HSide, LineSeg, A, A) => Option[B])(implicit build: ArrMapBuilder[B, BB]): BB

implementation not correct, Comment not correct, 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.

implementation not correct, Comment not correct, 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 HCenLayer. 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 HCenLayer. 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 rc(grid: HGridSys, r: Int, c: Int): A
def rowsCombine(implicit grider: HGridSys): RArr[HCenRowPair[A]]
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

final def toEndRow(row: Int, cStart: Int, tileMultis: 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 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 ssForeach[U](f: A => U): Unit

Performs a side effecting function on each element of the specifying sequence in order.

Performs a side effecting function on each element of the specifying sequence in order.

Attributes

Definition Classes
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, newElem: 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