PolygonHC

final class PolygonHC(val unsafeArray: Array[Int]) extends AnyVal with PolygonInt2s[HCoord]

A polygon with the vertices defined by hex tile coordinates HCoords.

Companion:
object
class AnyVal
trait Matchable
class Any

Type members

Types

override type SideT = LineSegHC
override type ThisT = PolygonHC

Value members

Concrete methods

def circularIndex(inp: Int): Int

This applies the index value in a circular manner. So the 6th index of a Hexagon is applied at vertex 0, 7 at 1 and -1 at 5.

This applies the index value in a circular manner. So the 6th index of a Hexagon is applied at vertex 0, 7 at 1 and -1 at 5.

def combine(operand: PolygonHC): Option[PolygonHC]
override def dataElem(i1: Int, i2: Int): HCoord
Definition Classes
override def fElemStr: HCoord => String
Definition Classes
override def sidesForeach[U](f: LineSegHC => U): Unit
Definition Classes
override def typeStr: String
Definition Classes
override def unsafeFromArray(array: Array[Int]): PolygonHC
Definition Classes
override def vert(index: Int): HCoord

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

Definition Classes
def vertNum: Int
override def vertsFold[B](init: B)(f: (B, HCoord) => B): B
Definition Classes
override def vertsForeach[U](f: HCoord => U): Unit

Performs the side effecting function on the HCoord value of each vertex.

Performs the side effecting function on the HCoord value of each vertex.

Definition Classes
override def vertsIForeach[U](f: (Int, HCoord) => Any): Unit
Definition Classes
override def vertsMap[B, ArrB <: SeqImut[B]](f: HCoord => B)(implicit builder: ArrBuilder[B, ArrB]): ArrB
Definition Classes
override def vertsPrevForEach[U](f: (HCoord, HCoord) => U): Unit

This method does nothing if the vertNum < 2. Foreach vertex applies the side effecting function to the previous vertex with each vertex. The previous vertex to the first vertex is the last vertex of the PolygonLike. Note the function signature (previous, vertex) => U follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods'(accumulator, element) => B signature.

This method does nothing if the vertNum < 2. Foreach vertex applies the side effecting function to the previous vertex with each vertex. The previous vertex to the first vertex is the last vertex of the PolygonLike. Note the function signature (previous, vertex) => U follows the foreach based convention of putting the collection element 2nd or last as seen for example in fold methods'(accumulator, element) => B signature.

Definition Classes

Inherited methods

def arrLen: Int

The length of the Array[Int] backing array.

The length of the Array[Int] backing array.

Inherited from:
DataIntNs
def dataFold[B](initVal: B)(f: (B, HCoord) => B): B
Inherited from:
DataGen
def dataForeach[U](f: HCoord => U): Unit

Performs a side effecting function on each element of this sequence in order.

Performs a side effecting function on each element of this sequence in order.

Inherited from:
DataGen
def dataIForeach[U](initIndex: Int)(f: (Int, HCoord) => U): Unit

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. 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.

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. 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.

Inherited from:
DataGen
def dataIForeach[U](f: (Int, HCoord) => Any): Unit

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. 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.

Index with foreach on the data elements. Performs a side effecting function on the index and each element of the data sequence. It takes a function as a parameter. The function may return Unit. If it does return a non Unit value it is discarded. The [U] type parameter is there just to avoid warnings about discarded values and can be ignored by method users. The method has 2 versions / name overloads. The default start for the index is 0 if just the function parameter is passed. The second version name overload takes an Int for the first parameter list, to set the start value of the index. 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.

Inherited from:
DataGen
Inherited from:
DataGen
final override def dataLength: Int

The number of product elements in this collection. For example in a [[PolygonImp], this is the number of Pt2s in the Polygon

The number of product elements in this collection. For example in a [[PolygonImp], this is the number of Pt2s in the Polygon

Definition Classes
Inherited from:
DataValueNs
def dataLengthStr: String

Just a handy short cut to give the length of this collection as a string.

Just a handy short cut to give the length of this collection as a string.

Inherited from:
DataGen
def dataMap[B, ArrB <: SeqImut[B]](f: HCoord => B)(implicit ev: ArrBuilder[B, ArrB]): ArrB

Specialised map to an immutable SeqImut of B. For SeqGen dataMap is the same as map, but for other structures it will be different, for example a PolygonLike will map to another PolgonLike.

Specialised map to an immutable SeqImut of B. For SeqGen dataMap is the same as map, but for other structures it will be different, for example a PolygonLike will map to another PolgonLike.

Inherited from:
DataGen
def dataTailForeach[U](f: HCoord => U): Unit

Foreachs over the tail of the data sequence.

Foreachs over the tail of the data sequence.

Inherited from:
DataGen
def dataTailfold[B](initial: B)(f: (B, HCoord) => B): B

foldLeft over the tail of the data sequence.

foldLeft over the tail of the data sequence.

Inherited from:
DataGen
override def elemProdSize: Int
Definition Classes
Inherited from:
DataInt2s
final def elemsStr: String

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

The element String allows the composition of toString for the whole collection. The syntax of the output will be reworked.

Inherited from:
DataGen
final override def indexData(index: Int): HCoord
Definition Classes
Inherited from:
DataInt2s
def map[B <: ElemValueN, BB <: PolygonLike[B]](f: HCoord => B)(implicit build: PolygonBuilder[B, BB]): BB

Map this collection of data elements to PolygonLike class of type BB.

Map this collection of data elements to PolygonLike class of type BB.

Inherited from:
PolygonLike
override def reverseData: ThisT
Definition Classes
Inherited from:
DataIntNs
final override def toString: String
Definition Classes
DataGen -> Any
Inherited from:
DataGen
final override def unsafeSameSize(length: Int): ThisT

Method for creating a new Array[Int] backed collection class of this collection class's final type.

Method for creating a new Array[Int] backed collection class of this collection class's final type.

Definition Classes
Inherited from:
DataIntNs
final override def unsafeSetElem(index: Int, elem: HCoord): Unit
Definition Classes
Inherited from:
DataInt2s
def unsafeSetElems(index: Int, elems: HCoord*): Unit

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Sets / mutates elements in the Arr. This method should rarely be needed by end users, but is used by the initialisation and factory methods.

Inherited from:
DataGen
def vertsForAll(f: HCoord => Boolean): Boolean

This method should be overridden in final classes.

This method should be overridden in final classes.

Inherited from:
PolygonLike
def vertsMin3: Boolean

Checks this polygon has at least 3 vertices.

Checks this polygon has at least 3 vertices.

Inherited from:
PolygonLike
override def vertsNum: Int
Definition Classes
Inherited from:
PolygonValueN

Concrete fields

val unsafeArray: Array[Int]