grid-7.8.14: Tools for working with regular grids (graphs, lattices).

Copyright(c) Amy de Buitléir 2012-2019
LicenseBSD-style
Maintaineramy@nualeargais.ie
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Math.Geometry.Grid

Contents

Description

A regular arrangement of tiles. Grids have a variety of uses, including games and self-organising maps. The userguide is available at https://github.com/mhwombat/grid/wiki.

In this package, tiles are called "triangular", "square", etc., based on the number of neighbours they have. For example, a square tile has four neighbours, and a hexagonal tile has six. There are only three regular polygons that can tile a plane: triangles, squares, and hexagons. Of course, other plane tilings are possible if you use irregular polygons, or curved shapes, or if you combine tiles of different shapes.

When you tile other surfaces, things get very interesting. Octagons will tile a hyperbolic plane. (Alternatively, you can think of these as squares on a board game where diagonal moves are allowed.)

For a board game, you probably want to choose the grid type based on the number of directions a player can move, rather than the number of sides the tile will have when you display it. For example, for a game that uses square tiles and allows the user to move diagonally as well as horizontally and vertically, consider using one of the grids with octagonal tiles to model the board. You can still display the tiles as squares, but for internal calculations they are octagons.

NOTE: Version 6.0 moved the various grid flavours to sub-modules.

NOTE: Version 4.0 uses associated (type) synonyms instead of multi-parameter type classes.

NOTE: Version 3.0 changed the order of parameters for many functions. This makes it easier for the user to write mapping and folding operations.

Synopsis

Example

Create a grid.

ghci> let g = hexHexGrid 3
ghci> indices g
[(-2,0),(-2,1),(-2,2),(-1,-1),(-1,0),(-1,1),(-1,2),(0,-2),(0,-1),(0,0),(0,1),(0,2),(1,-2),(1,-1),(1,0),(1,1),(2,-2),(2,-1),(2,0)]

Find out if the specified index is contained within the grid.

ghci> g `contains` (0,-2)
True
ghci> g `contains` (99,99)
False

Find out the minimum number of moves to go from one tile in a grid to another tile, moving between adjacent tiles at each step.

ghci> distance g (0,-2) (0,2)
4

Find out the minimum number of moves to go from one tile in a grid to any other tile, moving between adjacent tiles at each step.

ghci> viewpoint g (1,-2)
[((-2,0),3),((-2,1),3),((-2,2),4),((-1,-1),2),((-1,0),2),((-1,1),3),((-1,2),4),((0,-2),1),((0,-1),1),((0,0),2),((0,1),3),((0,2),4),((1,-2),0),((1,-1),1),((1,0),2),((1,1),3),((2,-2),1),((2,-1),2),((2,0),3)]

Find out which tiles are adjacent to a particular tile.

ghci> neighbours g (-1,1)
[(-2,1),(-2,2),(-1,2),(0,1),(0,0),(-1,0)]

Find how many tiles are adjacent to a particular tile. (Note that the result is consistent with the result from the previous step.)

ghci> numNeighbours g (-1,1)
6

Find out if an index is valid for the grid.

ghci> g `contains` (0,0)
True
ghci> g `contains` (0,12)
False

Find out the physical dimensions of the grid.

ghci> size g
3

Get the list of boundary tiles for a grid.

ghci> boundary g
[(-2,2),(-1,2),(0,2),(1,1),(2,0),(2,-1),(2,-2),(1,-2),(0,-2),(-1,-1),(-2,0),(-2,1)]

Find out the number of tiles in the grid.

ghci> tileCount g
19

Check if a grid is null (contains no tiles).

ghci> null g
False
ghci> nonNull g
True

Find the central tile(s) (the tile(s) furthest from the boundary).

ghci> centre g
[(0,0)]

Find all of the minimal paths between two points.

ghci> let g = hexHexGrid 3
ghci> minimalPaths g (0,0) (2,-1)
[[(0,0),(1,0),(2,-1)],[(0,0),(1,-1),(2,-1)]]

Find all of the pairs of tiles that are adjacent.

ghci> edges g
[((-2,0),(-2,1)),((-2,0),(-1,0)),((-2,0),(-1,-1)),((-2,1),(-2,2)),((-2,1),(-1,1)),((-2,1),(-1,0)),((-2,2),(-1,2)),((-2,2),(-1,1)),((-1,-1),(-1,0)),((-1,-1),(0,-1)),((-1,-1),(0,-2)),((-1,0),(-1,1)),((-1,0),(0,0)),((-1,0),(0,-1)),((-1,1),(-1,2)),((-1,1),(0,1)),((-1,1),(0,0)),((-1,2),(0,2)),((-1,2),(0,1)),((0,-2),(0,-1)),((0,-2),(1,-2)),((0,-1),(0,0)),((0,-1),(1,-1)),((0,-1),(1,-2)),((0,0),(0,1)),((0,0),(1,0)),((0,0),(1,-1)),((0,1),(0,2)),((0,1),(1,1)),((0,1),(1,0)),((0,2),(1,1)),((1,-2),(1,-1)),((1,-2),(2,-2)),((1,-1),(1,0)),((1,-1),(2,-1)),((1,-1),(2,-2)),((1,0),(1,1)),((1,0),(2,0)),((1,0),(2,-1)),((1,1),(2,0)),((2,-2),(2,-1)),((2,-1),(2,0))]

Find out if two tiles are adjacent.

ghci> isAdjacent g (-2,0) (-2,1)
True
ghci> isAdjacent g (-2,0) (0,1)
False

Grids

class Grid g where Source #

A regular arrangement of tiles. Minimal complete definition: Index, Direction, indices, distance, directionTo.

Minimal complete definition

indices, distance, directionTo

Methods

indices :: g -> [Index g] Source #

Returns the indices of all tiles in a grid.

distance :: g -> Index g -> Index g -> Int Source #

distance g a b returns the minimum number of moves required to get from the tile at index a to the tile at index b in grid g, moving between adjacent tiles at each step. (Two tiles are adjacent if they share an edge.) If a or b are not contained within g, the result is undefined.

minDistance :: g -> [Index g] -> Index g -> Int Source #

minDistance g bs a returns the minimum number of moves required to get from any of the tiles at indices bs to the tile at index a in grid g, moving between adjacent tiles at each step. (Two tiles are adjacent if they share an edge.) If a or any of bs are not contained within g, the result is undefined.

neighbours :: Eq (Index g) => g -> Index g -> [Index g] Source #

neighbours g a returns the indices of the tiles in the grid g which are adjacent to the tile with index a.

neighbour :: (Eq (Index g), Eq (Direction g)) => g -> Index g -> Direction g -> Maybe (Index g) Source #

neighbour g d a returns the indices of the tile in the grid g which is adjacent to the tile with index a, in the direction d.

contains :: Eq (Index g) => g -> Index g -> Bool Source #

g `contains' a returns True if the index a is contained within the grid g, otherwise it returns false.

tileCount :: g -> Int Source #

Returns the number of tiles in a grid. Compare with size.

null :: g -> Bool Source #

Returns True if the number of tiles in a grid is zero, False otherwise.

nonNull :: g -> Bool Source #

Returns False if the number of tiles in a grid is zero, True otherwise.

edges :: Eq (Index g) => g -> [(Index g, Index g)] Source #

A list of all edges in a grid, where the edges are represented by a pair of indices of adjacent tiles.

viewpoint :: g -> Index g -> [(Index g, Int)] Source #

viewpoint g a returns a list of pairs associating the index of each tile in g with its distance to the tile with index a. If a is not contained within g, the result is undefined.

isAdjacent :: g -> Index g -> Index g -> Bool Source #

isAdjacent g a b returns True if the tile at index a is adjacent to the tile at index b in g. (Two tiles are adjacent if they share an edge.) If a or b are not contained within g, the result is undefined.

adjacentTilesToward :: Eq (Index g) => g -> Index g -> Index g -> [Index g] Source #

adjacentTilesToward g a b returns the indices of all tiles which are neighbours of the tile at index a, and which are closer to the tile at b than a is. In other words, it returns the possible next steps on a minimal path from a to b. If a or b are not contained within g, or if there is no path from a to b (e.g., a disconnected grid), the result is undefined.

minimalPaths :: Eq (Index g) => g -> Index g -> Index g -> [[Index g]] Source #

minimalPaths g a b returns a list of all minimal paths from the tile at index a to the tile at index b in grid g. A path is a sequence of tiles where each tile in the sequence is adjacent to the previous one. (Two tiles are adjacent if they share an edge.) If a or b are not contained within g, the result is undefined.

Tip: The default implementation of this function calls adjacentTilesToward. If you want to use a custom algorithm, consider modifying adjacentTilesToward instead of minimalPaths.

directionTo :: g -> Index g -> Index g -> [Direction g] Source #

directionTo g a b returns the direction(s) of the next tile(s) in a minimal path from the tile at index a to the tile at index b in grid g.

Instances
Grid XCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index XCylTriGrid :: Type Source #

type Direction XCylTriGrid :: Type Source #

Methods

indices :: XCylTriGrid -> [Index XCylTriGrid] Source #

distance :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> Int Source #

minDistance :: XCylTriGrid -> [Index XCylTriGrid] -> Index XCylTriGrid -> Int Source #

neighbours :: XCylTriGrid -> Index XCylTriGrid -> [Index XCylTriGrid] Source #

neighboursOfSet :: XCylTriGrid -> [Index XCylTriGrid] -> [Index XCylTriGrid] Source #

neighbour :: XCylTriGrid -> Index XCylTriGrid -> Direction XCylTriGrid -> Maybe (Index XCylTriGrid) Source #

numNeighbours :: XCylTriGrid -> Index XCylTriGrid -> Int Source #

contains :: XCylTriGrid -> Index XCylTriGrid -> Bool Source #

tileCount :: XCylTriGrid -> Int Source #

null :: XCylTriGrid -> Bool Source #

nonNull :: XCylTriGrid -> Bool Source #

edges :: XCylTriGrid -> [(Index XCylTriGrid, Index XCylTriGrid)] Source #

viewpoint :: XCylTriGrid -> Index XCylTriGrid -> [(Index XCylTriGrid, Int)] Source #

isAdjacent :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> Bool Source #

adjacentTilesToward :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> [Index XCylTriGrid] Source #

minimalPaths :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> [[Index XCylTriGrid]] Source #

directionTo :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> [Direction XCylTriGrid] Source #

defaultMinDistance :: XCylTriGrid -> [Index XCylTriGrid] -> Index XCylTriGrid -> Int Source #

defaultNeighbours :: XCylTriGrid -> Index XCylTriGrid -> [Index XCylTriGrid] Source #

defaultNeighboursOfSet :: XCylTriGrid -> [Index XCylTriGrid] -> [Index XCylTriGrid] Source #

defaultNeighbour :: XCylTriGrid -> Index XCylTriGrid -> Direction XCylTriGrid -> Maybe (Index XCylTriGrid) Source #

defaultTileCount :: XCylTriGrid -> Int Source #

defaultEdges :: XCylTriGrid -> [(Index XCylTriGrid, Index XCylTriGrid)] Source #

defaultIsAdjacent :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> Bool Source #

defaultAdjacentTilesToward :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> [Index XCylTriGrid] Source #

defaultMinimalPaths :: XCylTriGrid -> Index XCylTriGrid -> Index XCylTriGrid -> [[Index XCylTriGrid]] Source #

Grid YCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index YCylTriGrid :: Type Source #

type Direction YCylTriGrid :: Type Source #

Methods

indices :: YCylTriGrid -> [Index YCylTriGrid] Source #

distance :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> Int Source #

minDistance :: YCylTriGrid -> [Index YCylTriGrid] -> Index YCylTriGrid -> Int Source #

neighbours :: YCylTriGrid -> Index YCylTriGrid -> [Index YCylTriGrid] Source #

neighboursOfSet :: YCylTriGrid -> [Index YCylTriGrid] -> [Index YCylTriGrid] Source #

neighbour :: YCylTriGrid -> Index YCylTriGrid -> Direction YCylTriGrid -> Maybe (Index YCylTriGrid) Source #

numNeighbours :: YCylTriGrid -> Index YCylTriGrid -> Int Source #

contains :: YCylTriGrid -> Index YCylTriGrid -> Bool Source #

tileCount :: YCylTriGrid -> Int Source #

null :: YCylTriGrid -> Bool Source #

nonNull :: YCylTriGrid -> Bool Source #

edges :: YCylTriGrid -> [(Index YCylTriGrid, Index YCylTriGrid)] Source #

viewpoint :: YCylTriGrid -> Index YCylTriGrid -> [(Index YCylTriGrid, Int)] Source #

isAdjacent :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> Bool Source #

adjacentTilesToward :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> [Index YCylTriGrid] Source #

minimalPaths :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> [[Index YCylTriGrid]] Source #

directionTo :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> [Direction YCylTriGrid] Source #

defaultMinDistance :: YCylTriGrid -> [Index YCylTriGrid] -> Index YCylTriGrid -> Int Source #

defaultNeighbours :: YCylTriGrid -> Index YCylTriGrid -> [Index YCylTriGrid] Source #

defaultNeighboursOfSet :: YCylTriGrid -> [Index YCylTriGrid] -> [Index YCylTriGrid] Source #

defaultNeighbour :: YCylTriGrid -> Index YCylTriGrid -> Direction YCylTriGrid -> Maybe (Index YCylTriGrid) Source #

defaultTileCount :: YCylTriGrid -> Int Source #

defaultEdges :: YCylTriGrid -> [(Index YCylTriGrid, Index YCylTriGrid)] Source #

defaultIsAdjacent :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> Bool Source #

defaultAdjacentTilesToward :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> [Index YCylTriGrid] Source #

defaultMinimalPaths :: YCylTriGrid -> Index YCylTriGrid -> Index YCylTriGrid -> [[Index YCylTriGrid]] Source #

Grid TorTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index TorTriGrid :: Type Source #

type Direction TorTriGrid :: Type Source #

Methods

indices :: TorTriGrid -> [Index TorTriGrid] Source #

distance :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> Int Source #

minDistance :: TorTriGrid -> [Index TorTriGrid] -> Index TorTriGrid -> Int Source #

neighbours :: TorTriGrid -> Index TorTriGrid -> [Index TorTriGrid] Source #

neighboursOfSet :: TorTriGrid -> [Index TorTriGrid] -> [Index TorTriGrid] Source #

neighbour :: TorTriGrid -> Index TorTriGrid -> Direction TorTriGrid -> Maybe (Index TorTriGrid) Source #

numNeighbours :: TorTriGrid -> Index TorTriGrid -> Int Source #

contains :: TorTriGrid -> Index TorTriGrid -> Bool Source #

tileCount :: TorTriGrid -> Int Source #

null :: TorTriGrid -> Bool Source #

nonNull :: TorTriGrid -> Bool Source #

edges :: TorTriGrid -> [(Index TorTriGrid, Index TorTriGrid)] Source #

viewpoint :: TorTriGrid -> Index TorTriGrid -> [(Index TorTriGrid, Int)] Source #

isAdjacent :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> Bool Source #

adjacentTilesToward :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> [Index TorTriGrid] Source #

minimalPaths :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> [[Index TorTriGrid]] Source #

directionTo :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> [Direction TorTriGrid] Source #

defaultMinDistance :: TorTriGrid -> [Index TorTriGrid] -> Index TorTriGrid -> Int Source #

defaultNeighbours :: TorTriGrid -> Index TorTriGrid -> [Index TorTriGrid] Source #

defaultNeighboursOfSet :: TorTriGrid -> [Index TorTriGrid] -> [Index TorTriGrid] Source #

defaultNeighbour :: TorTriGrid -> Index TorTriGrid -> Direction TorTriGrid -> Maybe (Index TorTriGrid) Source #

defaultTileCount :: TorTriGrid -> Int Source #

defaultEdges :: TorTriGrid -> [(Index TorTriGrid, Index TorTriGrid)] Source #

defaultIsAdjacent :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> Bool Source #

defaultAdjacentTilesToward :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> [Index TorTriGrid] Source #

defaultMinimalPaths :: TorTriGrid -> Index TorTriGrid -> Index TorTriGrid -> [[Index TorTriGrid]] Source #

Grid RectTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index RectTriGrid :: Type Source #

type Direction RectTriGrid :: Type Source #

Methods

indices :: RectTriGrid -> [Index RectTriGrid] Source #

distance :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> Int Source #

minDistance :: RectTriGrid -> [Index RectTriGrid] -> Index RectTriGrid -> Int Source #

neighbours :: RectTriGrid -> Index RectTriGrid -> [Index RectTriGrid] Source #

neighboursOfSet :: RectTriGrid -> [Index RectTriGrid] -> [Index RectTriGrid] Source #

neighbour :: RectTriGrid -> Index RectTriGrid -> Direction RectTriGrid -> Maybe (Index RectTriGrid) Source #

numNeighbours :: RectTriGrid -> Index RectTriGrid -> Int Source #

contains :: RectTriGrid -> Index RectTriGrid -> Bool Source #

tileCount :: RectTriGrid -> Int Source #

null :: RectTriGrid -> Bool Source #

nonNull :: RectTriGrid -> Bool Source #

edges :: RectTriGrid -> [(Index RectTriGrid, Index RectTriGrid)] Source #

viewpoint :: RectTriGrid -> Index RectTriGrid -> [(Index RectTriGrid, Int)] Source #

isAdjacent :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> Bool Source #

adjacentTilesToward :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> [Index RectTriGrid] Source #

minimalPaths :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> [[Index RectTriGrid]] Source #

directionTo :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> [Direction RectTriGrid] Source #

defaultMinDistance :: RectTriGrid -> [Index RectTriGrid] -> Index RectTriGrid -> Int Source #

defaultNeighbours :: RectTriGrid -> Index RectTriGrid -> [Index RectTriGrid] Source #

defaultNeighboursOfSet :: RectTriGrid -> [Index RectTriGrid] -> [Index RectTriGrid] Source #

defaultNeighbour :: RectTriGrid -> Index RectTriGrid -> Direction RectTriGrid -> Maybe (Index RectTriGrid) Source #

defaultTileCount :: RectTriGrid -> Int Source #

defaultEdges :: RectTriGrid -> [(Index RectTriGrid, Index RectTriGrid)] Source #

defaultIsAdjacent :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> Bool Source #

defaultAdjacentTilesToward :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> [Index RectTriGrid] Source #

defaultMinimalPaths :: RectTriGrid -> Index RectTriGrid -> Index RectTriGrid -> [[Index RectTriGrid]] Source #

Grid ParaTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index ParaTriGrid :: Type Source #

type Direction ParaTriGrid :: Type Source #

Methods

indices :: ParaTriGrid -> [Index ParaTriGrid] Source #

distance :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> Int Source #

minDistance :: ParaTriGrid -> [Index ParaTriGrid] -> Index ParaTriGrid -> Int Source #

neighbours :: ParaTriGrid -> Index ParaTriGrid -> [Index ParaTriGrid] Source #

neighboursOfSet :: ParaTriGrid -> [Index ParaTriGrid] -> [Index ParaTriGrid] Source #

neighbour :: ParaTriGrid -> Index ParaTriGrid -> Direction ParaTriGrid -> Maybe (Index ParaTriGrid) Source #

numNeighbours :: ParaTriGrid -> Index ParaTriGrid -> Int Source #

contains :: ParaTriGrid -> Index ParaTriGrid -> Bool Source #

tileCount :: ParaTriGrid -> Int Source #

null :: ParaTriGrid -> Bool Source #

nonNull :: ParaTriGrid -> Bool Source #

edges :: ParaTriGrid -> [(Index ParaTriGrid, Index ParaTriGrid)] Source #

viewpoint :: ParaTriGrid -> Index ParaTriGrid -> [(Index ParaTriGrid, Int)] Source #

isAdjacent :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> Bool Source #

adjacentTilesToward :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> [Index ParaTriGrid] Source #

minimalPaths :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> [[Index ParaTriGrid]] Source #

directionTo :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> [Direction ParaTriGrid] Source #

defaultMinDistance :: ParaTriGrid -> [Index ParaTriGrid] -> Index ParaTriGrid -> Int Source #

defaultNeighbours :: ParaTriGrid -> Index ParaTriGrid -> [Index ParaTriGrid] Source #

defaultNeighboursOfSet :: ParaTriGrid -> [Index ParaTriGrid] -> [Index ParaTriGrid] Source #

defaultNeighbour :: ParaTriGrid -> Index ParaTriGrid -> Direction ParaTriGrid -> Maybe (Index ParaTriGrid) Source #

defaultTileCount :: ParaTriGrid -> Int Source #

defaultEdges :: ParaTriGrid -> [(Index ParaTriGrid, Index ParaTriGrid)] Source #

defaultIsAdjacent :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> Bool Source #

defaultAdjacentTilesToward :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> [Index ParaTriGrid] Source #

defaultMinimalPaths :: ParaTriGrid -> Index ParaTriGrid -> Index ParaTriGrid -> [[Index ParaTriGrid]] Source #

Grid TriTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Index TriTriGrid :: Type Source #

type Direction TriTriGrid :: Type Source #

Methods

indices :: TriTriGrid -> [Index TriTriGrid] Source #

distance :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> Int Source #

minDistance :: TriTriGrid -> [Index TriTriGrid] -> Index TriTriGrid -> Int Source #

neighbours :: TriTriGrid -> Index TriTriGrid -> [Index TriTriGrid] Source #

neighboursOfSet :: TriTriGrid -> [Index TriTriGrid] -> [Index TriTriGrid] Source #

neighbour :: TriTriGrid -> Index TriTriGrid -> Direction TriTriGrid -> Maybe (Index TriTriGrid) Source #

numNeighbours :: TriTriGrid -> Index TriTriGrid -> Int Source #

contains :: TriTriGrid -> Index TriTriGrid -> Bool Source #

tileCount :: TriTriGrid -> Int Source #

null :: TriTriGrid -> Bool Source #

nonNull :: TriTriGrid -> Bool Source #

edges :: TriTriGrid -> [(Index TriTriGrid, Index TriTriGrid)] Source #

viewpoint :: TriTriGrid -> Index TriTriGrid -> [(Index TriTriGrid, Int)] Source #

isAdjacent :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> Bool Source #

adjacentTilesToward :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> [Index TriTriGrid] Source #

minimalPaths :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> [[Index TriTriGrid]] Source #

directionTo :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> [Direction TriTriGrid] Source #

defaultMinDistance :: TriTriGrid -> [Index TriTriGrid] -> Index TriTriGrid -> Int Source #

defaultNeighbours :: TriTriGrid -> Index TriTriGrid -> [Index TriTriGrid] Source #

defaultNeighboursOfSet :: TriTriGrid -> [Index TriTriGrid] -> [Index TriTriGrid] Source #

defaultNeighbour :: TriTriGrid -> Index TriTriGrid -> Direction TriTriGrid -> Maybe (Index TriTriGrid) Source #

defaultTileCount :: TriTriGrid -> Int Source #

defaultEdges :: TriTriGrid -> [(Index TriTriGrid, Index TriTriGrid)] Source #

defaultIsAdjacent :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> Bool Source #

defaultAdjacentTilesToward :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> [Index TriTriGrid] Source #

defaultMinimalPaths :: TriTriGrid -> Index TriTriGrid -> Index TriTriGrid -> [[Index TriTriGrid]] Source #

Grid UnboundedTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Methods

indices :: UnboundedTriGrid -> [Index UnboundedTriGrid] Source #

distance :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> Int Source #

minDistance :: UnboundedTriGrid -> [Index UnboundedTriGrid] -> Index UnboundedTriGrid -> Int Source #

neighbours :: UnboundedTriGrid -> Index UnboundedTriGrid -> [Index UnboundedTriGrid] Source #

neighboursOfSet :: UnboundedTriGrid -> [Index UnboundedTriGrid] -> [Index UnboundedTriGrid] Source #

neighbour :: UnboundedTriGrid -> Index UnboundedTriGrid -> Direction UnboundedTriGrid -> Maybe (Index UnboundedTriGrid) Source #

numNeighbours :: UnboundedTriGrid -> Index UnboundedTriGrid -> Int Source #

contains :: UnboundedTriGrid -> Index UnboundedTriGrid -> Bool Source #

tileCount :: UnboundedTriGrid -> Int Source #

null :: UnboundedTriGrid -> Bool Source #

nonNull :: UnboundedTriGrid -> Bool Source #

edges :: UnboundedTriGrid -> [(Index UnboundedTriGrid, Index UnboundedTriGrid)] Source #

viewpoint :: UnboundedTriGrid -> Index UnboundedTriGrid -> [(Index UnboundedTriGrid, Int)] Source #

isAdjacent :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> Bool Source #

adjacentTilesToward :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> [Index UnboundedTriGrid] Source #

minimalPaths :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> [[Index UnboundedTriGrid]] Source #

directionTo :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> [Direction UnboundedTriGrid] Source #

defaultMinDistance :: UnboundedTriGrid -> [Index UnboundedTriGrid] -> Index UnboundedTriGrid -> Int Source #

defaultNeighbours :: UnboundedTriGrid -> Index UnboundedTriGrid -> [Index UnboundedTriGrid] Source #

defaultNeighboursOfSet :: UnboundedTriGrid -> [Index UnboundedTriGrid] -> [Index UnboundedTriGrid] Source #

defaultNeighbour :: UnboundedTriGrid -> Index UnboundedTriGrid -> Direction UnboundedTriGrid -> Maybe (Index UnboundedTriGrid) Source #

defaultTileCount :: UnboundedTriGrid -> Int Source #

defaultEdges :: UnboundedTriGrid -> [(Index UnboundedTriGrid, Index UnboundedTriGrid)] Source #

defaultIsAdjacent :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> Bool Source #

defaultAdjacentTilesToward :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> [Index UnboundedTriGrid] Source #

defaultMinimalPaths :: UnboundedTriGrid -> Index UnboundedTriGrid -> Index UnboundedTriGrid -> [[Index UnboundedTriGrid]] Source #

Grid TorSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

Methods

indices :: TorSquareGrid -> [Index TorSquareGrid] Source #

distance :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> Int Source #

minDistance :: TorSquareGrid -> [Index TorSquareGrid] -> Index TorSquareGrid -> Int Source #

neighbours :: TorSquareGrid -> Index TorSquareGrid -> [Index TorSquareGrid] Source #

neighboursOfSet :: TorSquareGrid -> [Index TorSquareGrid] -> [Index TorSquareGrid] Source #

neighbour :: TorSquareGrid -> Index TorSquareGrid -> Direction TorSquareGrid -> Maybe (Index TorSquareGrid) Source #

numNeighbours :: TorSquareGrid -> Index TorSquareGrid -> Int Source #

contains :: TorSquareGrid -> Index TorSquareGrid -> Bool Source #

tileCount :: TorSquareGrid -> Int Source #

null :: TorSquareGrid -> Bool Source #

nonNull :: TorSquareGrid -> Bool Source #

edges :: TorSquareGrid -> [(Index TorSquareGrid, Index TorSquareGrid)] Source #

viewpoint :: TorSquareGrid -> Index TorSquareGrid -> [(Index TorSquareGrid, Int)] Source #

isAdjacent :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> Bool Source #

adjacentTilesToward :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> [Index TorSquareGrid] Source #

minimalPaths :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> [[Index TorSquareGrid]] Source #

directionTo :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> [Direction TorSquareGrid] Source #

defaultMinDistance :: TorSquareGrid -> [Index TorSquareGrid] -> Index TorSquareGrid -> Int Source #

defaultNeighbours :: TorSquareGrid -> Index TorSquareGrid -> [Index TorSquareGrid] Source #

defaultNeighboursOfSet :: TorSquareGrid -> [Index TorSquareGrid] -> [Index TorSquareGrid] Source #

defaultNeighbour :: TorSquareGrid -> Index TorSquareGrid -> Direction TorSquareGrid -> Maybe (Index TorSquareGrid) Source #

defaultTileCount :: TorSquareGrid -> Int Source #

defaultEdges :: TorSquareGrid -> [(Index TorSquareGrid, Index TorSquareGrid)] Source #

defaultIsAdjacent :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> Bool Source #

defaultAdjacentTilesToward :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> [Index TorSquareGrid] Source #

defaultMinimalPaths :: TorSquareGrid -> Index TorSquareGrid -> Index TorSquareGrid -> [[Index TorSquareGrid]] Source #

Grid RectSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

Methods

indices :: RectSquareGrid -> [Index RectSquareGrid] Source #

distance :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> Int Source #

minDistance :: RectSquareGrid -> [Index RectSquareGrid] -> Index RectSquareGrid -> Int Source #

neighbours :: RectSquareGrid -> Index RectSquareGrid -> [Index RectSquareGrid] Source #

neighboursOfSet :: RectSquareGrid -> [Index RectSquareGrid] -> [Index RectSquareGrid] Source #

neighbour :: RectSquareGrid -> Index RectSquareGrid -> Direction RectSquareGrid -> Maybe (Index RectSquareGrid) Source #

numNeighbours :: RectSquareGrid -> Index RectSquareGrid -> Int Source #

contains :: RectSquareGrid -> Index RectSquareGrid -> Bool Source #

tileCount :: RectSquareGrid -> Int Source #

null :: RectSquareGrid -> Bool Source #

nonNull :: RectSquareGrid -> Bool Source #

edges :: RectSquareGrid -> [(Index RectSquareGrid, Index RectSquareGrid)] Source #

viewpoint :: RectSquareGrid -> Index RectSquareGrid -> [(Index RectSquareGrid, Int)] Source #

isAdjacent :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> Bool Source #

adjacentTilesToward :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> [Index RectSquareGrid] Source #

minimalPaths :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> [[Index RectSquareGrid]] Source #

directionTo :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> [Direction RectSquareGrid] Source #

defaultMinDistance :: RectSquareGrid -> [Index RectSquareGrid] -> Index RectSquareGrid -> Int Source #

defaultNeighbours :: RectSquareGrid -> Index RectSquareGrid -> [Index RectSquareGrid] Source #

defaultNeighboursOfSet :: RectSquareGrid -> [Index RectSquareGrid] -> [Index RectSquareGrid] Source #

defaultNeighbour :: RectSquareGrid -> Index RectSquareGrid -> Direction RectSquareGrid -> Maybe (Index RectSquareGrid) Source #

defaultTileCount :: RectSquareGrid -> Int Source #

defaultEdges :: RectSquareGrid -> [(Index RectSquareGrid, Index RectSquareGrid)] Source #

defaultIsAdjacent :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> Bool Source #

defaultAdjacentTilesToward :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> [Index RectSquareGrid] Source #

defaultMinimalPaths :: RectSquareGrid -> Index RectSquareGrid -> Index RectSquareGrid -> [[Index RectSquareGrid]] Source #

Grid UnboundedSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

Methods

indices :: UnboundedSquareGrid -> [Index UnboundedSquareGrid] Source #

distance :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> Int Source #

minDistance :: UnboundedSquareGrid -> [Index UnboundedSquareGrid] -> Index UnboundedSquareGrid -> Int Source #

neighbours :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> [Index UnboundedSquareGrid] Source #

neighboursOfSet :: UnboundedSquareGrid -> [Index UnboundedSquareGrid] -> [Index UnboundedSquareGrid] Source #

neighbour :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Direction UnboundedSquareGrid -> Maybe (Index UnboundedSquareGrid) Source #

numNeighbours :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Int Source #

contains :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Bool Source #

tileCount :: UnboundedSquareGrid -> Int Source #

null :: UnboundedSquareGrid -> Bool Source #

nonNull :: UnboundedSquareGrid -> Bool Source #

edges :: UnboundedSquareGrid -> [(Index UnboundedSquareGrid, Index UnboundedSquareGrid)] Source #

viewpoint :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> [(Index UnboundedSquareGrid, Int)] Source #

isAdjacent :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> Bool Source #

adjacentTilesToward :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> [Index UnboundedSquareGrid] Source #

minimalPaths :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> [[Index UnboundedSquareGrid]] Source #

directionTo :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> [Direction UnboundedSquareGrid] Source #

defaultMinDistance :: UnboundedSquareGrid -> [Index UnboundedSquareGrid] -> Index UnboundedSquareGrid -> Int Source #

defaultNeighbours :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> [Index UnboundedSquareGrid] Source #

defaultNeighboursOfSet :: UnboundedSquareGrid -> [Index UnboundedSquareGrid] -> [Index UnboundedSquareGrid] Source #

defaultNeighbour :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Direction UnboundedSquareGrid -> Maybe (Index UnboundedSquareGrid) Source #

defaultTileCount :: UnboundedSquareGrid -> Int Source #

defaultEdges :: UnboundedSquareGrid -> [(Index UnboundedSquareGrid, Index UnboundedSquareGrid)] Source #

defaultIsAdjacent :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> Bool Source #

defaultAdjacentTilesToward :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> [Index UnboundedSquareGrid] Source #

defaultMinimalPaths :: UnboundedSquareGrid -> Index UnboundedSquareGrid -> Index UnboundedSquareGrid -> [[Index UnboundedSquareGrid]] Source #

Grid TorOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

Associated Types

type Index TorOctGrid :: Type Source #

type Direction TorOctGrid :: Type Source #

Methods

indices :: TorOctGrid -> [Index TorOctGrid] Source #

distance :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> Int Source #

minDistance :: TorOctGrid -> [Index TorOctGrid] -> Index TorOctGrid -> Int Source #

neighbours :: TorOctGrid -> Index TorOctGrid -> [Index TorOctGrid] Source #

neighboursOfSet :: TorOctGrid -> [Index TorOctGrid] -> [Index TorOctGrid] Source #

neighbour :: TorOctGrid -> Index TorOctGrid -> Direction TorOctGrid -> Maybe (Index TorOctGrid) Source #

numNeighbours :: TorOctGrid -> Index TorOctGrid -> Int Source #

contains :: TorOctGrid -> Index TorOctGrid -> Bool Source #

tileCount :: TorOctGrid -> Int Source #

null :: TorOctGrid -> Bool Source #

nonNull :: TorOctGrid -> Bool Source #

edges :: TorOctGrid -> [(Index TorOctGrid, Index TorOctGrid)] Source #

viewpoint :: TorOctGrid -> Index TorOctGrid -> [(Index TorOctGrid, Int)] Source #

isAdjacent :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> Bool Source #

adjacentTilesToward :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> [Index TorOctGrid] Source #

minimalPaths :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> [[Index TorOctGrid]] Source #

directionTo :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> [Direction TorOctGrid] Source #

defaultMinDistance :: TorOctGrid -> [Index TorOctGrid] -> Index TorOctGrid -> Int Source #

defaultNeighbours :: TorOctGrid -> Index TorOctGrid -> [Index TorOctGrid] Source #

defaultNeighboursOfSet :: TorOctGrid -> [Index TorOctGrid] -> [Index TorOctGrid] Source #

defaultNeighbour :: TorOctGrid -> Index TorOctGrid -> Direction TorOctGrid -> Maybe (Index TorOctGrid) Source #

defaultTileCount :: TorOctGrid -> Int Source #

defaultEdges :: TorOctGrid -> [(Index TorOctGrid, Index TorOctGrid)] Source #

defaultIsAdjacent :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> Bool Source #

defaultAdjacentTilesToward :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> [Index TorOctGrid] Source #

defaultMinimalPaths :: TorOctGrid -> Index TorOctGrid -> Index TorOctGrid -> [[Index TorOctGrid]] Source #

Grid RectOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

Associated Types

type Index RectOctGrid :: Type Source #

type Direction RectOctGrid :: Type Source #

Methods

indices :: RectOctGrid -> [Index RectOctGrid] Source #

distance :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> Int Source #

minDistance :: RectOctGrid -> [Index RectOctGrid] -> Index RectOctGrid -> Int Source #

neighbours :: RectOctGrid -> Index RectOctGrid -> [Index RectOctGrid] Source #

neighboursOfSet :: RectOctGrid -> [Index RectOctGrid] -> [Index RectOctGrid] Source #

neighbour :: RectOctGrid -> Index RectOctGrid -> Direction RectOctGrid -> Maybe (Index RectOctGrid) Source #

numNeighbours :: RectOctGrid -> Index RectOctGrid -> Int Source #

contains :: RectOctGrid -> Index RectOctGrid -> Bool Source #

tileCount :: RectOctGrid -> Int Source #

null :: RectOctGrid -> Bool Source #

nonNull :: RectOctGrid -> Bool Source #

edges :: RectOctGrid -> [(Index RectOctGrid, Index RectOctGrid)] Source #

viewpoint :: RectOctGrid -> Index RectOctGrid -> [(Index RectOctGrid, Int)] Source #

isAdjacent :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> Bool Source #

adjacentTilesToward :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> [Index RectOctGrid] Source #

minimalPaths :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> [[Index RectOctGrid]] Source #

directionTo :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> [Direction RectOctGrid] Source #

defaultMinDistance :: RectOctGrid -> [Index RectOctGrid] -> Index RectOctGrid -> Int Source #

defaultNeighbours :: RectOctGrid -> Index RectOctGrid -> [Index RectOctGrid] Source #

defaultNeighboursOfSet :: RectOctGrid -> [Index RectOctGrid] -> [Index RectOctGrid] Source #

defaultNeighbour :: RectOctGrid -> Index RectOctGrid -> Direction RectOctGrid -> Maybe (Index RectOctGrid) Source #

defaultTileCount :: RectOctGrid -> Int Source #

defaultEdges :: RectOctGrid -> [(Index RectOctGrid, Index RectOctGrid)] Source #

defaultIsAdjacent :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> Bool Source #

defaultAdjacentTilesToward :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> [Index RectOctGrid] Source #

defaultMinimalPaths :: RectOctGrid -> Index RectOctGrid -> Index RectOctGrid -> [[Index RectOctGrid]] Source #

Grid UnboundedOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

Methods

indices :: UnboundedOctGrid -> [Index UnboundedOctGrid] Source #

distance :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> Int Source #

minDistance :: UnboundedOctGrid -> [Index UnboundedOctGrid] -> Index UnboundedOctGrid -> Int Source #

neighbours :: UnboundedOctGrid -> Index UnboundedOctGrid -> [Index UnboundedOctGrid] Source #

neighboursOfSet :: UnboundedOctGrid -> [Index UnboundedOctGrid] -> [Index UnboundedOctGrid] Source #

neighbour :: UnboundedOctGrid -> Index UnboundedOctGrid -> Direction UnboundedOctGrid -> Maybe (Index UnboundedOctGrid) Source #

numNeighbours :: UnboundedOctGrid -> Index UnboundedOctGrid -> Int Source #

contains :: UnboundedOctGrid -> Index UnboundedOctGrid -> Bool Source #

tileCount :: UnboundedOctGrid -> Int Source #

null :: UnboundedOctGrid -> Bool Source #

nonNull :: UnboundedOctGrid -> Bool Source #

edges :: UnboundedOctGrid -> [(Index UnboundedOctGrid, Index UnboundedOctGrid)] Source #

viewpoint :: UnboundedOctGrid -> Index UnboundedOctGrid -> [(Index UnboundedOctGrid, Int)] Source #

isAdjacent :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> Bool Source #

adjacentTilesToward :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> [Index UnboundedOctGrid] Source #

minimalPaths :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> [[Index UnboundedOctGrid]] Source #

directionTo :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> [Direction UnboundedOctGrid] Source #

defaultMinDistance :: UnboundedOctGrid -> [Index UnboundedOctGrid] -> Index UnboundedOctGrid -> Int Source #

defaultNeighbours :: UnboundedOctGrid -> Index UnboundedOctGrid -> [Index UnboundedOctGrid] Source #

defaultNeighboursOfSet :: UnboundedOctGrid -> [Index UnboundedOctGrid] -> [Index UnboundedOctGrid] Source #

defaultNeighbour :: UnboundedOctGrid -> Index UnboundedOctGrid -> Direction UnboundedOctGrid -> Maybe (Index UnboundedOctGrid) Source #

defaultTileCount :: UnboundedOctGrid -> Int Source #

defaultEdges :: UnboundedOctGrid -> [(Index UnboundedOctGrid, Index UnboundedOctGrid)] Source #

defaultIsAdjacent :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> Bool Source #

defaultAdjacentTilesToward :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> [Index UnboundedOctGrid] Source #

defaultMinimalPaths :: UnboundedOctGrid -> Index UnboundedOctGrid -> Index UnboundedOctGrid -> [[Index UnboundedOctGrid]] Source #

Grid RectHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

Associated Types

type Index RectHexGrid :: Type Source #

type Direction RectHexGrid :: Type Source #

Methods

indices :: RectHexGrid -> [Index RectHexGrid] Source #

distance :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> Int Source #

minDistance :: RectHexGrid -> [Index RectHexGrid] -> Index RectHexGrid -> Int Source #

neighbours :: RectHexGrid -> Index RectHexGrid -> [Index RectHexGrid] Source #

neighboursOfSet :: RectHexGrid -> [Index RectHexGrid] -> [Index RectHexGrid] Source #

neighbour :: RectHexGrid -> Index RectHexGrid -> Direction RectHexGrid -> Maybe (Index RectHexGrid) Source #

numNeighbours :: RectHexGrid -> Index RectHexGrid -> Int Source #

contains :: RectHexGrid -> Index RectHexGrid -> Bool Source #

tileCount :: RectHexGrid -> Int Source #

null :: RectHexGrid -> Bool Source #

nonNull :: RectHexGrid -> Bool Source #

edges :: RectHexGrid -> [(Index RectHexGrid, Index RectHexGrid)] Source #

viewpoint :: RectHexGrid -> Index RectHexGrid -> [(Index RectHexGrid, Int)] Source #

isAdjacent :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> Bool Source #

adjacentTilesToward :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> [Index RectHexGrid] Source #

minimalPaths :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> [[Index RectHexGrid]] Source #

directionTo :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> [Direction RectHexGrid] Source #

defaultMinDistance :: RectHexGrid -> [Index RectHexGrid] -> Index RectHexGrid -> Int Source #

defaultNeighbours :: RectHexGrid -> Index RectHexGrid -> [Index RectHexGrid] Source #

defaultNeighboursOfSet :: RectHexGrid -> [Index RectHexGrid] -> [Index RectHexGrid] Source #

defaultNeighbour :: RectHexGrid -> Index RectHexGrid -> Direction RectHexGrid -> Maybe (Index RectHexGrid) Source #

defaultTileCount :: RectHexGrid -> Int Source #

defaultEdges :: RectHexGrid -> [(Index RectHexGrid, Index RectHexGrid)] Source #

defaultIsAdjacent :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> Bool Source #

defaultAdjacentTilesToward :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> [Index RectHexGrid] Source #

defaultMinimalPaths :: RectHexGrid -> Index RectHexGrid -> Index RectHexGrid -> [[Index RectHexGrid]] Source #

Grid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

Associated Types

type Index HexHexGrid :: Type Source #

type Direction HexHexGrid :: Type Source #

Methods

indices :: HexHexGrid -> [Index HexHexGrid] Source #

distance :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Int Source #

minDistance :: HexHexGrid -> [Index HexHexGrid] -> Index HexHexGrid -> Int Source #

neighbours :: HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

neighboursOfSet :: HexHexGrid -> [Index HexHexGrid] -> [Index HexHexGrid] Source #

neighbour :: HexHexGrid -> Index HexHexGrid -> Direction HexHexGrid -> Maybe (Index HexHexGrid) Source #

numNeighbours :: HexHexGrid -> Index HexHexGrid -> Int Source #

contains :: HexHexGrid -> Index HexHexGrid -> Bool Source #

tileCount :: HexHexGrid -> Int Source #

null :: HexHexGrid -> Bool Source #

nonNull :: HexHexGrid -> Bool Source #

edges :: HexHexGrid -> [(Index HexHexGrid, Index HexHexGrid)] Source #

viewpoint :: HexHexGrid -> Index HexHexGrid -> [(Index HexHexGrid, Int)] Source #

isAdjacent :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Bool Source #

adjacentTilesToward :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

minimalPaths :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [[Index HexHexGrid]] Source #

directionTo :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Direction HexHexGrid] Source #

defaultMinDistance :: HexHexGrid -> [Index HexHexGrid] -> Index HexHexGrid -> Int Source #

defaultNeighbours :: HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

defaultNeighboursOfSet :: HexHexGrid -> [Index HexHexGrid] -> [Index HexHexGrid] Source #

defaultNeighbour :: HexHexGrid -> Index HexHexGrid -> Direction HexHexGrid -> Maybe (Index HexHexGrid) Source #

defaultTileCount :: HexHexGrid -> Int Source #

defaultEdges :: HexHexGrid -> [(Index HexHexGrid, Index HexHexGrid)] Source #

defaultIsAdjacent :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Bool Source #

defaultAdjacentTilesToward :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

defaultMinimalPaths :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [[Index HexHexGrid]] Source #

Grid UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

Methods

indices :: UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

distance :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Int Source #

minDistance :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> Index UnboundedHexGrid -> Int Source #

neighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

neighboursOfSet :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> [Index UnboundedHexGrid] Source #

neighbour :: UnboundedHexGrid -> Index UnboundedHexGrid -> Direction UnboundedHexGrid -> Maybe (Index UnboundedHexGrid) Source #

numNeighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> Int Source #

contains :: UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

tileCount :: UnboundedHexGrid -> Int Source #

null :: UnboundedHexGrid -> Bool Source #

nonNull :: UnboundedHexGrid -> Bool Source #

edges :: UnboundedHexGrid -> [(Index UnboundedHexGrid, Index UnboundedHexGrid)] Source #

viewpoint :: UnboundedHexGrid -> Index UnboundedHexGrid -> [(Index UnboundedHexGrid, Int)] Source #

isAdjacent :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

adjacentTilesToward :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

minimalPaths :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [[Index UnboundedHexGrid]] Source #

directionTo :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Direction UnboundedHexGrid] Source #

defaultMinDistance :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> Index UnboundedHexGrid -> Int Source #

defaultNeighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

defaultNeighboursOfSet :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> [Index UnboundedHexGrid] Source #

defaultNeighbour :: UnboundedHexGrid -> Index UnboundedHexGrid -> Direction UnboundedHexGrid -> Maybe (Index UnboundedHexGrid) Source #

defaultTileCount :: UnboundedHexGrid -> Int Source #

defaultEdges :: UnboundedHexGrid -> [(Index UnboundedHexGrid, Index UnboundedHexGrid)] Source #

defaultIsAdjacent :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

defaultAdjacentTilesToward :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

defaultMinimalPaths :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [[Index UnboundedHexGrid]] Source #

Grid ParaHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

Associated Types

type Index ParaHexGrid :: Type Source #

type Direction ParaHexGrid :: Type Source #

Methods

indices :: ParaHexGrid -> [Index ParaHexGrid] Source #

distance :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> Int Source #

minDistance :: ParaHexGrid -> [Index ParaHexGrid] -> Index ParaHexGrid -> Int Source #

neighbours :: ParaHexGrid -> Index ParaHexGrid -> [Index ParaHexGrid] Source #

neighboursOfSet :: ParaHexGrid -> [Index ParaHexGrid] -> [Index ParaHexGrid] Source #

neighbour :: ParaHexGrid -> Index ParaHexGrid -> Direction ParaHexGrid -> Maybe (Index ParaHexGrid) Source #

numNeighbours :: ParaHexGrid -> Index ParaHexGrid -> Int Source #

contains :: ParaHexGrid -> Index ParaHexGrid -> Bool Source #

tileCount :: ParaHexGrid -> Int Source #

null :: ParaHexGrid -> Bool Source #

nonNull :: ParaHexGrid -> Bool Source #

edges :: ParaHexGrid -> [(Index ParaHexGrid, Index ParaHexGrid)] Source #

viewpoint :: ParaHexGrid -> Index ParaHexGrid -> [(Index ParaHexGrid, Int)] Source #

isAdjacent :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> Bool Source #

adjacentTilesToward :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> [Index ParaHexGrid] Source #

minimalPaths :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> [[Index ParaHexGrid]] Source #

directionTo :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> [Direction ParaHexGrid] Source #

defaultMinDistance :: ParaHexGrid -> [Index ParaHexGrid] -> Index ParaHexGrid -> Int Source #

defaultNeighbours :: ParaHexGrid -> Index ParaHexGrid -> [Index ParaHexGrid] Source #

defaultNeighboursOfSet :: ParaHexGrid -> [Index ParaHexGrid] -> [Index ParaHexGrid] Source #

defaultNeighbour :: ParaHexGrid -> Index ParaHexGrid -> Direction ParaHexGrid -> Maybe (Index ParaHexGrid) Source #

defaultTileCount :: ParaHexGrid -> Int Source #

defaultEdges :: ParaHexGrid -> [(Index ParaHexGrid, Index ParaHexGrid)] Source #

defaultIsAdjacent :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> Bool Source #

defaultAdjacentTilesToward :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> [Index ParaHexGrid] Source #

defaultMinimalPaths :: ParaHexGrid -> Index ParaHexGrid -> Index ParaHexGrid -> [[Index ParaHexGrid]] Source #

Grid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

Associated Types

type Index HexHexGrid :: Type Source #

type Direction HexHexGrid :: Type Source #

Methods

indices :: HexHexGrid -> [Index HexHexGrid] Source #

distance :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Int Source #

minDistance :: HexHexGrid -> [Index HexHexGrid] -> Index HexHexGrid -> Int Source #

neighbours :: HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

neighboursOfSet :: HexHexGrid -> [Index HexHexGrid] -> [Index HexHexGrid] Source #

neighbour :: HexHexGrid -> Index HexHexGrid -> Direction HexHexGrid -> Maybe (Index HexHexGrid) Source #

numNeighbours :: HexHexGrid -> Index HexHexGrid -> Int Source #

contains :: HexHexGrid -> Index HexHexGrid -> Bool Source #

tileCount :: HexHexGrid -> Int Source #

null :: HexHexGrid -> Bool Source #

nonNull :: HexHexGrid -> Bool Source #

edges :: HexHexGrid -> [(Index HexHexGrid, Index HexHexGrid)] Source #

viewpoint :: HexHexGrid -> Index HexHexGrid -> [(Index HexHexGrid, Int)] Source #

isAdjacent :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Bool Source #

adjacentTilesToward :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

minimalPaths :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [[Index HexHexGrid]] Source #

directionTo :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Direction HexHexGrid] Source #

defaultMinDistance :: HexHexGrid -> [Index HexHexGrid] -> Index HexHexGrid -> Int Source #

defaultNeighbours :: HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

defaultNeighboursOfSet :: HexHexGrid -> [Index HexHexGrid] -> [Index HexHexGrid] Source #

defaultNeighbour :: HexHexGrid -> Index HexHexGrid -> Direction HexHexGrid -> Maybe (Index HexHexGrid) Source #

defaultTileCount :: HexHexGrid -> Int Source #

defaultEdges :: HexHexGrid -> [(Index HexHexGrid, Index HexHexGrid)] Source #

defaultIsAdjacent :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> Bool Source #

defaultAdjacentTilesToward :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [Index HexHexGrid] Source #

defaultMinimalPaths :: HexHexGrid -> Index HexHexGrid -> Index HexHexGrid -> [[Index HexHexGrid]] Source #

Grid UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

Methods

indices :: UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

distance :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Int Source #

minDistance :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> Index UnboundedHexGrid -> Int Source #

neighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

neighboursOfSet :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> [Index UnboundedHexGrid] Source #

neighbour :: UnboundedHexGrid -> Index UnboundedHexGrid -> Direction UnboundedHexGrid -> Maybe (Index UnboundedHexGrid) Source #

numNeighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> Int Source #

contains :: UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

tileCount :: UnboundedHexGrid -> Int Source #

null :: UnboundedHexGrid -> Bool Source #

nonNull :: UnboundedHexGrid -> Bool Source #

edges :: UnboundedHexGrid -> [(Index UnboundedHexGrid, Index UnboundedHexGrid)] Source #

viewpoint :: UnboundedHexGrid -> Index UnboundedHexGrid -> [(Index UnboundedHexGrid, Int)] Source #

isAdjacent :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

adjacentTilesToward :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

minimalPaths :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [[Index UnboundedHexGrid]] Source #

directionTo :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Direction UnboundedHexGrid] Source #

defaultMinDistance :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> Index UnboundedHexGrid -> Int Source #

defaultNeighbours :: UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

defaultNeighboursOfSet :: UnboundedHexGrid -> [Index UnboundedHexGrid] -> [Index UnboundedHexGrid] Source #

defaultNeighbour :: UnboundedHexGrid -> Index UnboundedHexGrid -> Direction UnboundedHexGrid -> Maybe (Index UnboundedHexGrid) Source #

defaultTileCount :: UnboundedHexGrid -> Int Source #

defaultEdges :: UnboundedHexGrid -> [(Index UnboundedHexGrid, Index UnboundedHexGrid)] Source #

defaultIsAdjacent :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> Bool Source #

defaultAdjacentTilesToward :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [Index UnboundedHexGrid] Source #

defaultMinimalPaths :: UnboundedHexGrid -> Index UnboundedHexGrid -> Index UnboundedHexGrid -> [[Index UnboundedHexGrid]] Source #

Grid g => Grid (LGridMap g v) Source # 
Instance details

Defined in Math.Geometry.GridMap.Lazy

Associated Types

type Index (LGridMap g v) :: Type Source #

type Direction (LGridMap g v) :: Type Source #

Methods

indices :: LGridMap g v -> [Index (LGridMap g v)] Source #

distance :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> Int Source #

minDistance :: LGridMap g v -> [Index (LGridMap g v)] -> Index (LGridMap g v) -> Int Source #

neighbours :: LGridMap g v -> Index (LGridMap g v) -> [Index (LGridMap g v)] Source #

neighboursOfSet :: LGridMap g v -> [Index (LGridMap g v)] -> [Index (LGridMap g v)] Source #

neighbour :: LGridMap g v -> Index (LGridMap g v) -> Direction (LGridMap g v) -> Maybe (Index (LGridMap g v)) Source #

numNeighbours :: LGridMap g v -> Index (LGridMap g v) -> Int Source #

contains :: LGridMap g v -> Index (LGridMap g v) -> Bool Source #

tileCount :: LGridMap g v -> Int Source #

null :: LGridMap g v -> Bool Source #

nonNull :: LGridMap g v -> Bool Source #

edges :: LGridMap g v -> [(Index (LGridMap g v), Index (LGridMap g v))] Source #

viewpoint :: LGridMap g v -> Index (LGridMap g v) -> [(Index (LGridMap g v), Int)] Source #

isAdjacent :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> Bool Source #

adjacentTilesToward :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> [Index (LGridMap g v)] Source #

minimalPaths :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> [[Index (LGridMap g v)]] Source #

directionTo :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> [Direction (LGridMap g v)] Source #

defaultMinDistance :: LGridMap g v -> [Index (LGridMap g v)] -> Index (LGridMap g v) -> Int Source #

defaultNeighbours :: LGridMap g v -> Index (LGridMap g v) -> [Index (LGridMap g v)] Source #

defaultNeighboursOfSet :: LGridMap g v -> [Index (LGridMap g v)] -> [Index (LGridMap g v)] Source #

defaultNeighbour :: LGridMap g v -> Index (LGridMap g v) -> Direction (LGridMap g v) -> Maybe (Index (LGridMap g v)) Source #

defaultTileCount :: LGridMap g v -> Int Source #

defaultEdges :: LGridMap g v -> [(Index (LGridMap g v), Index (LGridMap g v))] Source #

defaultIsAdjacent :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> Bool Source #

defaultAdjacentTilesToward :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> [Index (LGridMap g v)] Source #

defaultMinimalPaths :: LGridMap g v -> Index (LGridMap g v) -> Index (LGridMap g v) -> [[Index (LGridMap g v)]] Source #

type family Index g Source #

Instances
type Index XCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index YCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index TorTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index RectTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index ParaTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index TriTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index UnboundedTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Index TorSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Index RectSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Index UnboundedSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Index TorOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Index RectOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Index UnboundedOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Index RectHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Index HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Index UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Index ParaHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Index HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Index UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Index (LGridMap g v) Source # 
Instance details

Defined in Math.Geometry.GridMap.Lazy

type Index (LGridMap g v) = Index g

type family Direction g Source #

Instances
type Direction XCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction YCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction TorTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction RectTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction ParaTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction TriTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction UnboundedTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

type Direction TorSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Direction RectSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Direction UnboundedSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

type Direction TorOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Direction RectOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Direction UnboundedOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

type Direction RectHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Direction HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Direction UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

type Direction ParaHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Direction HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Direction UnboundedHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

type Direction (LGridMap g v) Source # 
Instance details

Defined in Math.Geometry.GridMap.Lazy

Finite grids

class Grid g => FiniteGrid g where Source #

A regular arrangement of tiles where the number of tiles is finite. Minimal complete definition: size, maxPossibleDistance.

Associated Types

type Size g Source #

Methods

size :: g -> Size g Source #

Returns the dimensions of the grid. For example, if g is a 4x3 rectangular grid, size g would return (4, 3), while tileCount g would return 12.

maxPossibleDistance :: g -> Int Source #

Returns the largest possible distance between two tiles in the grid.

Instances
FiniteGrid XCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size XCylTriGrid :: Type Source #

FiniteGrid YCylTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size YCylTriGrid :: Type Source #

FiniteGrid TorTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size TorTriGrid :: Type Source #

FiniteGrid RectTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size RectTriGrid :: Type Source #

FiniteGrid ParaTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size ParaTriGrid :: Type Source #

FiniteGrid TriTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

Associated Types

type Size TriTriGrid :: Type Source #

FiniteGrid TorSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

Associated Types

type Size TorSquareGrid :: Type Source #

FiniteGrid RectSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

Associated Types

type Size RectSquareGrid :: Type Source #

FiniteGrid TorOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

Associated Types

type Size TorOctGrid :: Type Source #

FiniteGrid RectOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

Associated Types

type Size RectOctGrid :: Type Source #

FiniteGrid RectHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

Associated Types

type Size RectHexGrid :: Type Source #

FiniteGrid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

Associated Types

type Size HexHexGrid :: Type Source #

FiniteGrid ParaHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

Associated Types

type Size ParaHexGrid :: Type Source #

FiniteGrid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

Associated Types

type Size HexHexGrid :: Type Source #

FiniteGrid g => FiniteGrid (LGridMap g v) Source # 
Instance details

Defined in Math.Geometry.GridMap.Lazy

Associated Types

type Size (LGridMap g v) :: Type Source #

Bounded grids

class Grid g => BoundedGrid g where Source #

A regular arrangement of tiles with an edge. Minimal complete definition: tileSideCount.

Minimal complete definition

tileSideCount

Methods

tileSideCount :: g -> Int Source #

Returns the number of sides a tile has

boundary :: Eq (Index g) => g -> [Index g] Source #

Returns a the indices of all the tiles at the boundary of a grid.

isBoundary :: Eq (Index g) => g -> Index g -> Bool Source #

isBoundary g a' returns True if the tile with index a is on a boundary of g, False otherwise. (Corner tiles are also boundary tiles.)

centre :: Eq (Index g) => g -> [Index g] Source #

Returns the index of the tile(s) that require the maximum number of moves to reach the nearest boundary tile. A grid may have more than one central tile (e.g., a rectangular grid with an even number of rows and columns will have four central tiles).

isCentre :: Eq (Index g) => g -> Index g -> Bool Source #

isCentre g a' returns True if the tile with index a is a centre tile of g, False otherwise.

defaultBoundary :: Eq (Index g) => g -> [Index g] Source #

defaultIsBoundary :: Eq (Index g) => g -> Index g -> Bool Source #

defaultCentre :: Eq (Index g) => g -> [Index g] Source #

defaultIsCentre :: Eq (Index g) => g -> Index g -> Bool Source #

Instances
BoundedGrid RectTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

BoundedGrid ParaTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

BoundedGrid TriTriGrid Source # 
Instance details

Defined in Math.Geometry.Grid.TriangularInternal

BoundedGrid RectSquareGrid Source # 
Instance details

Defined in Math.Geometry.Grid.SquareInternal

BoundedGrid RectOctGrid Source # 
Instance details

Defined in Math.Geometry.Grid.OctagonalInternal

BoundedGrid RectHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

BoundedGrid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal2

BoundedGrid ParaHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

BoundedGrid HexHexGrid Source # 
Instance details

Defined in Math.Geometry.Grid.HexagonalInternal

BoundedGrid g => BoundedGrid (LGridMap g v) Source # 
Instance details

Defined in Math.Geometry.GridMap.Lazy