SqCenOptLayer

ostrat.prid.psq.SqCenOptLayer
final class SqCenOptLayer[A <: AnyRef](val unsafeArray: Array[A]) extends AnyVal with TCenOptDGrid[A]

A layer of immutable optional SqCen data for a SqGridSys square grid system, This is specialised for OptRef[A]. The tileGrid can map the SqCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit SqGridSys square grid system parameter.

Attributes

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

Members list

Concise view

Value members

Concrete methods

def keyMap(implicit gridSys: SqGridSys): Map[A, SqCen]
def mutMove(s1: SqCen, s2: SqCen)(implicit gridSys: SqGridSys): Unit

Moves the object in the array location given by HCen1 to HCen2, by setting H2 to the value of h1 and setting H1 to null.

Moves the object in the array location given by HCen1 to HCen2, by setting H2 to the value of h1 and setting H1 to null.

Attributes

def projNoneScPtMap[B, ArrB <: Arr[B]](f: (SqCen, Pt2) => B)(implicit proj: SqSysProjection, build: ArrMapBuilder[B, ArrB]): ArrB

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def projNoneScPtMap[B, ArrB <: Arr[B]](proj: SqSysProjection)(f: (SqCen, Pt2) => B)(implicit build: ArrMapBuilder[B, ArrB]): ArrB

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def projSomeScPtMap[B, ArrB <: Arr[B]](f: (A, SqCen, Pt2) => B)(implicit proj: SqSysProjection, build: ArrMapBuilder[B, ArrB]): ArrB

Drops the None values mapping the Some's value with the SqCen 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 SqCenOptLayer.

Drops the None values mapping the Some's value with the SqCen 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 SqCenOptLayer.

Attributes

def projSomeScPtMap[B, ArrB <: Arr[B]](proj: SqSysProjection)(f: (A, SqCen, Pt2) => B)(implicit build: ArrMapBuilder[B, ArrB]): ArrB
def scNoneMap[B, ArrT <: Arr[B]](f: SqCen => B)(implicit gridSys: SqGridSys, build: ArrMapBuilder[B, ArrT]): ArrT

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def scSomesMap[B, ArrB <: Arr[B]](f: (SqCen, A) => B)(implicit gridSys: SqGridSys, build: ArrMapBuilder[B, ArrB]): ArrB

SqCen with Some map. Maps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

SqCen with Some map. Maps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def scSomesMapPair[B1, ArrB1 <: Arr[B1], B2, B <: ElemPair[B1, B2], ArrB <: PairArr[B1, ArrB1, B2, B]](f1: (SqCen, A) => B1)(f2: (SqCen, A) => B2)(implicit gridSys: SqGridSys, build: PairArrMapBuilder[B1, ArrB1, B2, B, ArrB]): ArrB
def setNone(hc: SqCen)(implicit gridSys: SqGridSys): SqCenOptLayer[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(r: Int, c: Int, value: A)(implicit gridSys: SqGridSys): SqCenOptLayer[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 setSome(sc: SqCen, value: A)(implicit gridSys: SqGridSys): SqCenOptLayer[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 some2sMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: SqCenOptLayer[B])(f: (A, B) => C)(implicit gridSys: SqGridSys, build: ArrMapBuilder[C, ArrC]): ArrC

Maps the Somes of this HCenArrOpt and the Some values of a second SqCenOptLayer. Returns an immutable Array based collection of type ArrC, the second type parameter.

Maps the Somes of this HCenArrOpt and the Some values of a second SqCenOptLayer. Returns an immutable Array based collection of type ArrC, the second type parameter.

Attributes

def someSCOptFlatMap[ArrB <: Arr[_]](f: (A, SqCen) => Option[ArrB])(implicit grider: SqGridSys, 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 someScForeach(f: (SqCen, A) => Unit)(implicit gridSys: SqGridSys): Unit

coordinate-foreach-Some. Foreach Some element and its associated SqCen coordinate applies the side effecting parameter function. It ignores the None values.

coordinate-foreach-Some. Foreach Some element and its associated SqCen coordinate applies the side effecting parameter function. It ignores the None values.

Attributes

def somesForeach(f: A => Unit)(implicit gridSys: SqGridSys): Unit
def tileNone(sc: SqCen)(implicit gridSys: SqGridSys): 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

def unSafeApply(sc: SqCen)(implicit gridSys: SqGridSys): 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(sc1: SqCen, sc2: SqCen)(implicit gridSys: SqGridSys): Unit

Moves the object in the array location given by the 1st SqCen to the 2nd SqCen, by setting sc2 to the value of sc1 and setting sc1 to None.

Moves the object in the array location given by the 1st SqCen to the 2nd SqCen, by setting sc2 to the value of sc1 and setting sc1 to None.

Attributes

def unsafeSetSome(r: Int, c: Int, value: A)(implicit gridSys: SqGridSys): Unit

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

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

Attributes

def unsafeSetSome(sc: SqCen, value: A)(implicit gridSys: SqGridSys): Unit

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

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

Attributes

def unsafeSetSomes(triples: (Int, Int, A)*)(implicit gridSys: SqGridSys): 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

Inherited methods

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

Attributes

Inherited from:
TCenOptDGrid
def length: Int

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:
TCenOptDGrid
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 TCenOptDGrid 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 TCenOptDGrid was created.

Attributes

Inherited from:
TCenOptDGrid
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 TCenOptDGrid 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 TCenOptDGrid was created.

Attributes

Inherited from:
TCenOptDGrid

Attributes

Inherited from:
TCenOptDGrid
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:
TCenOptDGrid

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