HCenOptLayer

ostrat.prid.phex.HCenOptLayer
final class HCenOptLayer[A <: AnyRef](val unsafeArray: Array[A]) extends AnyVal with TCenOptLayer[A]

A HGridSys data layer of optional tile data. This is specialised for OptRef[A]. The tileGrid can map the HCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit HGridSys hex grid parameter.

Attributes

Graph
Supertypes
trait TCenOptLayer[A]
class AnyVal
trait Matchable
class Any

Members list

Concise view

Type members

Types

override type ThisT = HCenOptLayer[A]

Value members

Concrete methods

def SomesKeyMap(implicit grider: HGridSys): Map[A, HCen]
def apply(hc: HCen)(implicit grider: HGridSys): Option[A]

Indexes in to this HCenOptLayer using the tile centre coordinate, either passed as an HCen or as row and column values.

Indexes in to this HCenOptLayer using the tile centre coordinate, either passed as an HCen or as row and column values.

Attributes

def apply(r: Int, c: Int)(implicit grider: HGridSys): Option[A]

Indexes in to this HCenOptLayer using the tile centre coordinate, either passed as an HCen or as row and column values.

Indexes in to this HCenOptLayer using the tile centre coordinate, either passed as an HCen or as row and column values.

Attributes

def find(value: A)(implicit grider: HGridSys): Option[HCen]
def get(value: A)(implicit grider: HGridSys): HCen
def hcMap[B, ArrT <: Arr[B]](fNone: => HCen => B)(fSome: (A, HCen) => B)(implicit grider: HGridSys, build: ArrMapBuilder[B, ArrT]): ArrT

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Attributes

def map[B <: AnyRef](f: A => B)(implicit ct: ClassTag[B]): HCenOptLayer[B]
def noneHCMap[B, ArrB <: Arr[B]](f: HCen => B)(implicit grider: HGridSys, build: ArrMapBuilder[B, ArrB]): ArrB

Drops the Some values. Maps the corresponding HCen for the None to type B. Returns a Arr of length between 0 and the length of this HCenOptLayer.

Drops the Some values. Maps the corresponding HCen for the None to type B. Returns a Arr of length between 0 and the length of this HCenOptLayer.

Attributes

def projHcMap(proj: HSysProjection)(fNone: (Pt2, HCen) => GraphicElem)(fSome: (A, Pt2, HCen) => GraphicElem): GraphicElems

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Attributes

def projNoneHcPtMap[B, ArrB <: Arr[B]](f: (HCen, Pt2) => B)(implicit proj: HSysProjection, build: ArrMapBuilder[B, ArrB]): ArrB
def projNoneHcPtMap[B, ArrB <: Arr[B]](proj: HSysProjection)(f: (HCen, Pt2) => B)(implicit build: ArrMapBuilder[B, ArrB]): ArrB
def projSomeHCMap(f: (A, HCen) => GraphicElem)(implicit proj: HSysProjection): GraphicElems

Drops the None values mapping the Some's value with the HCen to an option value, collecting the values of the Somes returned by the function. Returns a Seqimut of length 0 to the length of this HCenOptLayer.

Drops the None values mapping the Some's value with the HCen to an option value, collecting the values of the Somes returned by the function. Returns a Seqimut of length 0 to the length of this HCenOptLayer.

Attributes

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def projSomeHcPtMap[B, ArrB <: Arr[B]](f: (A, HCen, Pt2) => B)(implicit proj: HSysProjection, build: ArrMapBuilder[B, ArrB]): ArrB

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def projSomeHcPtMap[B, ArrB <: Arr[B]](proj: HSysProjection)(f: (A, HCen, Pt2) => B)(implicit build: ArrMapBuilder[B, ArrB]): ArrB

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def setNone(hc: HCen)(implicit grider: HGridSys): HCenOptLayer[A]

Creates a new ArrOpt with the specified location set to NoRef.

Creates a new ArrOpt with the specified location set to NoRef.

Attributes

def setSome(hc: HCen, value: A)(implicit grider: HGridSys): HCenOptLayer[A]

Creates a new ArrOpt with the specified location set to the specified value.

Creates a new ArrOpt with the specified location set to the specified value.

Attributes

def someHCFlatMap[ArrT <: Arr[_]](f: (A, HCen) => ArrT)(implicit grider: HGridSys, build: ArrFlatBuilder[ArrT]): ArrT

Drops the None values flatMaps the value of the Some with the corresponding HCen to a Seqimut.

Drops the None values flatMaps the value of the Some with the corresponding HCen to a Seqimut.

Attributes

def someHCForeach(f: (A, HCen) => Unit)(implicit grider: HGridSys): Unit

Drops the None values. Foreach value of the Some with the corresponding HCen applies the side effecting parameter function.

Drops the None values. Foreach value of the Some with the corresponding HCen applies the side effecting parameter function.

Attributes

def someHCMapArr[B, ArrB <: Arr[B]](f: (A, HCen) => B)(implicit grider: HGridSys, build: ArrMapBuilder[B, ArrB]): ArrB

Drops the None values. Maps the Some's value with the corresponding HCen to value of type B. Returns a Seqimut of length between 0 and the length of this HCenOptLayer.

Drops the None values. Maps the Some's value with the corresponding HCen to value of type B. Returns a Seqimut of length between 0 and the length of this HCenOptLayer.

Attributes

def someHCOptFlatMap[ArrB <: Arr[_]](f: (A, HCen) => Option[ArrB])(implicit grider: HGridSys, build: ArrFlatBuilder[ArrB]): ArrB

Drops the None values, flatMaps the Some's value and the corresponding HCen to an option of a Arr, collects only the Some's values returned by the function.

Drops the None values, flatMaps the Some's value and the corresponding HCen to an option of a Arr, collects only the Some's values returned by the function.

Attributes

def somePairArr(implicit grider: HGridSys, build: HCenPairArrMapBuilder[A]): HCenPairArr[A]

Returns an HCenPairArr of the Some values.

Returns an HCenPairArr of the Some values.

Attributes

def tileNone(hc: HCen)(implicit grider: HGridSys): Boolean

The tile is a None at the given hex grid centre coordinate HCen.

The tile is a None at the given hex grid centre coordinate HCen.

Attributes

override def typeStr: String

Attributes

Definition Classes
def unSafeApply(hc: HCen)(implicit grider: HGridSys): A

Accesses element from Refs Arr. Only use this method where you are certain it is not null, or the consumer can deal with the null.

Accesses element from Refs Arr. Only use this method where you are certain it is not null, or the consumer can deal with the null.

Attributes

def unsafeMove(hc1: HCen, hc2: HCen)(implicit grider: HGridSys): Unit

Moves the object in the array location given by the 1st HCen to the 2nd HCen, by setting hc2 to the value of hc1 and setting hc1 to None.

Moves the object in the array location given by the 1st HCen to the 2nd HCen, by setting hc2 to the value of hc1 and setting hc1 to None.

Attributes

def unsafeMoveMod(hc1: HCen, hc2: HCen)(f: A => A)(implicit grider: HGridSys): Unit
def unsafeSetAll(value: A): Unit
def unsafeSetNone(hc: HCen)(implicit grider: HGridSys): Unit

Mutates the value ot the specified location to None.

Mutates the value ot the specified location to None.

Attributes

def unsafeSetSames(value: A, hCens: Int*)(implicit grider: HGridSys): Unit
def unsafeSetSome(r: Int, c: Int, value: A)(implicit grider: HGridSys): Unit

Sets the Some value of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Sets the Some value of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Attributes

def unsafeSetSome(hc: HCen, value: A)(implicit grider: HGridSys): Unit

Sets the Some value of the hex tile data at the specified HCen coordinate. This is an imperative mutating operation.

Sets the Some value of the hex tile data at the specified HCen coordinate. This is an imperative mutating operation.

Attributes

def unsafeSetSomes(triples: (Int, Int, A)*)(implicit grider: HGridSys): Unit

Sets the Some values of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Sets the Some values of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Attributes

def zipSomesHCMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: HCenOptLayer[B])(f: (A, B, HCen) => C)(implicit grider: HGridSys, build: ArrMapBuilder[C, ArrC]): ArrC

Uses this and a second HCenOptLayer of type B, combining corresponding pairs of Some values with the corresponding HCen and apping to a value of type C. Returns a Arr with a length between 0 and the length of the original HCenOptDGtid data grids.

Uses this and a second HCenOptLayer of type B, combining corresponding pairs of Some values with the corresponding HCen and apping to a value of type C. Returns a Arr with a length between 0 and the length of the original HCenOptDGtid data grids.

Attributes

def zipSomesMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: HCenOptLayer[B])(f: (A, B) => C)(implicit gridSys: HGridSys, build: ArrMapBuilder[C, ArrC]): ArrC

Uses this and a second HCenOptLayer of type B. Drops all values where either or both HCenOptLayer have None values. Maps the corresponding values of the Somes to type C. Returns a Arr of length bwteen 0 na d the length of the original HCenOptLayers.

Uses this and a second HCenOptLayer of type B. Drops all values where either or both HCenOptLayer have None values. Maps the corresponding values of the Somes to type C. Returns a Arr of length bwteen 0 na d the length of the original HCenOptLayers.

Attributes

Inherited methods

The length of this tile grid mapped Array of optional values.

The length of this tile grid mapped Array of optional values.

Attributes

Inherited from:
TCenOptLayer
def foldSomes[B](init: B)(f: (B, A) => B): B

Attributes

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

Attributes

Inherited from:
TCenOptLayer
def mapArr[B, ArrT <: Arr[B]](noneValue: => B)(f: A => B)(implicit build: ArrMapBuilder[B, ArrT]): ArrT

Maps the this Arr of Opt values, without their respective Hcen coordinates to an Arr of type B. This method treats the HCenArrOpt class like a standard Arr or Array. It does not utilise the grid TGrid from which this TCenOptLayer was created.

Maps the this Arr of Opt values, without their respective Hcen coordinates to an Arr of type B. This method treats the HCenArrOpt class like a standard Arr or Array. It does not utilise the grid TGrid from which this TCenOptLayer was created.

Attributes

Inherited from:
TCenOptLayer
def mapPairArr[B1, ArrB1 <: Arr[B1], B2, B <: PairNoA1ParamElem[B1, B2], ArrB <: PairNoA1PramArr[B1, ArrB1, B2, B]](noneB1: => B1, noneB2: => B2)(f1: A => B1)(f2: A => B2)(implicit build: PairArrMapBuilder[B1, ArrB1, B2, B, ArrB]): ArrB

Attributes

Inherited from:
TCenOptLayer
def mapSomes[B, ArrT <: Arr[B]](f: A => B)(implicit build: ArrMapBuilder[B, ArrT]): ArrT

Maps the Some values to type B by the parameter function. It ignores the None values. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid TGrid from which this TCenOptLayer was created.

Maps the Some values to type B by the parameter function. It ignores the None values. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid TGrid from which this TCenOptLayer was created.

Attributes

Inherited from:
TCenOptLayer

Attributes

Inherited from:
TCenOptLayer
def somesArr[ArrA <: Arr[A]](implicit build: ArrMapBuilder[A, ArrA]): ArrA

Returns an ArrBase[A] of type ArrA filtered to the Some values.

Returns an ArrBase[A] of type ArrA filtered to the Some values.

Attributes

Inherited from:
TCenOptLayer

Concrete fields

The underlying mutable backing Array. it is designated unsafe because it uses nulls for run time efficiency. End users should rarely need to access this directly.

The underlying mutable backing Array. it is designated unsafe because it uses nulls for run time efficiency. End users should rarely need to access this directly.

Attributes