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]

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

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

def apply(r: Int, c: Int)(implicit grid: HGrid): Option[A]

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

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

def find(value: A)(implicit grid: HGrid): Option[HCen]
def hcNonesMap[B, ArrB <: ArrBase[B]](f: HCen => B)(implicit grid: HGrid, build: ArrBuilder[B, ArrB]): ArrB

maps the HCen Coordinate values to type B, but only where the element is a None value. Returns an immutable Array based collection of type ArrB, the second type parameter.

maps the HCen Coordinate values to type B, but only where the element is a None value. Returns an immutable Array based collection of type ArrB, the second type parameter.

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

HCen with Some values from 2 HCenArrOpts map to type C. This only maps the values where both collections have Some values. Returns an immutable Array based collection of type ArrC, the second type parameter.

HCen with Some values from 2 HCenArrOpts map to type C. This only maps the values where both collections have Some values. Returns an immutable Array based collection of type ArrC, the second type parameter.

def hcSomesFlatMap[ArrT <: ArrBase[_]](f: (HCen, A) => ArrT)(implicit grid: HGrid, build: ArrFlatBuilder[ArrT]): ArrT

HCen with element flatMap, but only coordinates where there some value. Maps and flattens each HCen coordinate with its associated element of type A. It ignores the None values. 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 element flatMap, but only coordinates where there some value. Maps and flattens each HCen coordinate with its associated element of type A. It ignores the None values. 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.

def hcSomesForeach(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 hcSomesMap[B, ArrB <: ArrBase[B]](f: (HCen, A) => B)(implicit grid: HGrid, build: ArrBuilder[B, ArrB]): ArrB

HCen with Some map. 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.

HCen with Some map. 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 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 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 some2sMap[B <: AnyRef, C, ArrC <: ArrBase[C]](optArrB: HCenArrOpt[B])(f: (A, B) => C)(implicit grid: HGrid, build: ArrBuilder[C, ArrC]): ArrC

Maps the Somes of this HCenArrOpt and the Some values of a second HCenArrOpt. 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 HCenArrOpt. Returns an immutable Array based collection of type ArrC, the second type parameter.

def somesArr[ArrA <: ArrBase[A]](implicit build: ArrBuilder[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.

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]