TileGridAncient

trait TileGridAncient[TileT <: TileAncient, SideT <: TileSideAncient]

A Tile grid that contains both values for the tiles and the tile boundaries or sides. Rivers, straits, walls, doors, windows ditches and fortifications are examples of values commonly assigned to tile sides.

A tileGrid is a collection of tiles, either hexs or squares. This is a fundamental trait. It is a specific case of a tiled area. I have reached the conclusion that the general case of completely irregular tiling, while interesting mathematically and useful for say representing a historical game like "Risk", has insufficient utility for the representations we want today. Tile rids can however be fully regular or partly irregular such as the grids for covering the Earth's surface. Grids can be simple just consisting of values for the tiles or complex containing values for the tiles and the tile sides. Rivers, straits, walls, ditches are examples of values commonly assigned to tile sides.

It is stored in an underlying array. It consists of a sequence of contiguous rows of tiles. Each row of tiles is itself contiguous, There are no breaks between the first tile of the row and the last tile of the row although a row can consist of a single tile. Every row shares at least one tile side with the row above and below. The grid includes all the sides of the tiles including the sides on the outer edges of the grid. This means to link two grids requires a Grid Bridge class.

class Object
trait Matchable
class Any
class HexGridAncient[TileT, SideT]
class HexGridIrrAncient[TileT, SideT]
class EGridAncient[TileT, SideT]
class EGrid80KmAncient[TileT, SideT]
class EGFarNorth[TileT, SideT]
class EGNorth[TileT, SideT]

Value members

Abstract methods

def adjTileCoodsOfTile(tileCood: Cood): Coods

Warning implementations need modification.

Warning implementations need modification.

def coodIsSide(x: Int, y: Int): Unit

Throws exception if Cood is not a valid Tile coordinate

Throws exception if Cood is not a valid Tile coordinate

def coodIsTile(x: Int, y: Int): Unit

Throws exception if Cood is not a valid Tile coordinate

Throws exception if Cood is not a valid Tile coordinate

def evSide: ClassTag[SideT]
def evTile: ClassTag[TileT]
@inline
def foreachSidesXYAll(f: (Int, Int) => Unit): Unit

For all Sides call side effecting function on the Tile side's XY Cood.

For all Sides call side effecting function on the Tile side's XY Cood.

def optTile(x: Int, y: Int): Option[TileT]
def rowForeachTilesXY(y: Int, xStart: Int, xEnd: Int, f: (Int, Int) => Unit): Unit

For each Tile's XY in part of a row.

For each Tile's XY in part of a row.

def rowTileXEnd(y: Int): Int
def rowTileXStart(y: Int): Int
def setTileRect[A](xFrom: Int, xTo: Int, yFrom: Int, yTo: Int, tileValue: A)(implicit f: (Int, Int, A) => TileT): Unit
def sideCoodsOfTile(tileCood: Cood): Coods
def sideNum: Int
def sidesTileCoods(x: Int, y: Int): (Cood, Cood)

Returns the 2 Coods for the Tile centres adjacent to the side.

Returns the 2 Coods for the Tile centres adjacent to the side.

def tileDestinguish[A](cood: Cood, v1: A, v2: A, v3: A, v4: A): A
def tileNum: Int
def turnNum: Int
def vertCoodLineOfSide(x: Int, y: Int): CoodLine
def vertCoodsOfTile(tileCood: Cood): Coods
def xArrLen: Int
def xSideMax: Int
def xSideMin: Int
def xStep: Int
def xTileMax: Int
def xTileMin: Int
def yArrLen: Int
def yTileMax: Int
def yTileMin: Int

Concrete methods

final
def arrLen: Int
final
def coodIsSide(cood: Cood): Unit

Throws exception if Cood is not a valid Tile coordinate

Throws exception if Cood is not a valid Tile coordinate

final
def coodIsTile(cood: Cood): Unit

Throws exception if Cood is not a valid Tile coordinate

Throws exception if Cood is not a valid Tile coordinate

final
def coodToInd(cood: Cood): Int
def copyTile(oldGrid: TileGridAncient[TileT, _], cood: Cood): Unit
def fSetSide[A](x: Int, y: Int, value: A)(implicit f: (Int, Int, A) => SideT): Unit
def fSetTile[A](cood: Cood, value: A)(implicit fTile: (Int, Int, A) => TileT): Unit
def fSetTile[A](x: Int, y: Int, value: A)(implicit fTile: (Int, Int, A) => TileT): Unit
def foreachSideCoodPDMapAll[A <: ElemValueN, M <: ArrValueNs[A]](f: Cood => A)(implicit ev: DataValueNsPersist[A, M]): M
@inline
final
def foreachSidesCoodAll(f: Cood => Unit): Unit

For all Sides call side effecting function on the Tile side's Cood.

For all Sides call side effecting function on the Tile side's Cood.

@inline
final
def foreachTileAll(f: TileT => Unit): Unit

For all Tiles call side effecting function on the Tile.

For all Tiles call side effecting function on the Tile.

final
def foreachTileRowAll(f: Int => Unit): Unit

For each tile row, perform side effecting method.

For each tile row, perform side effecting method.

@inline
final
def foreachTilesCoodAll(f: Cood => Unit): Unit

For all Tiles call side effecting function on the Tile's Cood.

For all Tiles call side effecting function on the Tile's Cood.

@inline
final
def foreachTilesXYAll(f: (Int, Int) => Unit): Unit

For all Tiles call side effecting function on the Tile's XY Cood.

For all Tiles call side effecting function on the Tile's XY Cood.

def getSide(x: Int, y: Int): SideT
def getSide(tc: Cood): SideT
def getTile(x: Int, y: Int): TileT
def getTile(tc: Cood): TileT
def modTilesAll(f: TileT => Unit, xys: (Int, Int)*): Unit
def numTileRow: Int
def optSidesTiles(x: Int, y: Int): (Option[TileT], Option[TileT])
final
def optSidesTiles(cood: Cood): (Option[TileT], Option[TileT])
final
def optTile(cood: Cood): Option[TileT]
final
def rowForeachTileAll(y: Int)(f: TileT => Unit): Unit
final
def rowForeachTilesXYAll(y: Int)(f: (Int, Int) => Unit): Unit

For each Tile's XY in the whole of the row.

For each Tile's XY in the whole of the row.

final
def setRow[A](cood: Cood, tileValues: Multiple[A]*)(implicit f: (Int, Int, A) => TileT): Cood

Set tile row from the Cood.

Set tile row from the Cood.

final
def setRow[A](yRow: Int, xStart: Int, tileValues: Multiple[A]*)(implicit f: (Int, Int, A) => TileT): Cood

Note set Row starts with the y (row) parameter.

Note set Row starts with the y (row) parameter.

final
def setRowBack[A](yRow: Int, xStart: Int, tileMakers: Multiple[A]*)(implicit f: (Int, Int, A) => TileT): Cood

Note set RowBack starts with the y (row) parameter

Note set RowBack starts with the y (row) parameter

final
def setRowBack[A](cood: Cood, tileValues: Multiple[A]*)(implicit f: (Int, Int, A) => TileT): Cood
def setSide(x: Int, y: Int, side: SideT): Unit
def setSide(sc: Cood, side: SideT): Unit
final
def setSideCollection[A](coods: Coods, value: A)(implicit f: (Int, Int, A) => SideT): Unit

Sets a Coods collection of Side Cood to the same value.

Sets a Coods collection of Side Cood to the same value.

final
def setSidesAll[A](value: A)(implicit fA: (Int, Int, A) => SideT): Unit
def setTile(x: Int, y: Int, value: TileT): Unit
def setTile(cood: Cood, value: TileT): Unit
final
def setTiles[A](bottomLeft: Cood, topRight: Cood, tileValue: A)(implicit f: (Int, Int, A) => TileT): Unit
final
def setTilesAll[A](value: A)(implicit fTile: (Int, Int, A) => TileT): Unit
final
def sideArrLen: Int
@inline
final
final
def tileCoodsFoldAll[R](f: Cood => R, fSum: (R, R) => R)(emptyVal: R): R
final
final
def tilesCoodFlatMapListAll[B](f: Cood => List[B]): List[B]

FlatMap all tiles' Cood to a List[B].

FlatMap all tiles' Cood to a List[B].

final
def tilesCoodMapListAll[B](f: Cood => B): List[B]

Map all tiles' Cood to a List[B].

Map all tiles' Cood to a List[B].

def tilesFlatMapAll[B, BB <: ArrBase[B]](f: TileT => BB)(implicit build: ArrBuilder[B, BB]): BB
def tilesFlatMapListAll[R : ClassTag](f: TileT => List[R]): List[R]

Map all Tiles to an List with function and flatten into Single List.

Map all Tiles to an List with function and flatten into Single List.

final
def tilesFoldAll[R](f: TileT => R, fSum: (R, R) => R)(emptyVal: R): R

Folds All tiles.

Folds All tiles.

final
def tilesMapAll[B, BB <: ArrBase[B]](f: TileT => B)(implicit build: ArrBuilder[B, BB]): BB

Map all Tiles to Array[B] with function.

Map all Tiles to Array[B] with function.

final
def tilesMapListAll[A](f: TileT => A): List[A]
final
def tilesMapOptionAll[A, AA <: ArrBase[A]](f: TileT => Option[A])(implicit build: ArrBuilder[A, AA]): AA
final
def tilesMapOptionListAll[A](f: TileT => Option[A]): List[A]
final
def tilesXYMapListAll[B](f: (Int, Int) => B): List[B]

Map all tiles' XY Cood to List.

Map all tiles' XY Cood to List.

final
def xSideArrLen: Int
final
def xSideToInd(x: Int): Int
final
def xToInd(x: Int): Int
def xySideToInd(x: Int, y: Int): Int
def xyToInd(x: Int, y: Int): Int
final
def ySideArrLen: Int
final
def ySideMax: Int
final
def ySideMin: Int
final
def ySideToInd(y: Int): Int
final
def yToInd(y: Int): Int

Abstract fields

val arr: Array[TileT]
val sideArr: Array[SideT]
val xRatio: Double