HCenArrOpt

final
class HCenArrOpt[A <: AnyRef](val unsafeArr: Array[A]) extends AnyVal with TileArrOpt[A]

An immutable Arr of Opt Tile data for a specific hex tile grid HGrid. 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 HGrid hex grid parameter.

trait TileArrOpt[A]
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def apply(hc: HCen)(implicit grid: HGrid): Option[A]
def apply(r: Int, c: Int)(implicit grid: HGrid): Option[A]
def find(value: A)(implicit grid: HGrid): Option[HCen]
def flatMapHCenSomes[ArrT <: ArrBase[_]](f: (HCen, A) => ArrT)(implicit grid: HGrid, build: ArrFlatBuilder[ArrT]): ArrT

Coordinate flatMap Somes. Maps and flattens each Some element with its associated HCen coordinate. It ignores the None values.

Coordinate flatMap Somes. Maps and flattens each Some element with its associated HCen coordinate. It ignores the None values.

def foreachHCenSome(f: (HCen, A) => Unit)(implicit grid: HGrid): Unit

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

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

def keyMap(implicit grid: HGrid): Map[A, HCen]
def mapHCen[B, ArrT <: ArrBase[B]](fNone: => HCen => B)(fSome: (HCen, A) => B)(implicit grid: HGrid, build: ArrBuilder[B, ArrT]): ArrT

Coordinate-map. Maps the this Arr of Opt values, with their respective HCen coordinates to an Arr of type B.

Coordinate-map. Maps the this Arr of Opt values, with their respective HCen coordinates to an Arr of type B.

def mapHCenNones[B, ArrT <: ArrBase[B]](f: HCen => B)(implicit grid: HGrid, build: ArrBuilder[B, ArrT]): ArrT

Coordinate map Nones. Map the None values respective HCen coordinates of this HCenArrOpt 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 HCen coordinates of this HCenArrOpt to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

def mapHCenSomes[B, ArrT <: ArrBase[B]](f: (HCen, A) => B)(implicit grid: HGrid, build: ArrBuilder[B, ArrT]): ArrT

Coordinate map Somes. map the Some values of this HcenArrOpt, with the respective HCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Somes. map the Some values of this HcenArrOpt, with the respective HCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

def mapHCenSomes2[B <: AnyRef, C, ArrT <: ArrBase[C]](optArrB: HCenArrOpt[B])(f: (HCen, A, B) => C)(implicit grid: HGrid, build: ArrBuilder[C, ArrT]): ArrT

Coordinate map Somes. map the some values of this HcenArrOpt, with the respective Hcen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Somes. map the some values of this HcenArrOpt, with the respective Hcen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

def mapSomes2[B <: AnyRef, C, ArrT <: ArrBase[C]](optArrB: HCenArrOpt[B])(f: (A, B) => C)(implicit grid: HGrid, build: ArrBuilder[C, ArrT]): ArrT

Coordinate map the Somes of this HCenArrOpt and the Some values of a second HCenArrOpt. Map the some values of this HcenArrOpt, with the respective Hcen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map the Somes of this HCenArrOpt and the Some values of a second HCenArrOpt. Map the some values of this HcenArrOpt, with the respective Hcen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

def setNone(hc: HCen)(implicit grid: HGrid): HCenArrOpt[A]

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

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

def setSome(hc: HCen, value: A)(implicit grid: HGrid): HCenArrOpt[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.

def somesArr[ArrT <: ArrBase[A]](implicit build: ArrBuilder[A, ArrT]): ArrT

Returns an Arr filtered to the Some values.

Returns an Arr filtered to the Some values.

def tileNone(hc: HCen)(implicit grid: HGrid): 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.

def unSafeApply(hc: HCen)(implicit grid: HGrid): 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.

def unsafeMove(hc1: HCen, hc2: HCen)(implicit grid: HGrid): 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.

def unsafeSetAll(value: A): Unit
def unsafeSetNone(hc: HCen)(implicit grid: HGridReg): Unit

Mutates the value ot the specified location to None.

Mutates the value ot the specified location to None.

def unsafeSetSome(r: Int, c: Int, value: A)(implicit grid: HGrid): 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.

def unsafeSetSome(hc: HCen, value: A)(implicit grid: HGrid): 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.

def unsafeSetSomes(triples: (Int, Int, A)*)(implicit grid: HGrid): 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.

Inherited methods

def foldSomes[B](init: B)(f: (B, A) => B): B
Inherited from
TileArrOpt
def length: Int
Inherited from
TileArrOpt
def map[B, ArrT <: ArrBase[B]](noneValue: => B)(f: A => B)(implicit build: ArrBuilder[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 TileArrOpt 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 TileArrOpt was created.

Inherited from
TileArrOpt
def mapSomes[B, ArrT <: ArrBase[B]](f: A => B)(implicit build: ArrBuilder[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 TileArrOpt 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 TileArrOpt was created.

Inherited from
TileArrOpt
def numSomes: Int
Inherited from
TileArrOpt

Concrete fields

val unsafeArr: Array[A]