TGrid

ostrat.prid.TGrid
trait TGrid extends TGridSys

A TileGrid is a description of an abstract TileGrid. It contains no data for the elements of any particular TileGrid. The Data for TileGrids is stored in flat arrays. The TileGrid gives the dimensions of a tileGrid. It has methods to interpret the data in flat Arrays created for that TileGrid specification. It has methods to map the elements of an Array to the the 2 dimensional geometry of the Tile Grid. On its own a TileGrid can produce the outlines of the grid, coordinates vector positions and other pure mathematical data. Combined with a simple function it can for example produce a Chess board. Combined with a 64 length array it can produce a Chess board position. For anything but the most simple games, you will probably want multiple arrays to describe the game state. The terrain for example may remain invariant, so the terrain data does not need to be reproduced with every move.

A TileGrid is for use cases where the proportions of the Grid predetermine the proportions of the visual representation, as opposed to a use case where the proportions of the enclosing space are a factor in determining the proportions of the grid. For example the various grid layouts of the Stars on the American flag.

Attributes

Graph
Supertypes
trait TGridSys
trait TCenStruct
class Object
trait Matchable
class Any
Known subtypes

Members list

Grouped members

Tile Sides Methods

Methods that operate on the tile sides of the grid. Remember a TileGrid object contains no data about the sides or the boundaries of the tiles.

final def bottomSepR: Int

The bottom, lowest or minimum Side Row of this TileGrid. The r value, the row number value.

The bottom, lowest or minimum Side Row of this TileGrid. The r value, the row number value.

Attributes

Foreachs over each inner row of Sides. Users will not normally need to use this method directly.

Foreachs over each inner row of Sides. Users will not normally need to use this method directly.

Attributes

final def numOfSepRows: Int

The number of Rows of Sides.

The number of Rows of Sides.

Attributes

def sepRowsForeach(f: Int => Unit): Unit

Foreachs over each Row of separators. Users will not normally need to use this method directly.

Foreachs over each Row of separators. Users will not normally need to use this method directly.

Attributes

final def topSepRow: Int

The top, highest or maximum Side Row of this TileGrid. The r value, the row number.

The top, highest or maximum Side Row of this TileGrid. The r value, the row number.

Attributes

Foreachs over each Row of vertices. Users will not normally need to use this method directly.

Foreachs over each Row of vertices. Users will not normally need to use this method directly.

Attributes

Value members

Abstract methods

The bottom or lowest tile centre row, r coordinate.

The bottom or lowest tile centre row, r coordinate.

Attributes

The TCenOrSep coordinate centre of this tile grid.

The TCenOrSep coordinate centre of this tile grid.

Attributes

The minimum or lowest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

The minimum or lowest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

Attributes

the Maximum or highest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

the Maximum or highest tile centre column c coordinate in the whole tile grid. This is called c rather than x because in hex grids HGrids there is not a 1 to 1 ratio from column coordinate to the x value in a Pt2.

Attributes

def leftSideC: Int

The TSep tile side, with the lowest C column coordinate. This places it on the left most points of the grid.

The TSep tile side, with the lowest C column coordinate. This places it on the left most points of the grid.

Attributes

Number of rows of tile centres. This will be different to the number of rows of sides and and will be different to the number of rows of vertices for HexGrids.

Number of rows of tile centres. This will be different to the number of rows of sides and and will be different to the number of rows of vertices for HexGrids.

Attributes

The TSep tile side, with the highest C column coordinate. This places it on the right most points of the grid.

The TSep tile side, with the highest C column coordinate. This places it on the right most points of the grid.

Attributes

def topCenR: Int

The top or highest tile centre row, r coordinate.

The top or highest tile centre row, r coordinate.

Attributes

Concrete methods

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

Foreach grid Row r coordinate.

Foreach grid Row r coordinate.

Attributes

def cCen: Int

The centre of the hex grid in terms of c column coordinates.

The centre of the hex grid in terms of c column coordinates.

Attributes

final def foldRows[B](init: B)(f: (B, Int) => B): B

foldLefts over each row number.

foldLefts over each row number.

Attributes

final def numOfVertRows: Int

The number of Rows of vertices.

The number of Rows of vertices.

Attributes

def rCen: Int

The centre of the hex grid in terms of r row coordinates.

The centre of the hex grid in terms of r row coordinates.

Attributes

final def topSepR: Int

The top or highest separator row, r coordinate.

The top or highest separator row, r coordinate.

Attributes

override def xCen: Double

The centre of this grid in the X axis. this will be equal to the cCen Int value.

The centre of this grid in the X axis. this will be equal to the cCen Int value.

Attributes

Definition Classes

Inherited methods

final def allRsFlatMap[ArrT <: Arr[_]](f: Int => ArrT)(implicit build: BuilderArrFlat[ArrT]): ArrT

flatMaps over each r row coordinate number.

flatMaps over each r row coordinate number.

Attributes

Inherited from:
TGridSys
final def allRsMap[B, BB <: Arr[B]](f: Int => B)(implicit build: BuilderArrMap[B, BB]): BB

maps over each r row coordinate number.

maps over each r row coordinate number.

Attributes

Inherited from:
TGridSys
def bottom: Double

The bottom most point in the grid where the value of y is minimum.

The bottom most point in the grid where the value of y is minimum.

Attributes

Inherited from:
TGridSys
def cenVec: Vec2

The centre point as a Vec2. Not sure why this id implemented here.

The centre point as a Vec2. Not sure why this id implemented here.

Attributes

Inherited from:
TGridSys
def fullDisplayScale(dispWidth: Double, dispHeight: Double, padding: Double): Double

Attributes

Inherited from:
TGridSys
final def height: Double

Height of the tile grid system from furthest tile edge or vertex to furthest tile edge or vertex.

Height of the tile grid system from furthest tile edge or vertex to furthest tile edge or vertex.

Attributes

Inherited from:
TGridSys
def left: Double

The left most point in the grid where x is minimum.

The left most point in the grid where x is minimum.

Attributes

Inherited from:
TGridSys
def numTiles: Int

The total number of tile centres in this tile Grid system.

The total number of tile centres in this tile Grid system.

Attributes

Inherited from:
TCenStruct
def right: Double

The right most point in the grid where the value of x is maximum.

The right most point in the grid where the value of x is maximum.

Attributes

Inherited from:
TGridSys
def top: Double

The top most point in the grid where the value of y is maximum.

The top most point in the grid where the value of y is maximum.

Attributes

Inherited from:
TGridSys
final def width: Double

Width of the tile grid system from furthest tile edge or vertex to furthest tile edge or vertex.

Width of the tile grid system from furthest tile edge or vertex to furthest tile edge or vertex.

Attributes

Inherited from:
TGridSys
def yCen: Double

The centre of this grid in the y axis. For SqGrids this will be equal to the cCen Int value, but this is not the case for HGrids.

The centre of this grid in the y axis. For SqGrids this will be equal to the cCen Int value, but this is not the case for HGrids.

Attributes

Inherited from:
TGridSys
def yRatio: Double

the ratio of r => y, when translating from TCoord tile grid coordinates to Pt2 and Vec2s.

the ratio of r => y, when translating from TCoord tile grid coordinates to Pt2 and Vec2s.

Attributes

Inherited from:
TCenStruct