ostrat.prid

package ostrat.prid

The tile grid package, replacing the old pGrid package. This package works with hexagonal and Square tile grids. There are separate class for the different types of Coordinates HCen, SqCen, HSide, etc. The tile objects themselves will not in the general case the contain grid coordinates, although it may be necessary to include this data for complex tile values interacting with their wider environment. Its fundamental components are the grid data itself. This is just a linear array of tile data. Compile-time typed grid data. So for example a chess board can be represented by a 64 element Arr, its context determines that it is to be interpreted as an 8 by 8 square grid. Grid descriptions that describe the grid representation in the Array and GridFunctions which implement Cood to T. The grid and grid-gui hierarchies currently contain a mix of new and old systems.

The package name prid, short for package grid, was chosen to allow you to use the name "grid" in your code.

Attributes

Members list

Concise view

Type members

Classlikes

implicit class GridSlateScaleExtension[T](value: T)(implicit grid: TGrid, evSlate: Slate[T], evScale: Scale[T])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

The state of a simultaneous turn tile grid scenario.

The state of a simultaneous turn tile grid scenario.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait DLessScen
object DLessScen1.type
object DLessScen2.type
trait H1Scen
object G1HScen1.type
object G1HScen10.type
object G1HScen2.type
object G1HScen3.type
object G1HScen4.type
object G1HScen7.type
object G1HScen8.type
object G1HScen9.type
trait G2HScen
object G2HScen1.type
object G2HScen2.type
object G2HScen3.type
object G2HScen4.type
trait BCScen
object BCScen1.type
object BCScen2.type
trait CivScen
object Civ1.type
object Civ2.type
trait NapScen
object NapScen1.type
object NapScen2.type
trait WW1Scen
object WW1Scen1.type
object WW1Scen2.type
trait WW2Scen
object WW2Scen1.type
object WW2Scen2.type
trait ZugScen
object Zug1.type
object Zug2.type
object Zug3.type
trait G1SqScen
object G1S1Scen1.type
object G1S1Scen2.type
trait ChessScen
object ChessStart.type
object DraughtsStart.type
trait TCen extends TCenOrSide

A tile centre coordinate.

A tile centre coordinate.

Attributes

Graph
Supertypes
trait TCoord
trait Int2Elem
trait IntNElem
trait SpecialT
trait Show2[Int, Int]
trait TypeStr2[Int, Int]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait Point
class Any
Known subtypes
class HCen
class SqCen
trait TCenLayer[A <: AnyRef] extends RefsSeqLike[A]

An Array of tile centre data of type A. An appropriate SqGrid or HGrid is required to utilise its functionality.

An Array of tile centre data of type A. An appropriate SqGrid or HGrid is required to utilise its functionality.

Attributes

Graph
Supertypes
trait RefsSeqLike[A]
trait SeqLike[A]
class Any
Known subtypes
class HCenLayer[A]
class SqCenLayer[A]
trait TCenOptLayer[A <: AnyRef]

An efficient immutable array of optional values mapped to a TGridSys tile grid.

An efficient immutable array of optional values mapped to a TGridSys tile grid.

Attributes

Graph
Supertypes
class Any
Known subtypes
class HCenOptLayer[A]
class SqCenOptLayer[A]
trait TCenOrSide extends TCoord

A tile centre or a tile side coordinate.

A tile centre or a tile side coordinate.

Attributes

Graph
Supertypes
trait TCoord
trait Int2Elem
trait IntNElem
trait SpecialT
trait Show2[Int, Int]
trait TypeStr2[Int, Int]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait Point
class Any
Known subtypes
trait TCen
class HCen
class SqCen
trait TSide
class HSide
class SqSide
trait TCoord extends Point with ShowElemInt2

A coordinate in a tile grid TGrid. The row is the first field, the column is the second.

A coordinate in a tile grid TGrid. The row is the first field, the column is the second.

Attributes

Companion:
object
Graph
Supertypes
trait Int2Elem
trait IntNElem
trait SpecialT
trait Show2[Int, Int]
trait TypeStr2[Int, Int]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait Point
class Any
Known subtypes
trait TCen
class HCen
class SqCen
trait TSide
class HSide
class SqSide
trait TVert
trait HCoord
trait HNotVert
class HVert
trait SqCoord
class SqVert
object TCoord

Companion object for TCoord trait will contain a Show[TCoord] implicit instance in Scala 3, but this produces an error in 2.13.5.

Companion object for TCoord trait will contain a Show[TCoord] implicit instance in Scala 3, but this produces an error in 2.13.5.

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TCoord.type
trait TDirn extends Int1Elem

A tile direction can be used for a tile step.

A tile direction can be used for a tile step.

Attributes

Graph
Supertypes
trait Int1Elem
trait IntNElem
trait SpecialT
class Any
Known subtypes
trait HStep
object HStepUL.type
object HexDL.type
object HexDR.type
object HexLt.type
object HexRt.type
object HexUR.type
object SqDn.type
object SqLt.type
object SqRt.type
object SqUp.type
trait SqDirn
object SqDL.type
object SqDR.type
object SqUL.type
object SqUR.type
trait TDirnSided extends TDirn

A tile direction with a tile side.

A tile direction with a tile side.

Attributes

Graph
Supertypes
trait TDirn
trait Int1Elem
trait IntNElem
trait SpecialT
class Object
trait Matchable
class Any
Known subtypes
trait HStep
object HStepUL.type
object HexDL.type
object HexDR.type
object HexLt.type
object HexRt.type
object HexUR.type
object SqDn.type
object SqLt.type
object SqRt.type
object SqUp.type
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 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
class Any
Known subtypes
trait TGridMulti extends TGridSys

A tile grid system consisting of multiple tile grids.

A tile grid system consisting of multiple tile grids.

Attributes

Graph
Supertypes
trait TGridSys
class Object
trait Matchable
class Any
Known subtypes
object Grids160S0E1.type
object Grids160S11E1.type
object Grids160S4E5.type
object Grids320ChinaJapan.type
object Grids320S0E1.type
object Grids320S0E11.type
object Grids320S10E5.type
object Grids320S11E2.type
object Grids320S8E10.type
object GridsNCanada.type
object Grids80s0e1.type
trait TGridSys

A system of tile grids. Can be a single tile grid or a system of multiple tile grids.

A system of tile grids. Can be a single tile grid or a system of multiple tile grids.

Attributes

Graph
Supertypes
class Any
Known subtypes
abstract class TGridSysGui(title: String) extends CmdBarGui

Attributes

Graph
Supertypes
class CmdBarGui
class Object
trait Matchable
class Any
Known subtypes
class DLessGui
class G1HGui
class GThreeGui
class G2HGui
class BC305Gui
class CivGui
class NapGui
class WW1Gui
class WW2Gui
class ZugGui
class SqSysGui
class G1SGui
class GoGui
trait TSide extends TCenOrSide

A tile side coordinate.

A tile side coordinate.

Attributes

Graph
Supertypes
trait TCoord
trait Int2Elem
trait IntNElem
trait SpecialT
trait Show2[Int, Int]
trait TypeStr2[Int, Int]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait Point
class Any
Known subtypes
class HSide
class SqSide

Tile system graphical projection.

Tile system graphical projection.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait TVert extends TCoord

A tile vertex coordinate.

A tile vertex coordinate.

Attributes

Graph
Supertypes
trait TCoord
trait Int2Elem
trait IntNElem
trait SpecialT
trait Show2[Int, Int]
trait TypeStr2[Int, Int]
trait TypeStrN
trait ShowN
trait ShowDec
trait Show
trait TypeStr
trait Point
class Any

Implicits

Implicits

final implicit def GridSlateScaleExtension[T](value: T)(implicit grid: TGrid, evSlate: Slate[T], evScale: Scale[T]): GridSlateScaleExtension[T]