LayerHcRefSys

ostrat.prid.phex.LayerHcRefSys
See theLayerHcRefSys companion object
trait LayerHcRefSys[A <: AnyRef] extends LayerHcRef[A], LayerTcRef[A]

Reference data layer for HGridSys. 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 LayerHcRef[A]
trait LayerTcRef[A]
class Any
Known subtypes
class LayerHcRefGrid[A]
class LayerHcRefMulti[A]

Members list

Value members

Abstract methods

def spawn(parentGridSys: HGridSys, childGridSys: HGridSys)(implicit ct: ClassTag[A]): LayerHcRefSys[A]

Spawns a new LayerHcRefSys data layer from this LayerHcRefSys's HGridSys to the child HGridSys. There is a name overload for this method that passes the child HGridSys implicitly.

Spawns a new LayerHcRefSys data layer from this LayerHcRefSys's HGridSys to the child HGridSys. There is a name overload for this method that passes the child HGridSys implicitly.

Attributes

Concrete methods

def ++(operand: LayerHcRefSys[A])(implicit ct: ClassTag[A]): LayerHcRefSys[A]
def getPoly(hc: HCen, terr: Any, corners: HCornerLayer, proj: HSysProjection): Polygon
def linksFlatMap[BB <: Arr[_]](f: (HSep, A, A) => BB)(implicit grid: HGridSys, build: BuilderArrFlat[BB]): BB

FlatMaps the links / inner sides to an immutable Array, using the data of this HCenArr. It takes a function, that takes the HSep 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 HSep and the two adjacent hex tile data values.

Attributes

def linksMap[B, BB <: Arr[B]](f: (HSep, A, A) => B)(implicit grid: HGridSys, build: BuilderArrMap[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 HSep 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 HSep 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: (HSep, A, A) => BB)(implicit proj: HSysProjection, build: BuilderArrFlat[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def projLinksFlatMap[BB <: Arr[_]](proj: HSysProjection)(f: (HSep, A, A) => BB)(implicit build: BuilderArrFlat[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def projLinksHsLineOptMap[B, BB <: Arr[B]](f: (HSep, LineSeg, A, A) => Option[B])(implicit proj: HSysProjection, build: BuilderArrMap[B, BB]): BB

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

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

Attributes

def projLinksHsLineOptMap[B, BB <: Arr[B]](proj: HSysProjection)(f: (HSep, LineSeg, A, A) => Option[B])(implicit build: BuilderArrMap[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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: BuilderArrMap[B, BB]): BB

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

Maps the sides to an immutable Array, using the data of this LayerHcRefSys. It takes two functions, one for the edges of the grid, that takes the HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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: BuilderArrMap[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def projRowsCombine(implicit proj: HSysProjection): RArr[HCenRowPair[A]]
def projSideFlatMap[BB <: Arr[_]](proj: HSysProjection)(f1: (HSep, A) => BB, f2: (HSep, A, A) => BB)(implicit build: BuilderArrFlat[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def rowsCombine(implicit grider: HGridSys): RArr[HCenRowPair[A]]
final def setRowEnd(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

final def setRowEndUnchecked(row: Int, tileMultis: Multiple[A]*)(implicit grid: HGrid): HCen
final def setRowPartSame(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

inline def setRowSame(row: Int, value: A)(implicit grid: HGrid): Unit

Fills in the whole given row, with the same given value. This method has anme overload where the grid is passed explicitly as the first parameter.

Fills in the whole given row, with the same given value. This method has anme overload where the grid is passed explicitly as the first parameter.

Attributes

def setRowSame(grid: HGrid, row: Int, value: A): Unit

Fills in the whole given row, with the same given value. This method has anme overload where the grid is passed implicitly.

Fills in the whole given row, with the same given value. This method has anme overload where the grid is passed implicitly.

Attributes

final def setRowStartSame(row: Int, numOfCens: Int, tileValue: A)(implicit grid: HGrid): HCen

Sets the given row from the start of the row, 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 start of the row, 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: (HSep, A) => BB, f2: (HSep, A, A) => BB)(implicit grid: HGridSys, build: BuilderArrFlat[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def sideMap[B, BB <: Arr[B]](f1: (HSep, A) => B, f2: (HSep, A, A) => B)(implicit grid: HGrid, build: BuilderArrMap[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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep 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 HSep and the single adjacent hex tile data value and one for the inner sides of the grid that takes the HSep and the two adjacent hex tile data values.

Attributes

def spawn(parentGridSys: HGridSys)(implicit ct: ClassTag[A], childGridSys: HGridSys): LayerHcRefSys[A]

Spawns a new LayerHcRefSys data layer from this LayerHcRefSys's HGridSys to the child HGridSys, passed as implicit parameter. There is a name overload for this method that passes the child HGridSys explicitly.

Spawns a new LayerHcRefSys data layer from this LayerHcRefSys's HGridSys to the child HGridSys, passed as implicit parameter. There is a name overload for this method that passes the child HGridSys explicitly.

Attributes

Inherited methods

def apply(key: HexStruct, 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

Inherited from:
LayerHcRef
def apply(hc: HCen)(implicit key: HexStruct): 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 alternative nme overload where the HGridSys is passed explicitly as the first parameter.

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 alternative nme overload where the HGridSys is passed explicitly as the first parameter.

Attributes

Inherited from:
LayerHcRef
def arrayUnsafe: Array[A]

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

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

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

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

Attributes

Inherited from:
LayerTcRef
def hcFlatMap[BB <: Arr[_]](f: (HCen, A) => BB)(implicit grid: HexStruct, build: BuilderArrFlat[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

Inherited from:
LayerHcRef
def hcForeach[U](f: (HCen, A) => U)(implicit gSys: HexStruct): 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

Inherited from:
LayerHcRef
def hcMap[B, BB <: Arr[B]](f: (HCen, A) => B)(implicit grid: HexStruct, build: BuilderArrMap[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

Inherited from:
LayerHcRef
def hcOptFlatMap[BB <: Arr[_]](f: (HCen, A) => Option[BB])(implicit gridSys: HexStruct, build: BuilderArrFlat[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

Inherited from:
LayerHcRef
def hcOptMap[B, BB <: Arr[B]](f: (A, HCen) => Option[B])(implicit grid: HexStruct, build: BuilderArrMap[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 length of this LayerHcRefSys.

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 length of this LayerHcRefSys.

Attributes

Inherited from:
LayerHcRef
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:
LayerTcRef
def map[B, BB <: Arr[B]](f: A => B)(implicit build: BuilderArrMap[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:
LayerTcRef
final def mutSetAll(value: A): Unit

Set all tiles to the given value.

Set all tiles to the given value.

Attributes

Inherited from:
LayerTcRef
def projHCenFlatMap[BB <: Arr[_]](f: (HCen, A) => BB)(implicit key: HexStruct, proj: HSysProjection, build: BuilderArrFlat[BB]): BB

Attributes

Inherited from:
LayerHcRef
def rc(key: HexStruct, r: Int, c: Int): A

Attributes

Inherited from:
LayerHcRef
def rc(r: Int, c: Int)(implicit key: HexStruct): A

Attributes

Inherited from:
LayerHcRef
def set(r: Int, c: Int, value: A)(implicit gridSys: HexStruct): Unit

Attributes

Inherited from:
LayerHcRef
def set(hc: HCen, value: A)(implicit gridSys: HexStruct): Unit

Attributes

Inherited from:
LayerHcRef