Unity Grid Toolkit
Utilitary API to proceed operations on abstract grids such as tile extraction, raycasting, and pathfinding.
Loading...
Searching...
No Matches
Caskev.GridToolkit.Extraction Class Reference

Allows you to extract tiles on a grid.
Provides shape extraction (rectangles, circles, cones and lines) and neighbors extraction with a lot of parameters. More...

Static Public Member Functions

static T[] GetTilesInARectangle< T > (T[,] grid, T center, Vector2Int rectangleExtends, bool includeCenter=true, bool includeWalls=true)
 Get tiles in a rectangle around a center tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesOnARectangleOutline< T > (T[,] grid, T center, Vector2Int rectangleExtends, bool includeWalls=true)
 Get tiles on a rectangle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesInACircle< T > (T[,] grid, T center, int radius, bool includeCenter=true, bool includeWalls=true)
 Get tiles in a circle around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesOnACircleOutline< T > (T[,] grid, T center, int radius, bool includeWalls=true)
 Get tiles on a circle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesInACone< T > (T[,] grid, T start, T destinationTile, float openingAngle, bool includeStart=true, bool includeWalls=true)
 Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesInACone< T > (T[,] grid, T start, int length, float openingAngle, float directionAngle, bool includeStart=true, bool includeWalls=true)
 Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesInACone< T > (T[,] grid, T start, int length, float openingAngle, Vector2 direction, bool includeStart=true, bool includeWalls=true)
 Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesInACone< T > (T[,] grid, T start, Vector2Int endPosition, float openingAngle, bool includeStart=true, bool includeWalls=true)
 Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
 
static T[] GetTilesOnALine< T > (T[,] grid, T startTile, T destinationTile, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true)
 Get all visible tiles from a start tile's cone of vision

 
static T[] GetTilesOnALine< T > (T[,] grid, T startTile, int length, float directionAngle, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true)
 Get all visible tiles from a start tile's cone of vision

 
static T[] GetTilesOnALine< T > (T[,] grid, T startTile, int length, Vector2 direction, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true)
 Get all visible tiles from a start tile's cone of vision

 
static T[] GetTilesOnALine< T > (T[,] grid, T startTile, Vector2Int endPosition, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true)
 Get all visible tiles from a start tile's cone of vision

 
static bool GetTileNeighbour< T > (T[,] grid, T tile, float neighbourDirectionAngle, out T neighbour, bool includeWalls=true)
 Get neighbour of a tile if it exists.
 
static bool GetTileNeighbour< T > (T[,] grid, T tile, Vector2Int neighbourDirection, out T neighbour, bool includeWalls=true)
 Get neighbour of a tile if it exists.
 
static T[] GetTileNeighbours< T > (T[,] grid, T tile, bool includeWalls)
 Get the eight neighbours of a tile when they exist.
 
static T[] GetTileOrthogonalsNeighbours< T > (T[,] grid, T tile, bool includeWalls)
 Get the four orthogonals neighbours of a tile when they exist.
 
static T[] GetTileDiagonalsNeighbours< T > (T[,] grid, T tile, bool includeWalls)
 Get the four diagonals neighbours of a tile when they exist.
 
static bool IsTileInARectangle< T > (T[,] grid, T tile, T center, Vector2Int rectangleExtends)
 Is this tile in a rectangle or not.
 
static bool IsTileOnARectangleOutline< T > (T[,] grid, T tile, T center, Vector2Int rectangleExtends)
 Is this tile on a rectangle outline or not.
 
static bool IsTileInACircle< T > (T[,] grid, T tile, T center, int radius)
 Is this tile in a circle or not.
 
static bool IsTileOnACircleOutline< T > (T[,] grid, T tile, T center, int radius)
 Is this tile on a circle outline or not.
 
static bool IsTileInACone< T > (T[,] grid, T tile, T center, T destinationTile, float openingAngle)
 Is this tile on a cone or not.
 
static bool IsTileInACone< T > (T[,] grid, T tile, T center, Vector2Int endPosition, float openingAngle)
 Is this tile on a cone or not.
 
static bool IsTileInACone< T > (T[,] grid, T tile, T center, int length, float openingAngle, float directionAngle)
 Is this tile on a cone or not.
 
static bool IsTileInACone< T > (T[,] grid, T tile, T center, int length, float openingAngle, Vector2 direction)
 Is this tile on a cone or not.
 
static bool IsTileOnALine< T > (T[,] grid, T tile, T start, T destinationTile, bool allowDiagonals=true, bool favorVertical=false)
 Is a tile on a line.
 
static bool IsTileOnALine< T > (T[,] grid, T tile, T start, int length, float directionAngle, bool allowDiagonals=true, bool favorVertical=false)
 Is a tile on a line.
 
static bool IsTileOnALine< T > (T[,] grid, T tile, T start, int length, Vector2 direction, bool allowDiagonals=true, bool favorVertical=false)
 Is a tile on a line.
 
static bool IsTileOnALine< T > (T[,] grid, T start, T tile, Vector2Int endPosition, bool allowDiagonals=true, bool favorVertical=false)
 Is a tile on a line.
 
static bool IsTileNeighbor< T > (T neighbour, T center, float neighbourDirectionAngle, bool includeWalls=true)
 Is a tile the neighbour of another tile with the given direction.
 
static bool IsTileNeighbor< T > (T neighbour, T center, Vector2Int neighbourDirection, bool includeWalls=true)
 Is a tile the neighbour of another tile with the given direction.
 
static bool IsTileOrthogonalNeighbor< T > (T neighbour, T center, bool includeWalls=true)
 Is a tile an orthogonal neighbour of another tile.
 
static bool IsTileDiagonalNeighbor< T > (T neighbour, T center, bool includeWalls=true)
 Is a tile an diagonal neighbour of another tile.
 
static bool IsTileAnyNeighbor< T > (T neighbour, T center, bool includeWalls=true)
 Is a tile any neighbour of another tile.
 

Detailed Description

Allows you to extract tiles on a grid.
Provides shape extraction (rectangles, circles, cones and lines) and neighbors extraction with a lot of parameters.

Member Function Documentation

◆ GetTileDiagonalsNeighbours< T >()

static T[] Caskev.GridToolkit.Extraction.GetTileDiagonalsNeighbours< T > ( grid[,],
tile,
bool  includeWalls 
)
static

Get the four diagonals neighbours of a tile when they exist.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTileNeighbour< T >() [1/2]

static bool Caskev.GridToolkit.Extraction.GetTileNeighbour< T > ( grid[,],
tile,
float  neighbourDirectionAngle,
out T  neighbour,
bool  includeWalls = true 
)
static

Get neighbour of a tile if it exists.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
neighbourDirectionAngleThe neighbour direction angle in degrees [0-360]. 0 represents a direction pointing to the right in 2D coordinates
neighbourThe neighbour of a tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
Returns true if the neighbour exists, false otherwise
Type Constraints
T :ITile 

◆ GetTileNeighbour< T >() [2/2]

static bool Caskev.GridToolkit.Extraction.GetTileNeighbour< T > ( grid[,],
tile,
Vector2Int  neighbourDirection,
out T  neighbour,
bool  includeWalls = true 
)
static

Get neighbour of a tile if it exists.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
neighbourDirectionThe direction from the tile to the desired neighbour
neighbourThe neighbour of a tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
Returns true if the neighbour exists, false otherwise
Type Constraints
T :ITile 

◆ GetTileNeighbours< T >()

static T[] Caskev.GridToolkit.Extraction.GetTileNeighbours< T > ( grid[,],
tile,
bool  includeWalls 
)
static

Get the eight neighbours of a tile when they exist.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTileOrthogonalsNeighbours< T >()

static T[] Caskev.GridToolkit.Extraction.GetTileOrthogonalsNeighbours< T > ( grid[,],
tile,
bool  includeWalls 
)
static

Get the four orthogonals neighbours of a tile when they exist.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInACircle< T >()

static T[] Caskev.GridToolkit.Extraction.GetTilesInACircle< T > ( grid[,],
center,
int  radius,
bool  includeCenter = true,
bool  includeWalls = true 
)
static

Get tiles in a circle around a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
centerThe center tile
radiusThe circle radius
includeCenterInclude the center tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInACone< T >() [1/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesInACone< T > ( grid[,],
start,
int  length,
float  openingAngle,
float  directionAngle,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startThe start tile
lengthThe cone length
openingAngleThe cone opening angle in degrees [1-360]
directionAngleThe cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInACone< T >() [2/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesInACone< T > ( grid[,],
start,
int  length,
float  openingAngle,
Vector2  direction,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startThe start tile
lengthThe cone length
openingAngleThe cone opening angle in degrees [1-360]
directionThe Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInACone< T >() [3/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesInACone< T > ( grid[,],
start,
destinationTile,
float  openingAngle,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startThe start tile
destinationTileThe destination tile
openingAngleThe cone opening angle in degrees [1-360]
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInACone< T >() [4/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesInACone< T > ( grid[,],
start,
Vector2Int  endPosition,
float  openingAngle,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startThe start tile
endPositionThe destination virtual coordinates (do not need to be into grid range)
openingAngleThe cone opening angle in degrees [1-360]
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesInARectangle< T >()

static T[] Caskev.GridToolkit.Extraction.GetTilesInARectangle< T > ( grid[,],
center,
Vector2Int  rectangleExtends,
bool  includeCenter = true,
bool  includeWalls = true 
)
static

Get tiles in a rectangle around a center tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
centerThe center tile
rectangleExtendsThe Vector2Int representing the extends of the rectangle from the center
includeCenterInclude the center tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnACircleOutline< T >()

static T[] Caskev.GridToolkit.Extraction.GetTilesOnACircleOutline< T > ( grid[,],
center,
int  radius,
bool  includeWalls = true 
)
static

Get tiles on a circle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
centerThe center tile
radiusThe circle radius
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnALine< T >() [1/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesOnALine< T > ( grid[,],
startTile,
int  length,
float  directionAngle,
bool  allowDiagonals = true,
bool  favorVertical = false,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get all visible tiles from a start tile's cone of vision

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startTileThe start tile
lengthThe length of the line
directionAngleThe angle of the line from the start tile
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnALine< T >() [2/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesOnALine< T > ( grid[,],
startTile,
int  length,
Vector2  direction,
bool  allowDiagonals = true,
bool  favorVertical = false,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get all visible tiles from a start tile's cone of vision

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startTileThe start tile
lengthThe length of the line
directionThe direction of the line from the start tile
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnALine< T >() [3/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesOnALine< T > ( grid[,],
startTile,
destinationTile,
bool  allowDiagonals = true,
bool  favorVertical = false,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get all visible tiles from a start tile's cone of vision

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startTileThe start tile
destinationTileThe destination tile
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnALine< T >() [4/4]

static T[] Caskev.GridToolkit.Extraction.GetTilesOnALine< T > ( grid[,],
startTile,
Vector2Int  endPosition,
bool  allowDiagonals = true,
bool  favorVertical = false,
bool  includeStart = true,
bool  includeWalls = true 
)
static

Get all visible tiles from a start tile's cone of vision

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
startTileThe start tile
endPositionThe destination virtual coordinates (do not need to be into grid range)
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
includeStartInclude the start tile into the resulting array or not. Default is true
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ GetTilesOnARectangleOutline< T >()

static T[] Caskev.GridToolkit.Extraction.GetTilesOnARectangleOutline< T > ( grid[,],
center,
Vector2Int  rectangleExtends,
bool  includeWalls = true 
)
static

Get tiles on a rectangle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
centerThe center tile
rectangleExtendsThe Vector2Int representing the extends of the rectangle from the center
includeWallsInclude the non-walkable tiles into the resulting array or not. Default true
Returns
An array of tiles
Type Constraints
T :ITile 

◆ IsTileAnyNeighbor< T >()

static bool Caskev.GridToolkit.Extraction.IsTileAnyNeighbor< T > ( neighbour,
center,
bool  includeWalls = true 
)
static

Is a tile any neighbour of another tile.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
neighbourThe tile to check as a neighbour
centerA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileDiagonalNeighbor< T >()

static bool Caskev.GridToolkit.Extraction.IsTileDiagonalNeighbor< T > ( neighbour,
center,
bool  includeWalls = true 
)
static

Is a tile an diagonal neighbour of another tile.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
neighbourThe tile to check as a neighbour
centerA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInACircle< T >()

static bool Caskev.GridToolkit.Extraction.IsTileInACircle< T > ( grid[,],
tile,
center,
int  radius 
)
static

Is this tile in a circle or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
radiusThe circle radius
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInACone< T >() [1/4]

static bool Caskev.GridToolkit.Extraction.IsTileInACone< T > ( grid[,],
tile,
center,
int  length,
float  openingAngle,
float  directionAngle 
)
static

Is this tile on a cone or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
lengthThe length of the cone
openingAngleThe cone opening angle in degrees [1-360]
directionAngleThe cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInACone< T >() [2/4]

static bool Caskev.GridToolkit.Extraction.IsTileInACone< T > ( grid[,],
tile,
center,
int  length,
float  openingAngle,
Vector2  direction 
)
static

Is this tile on a cone or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
lengthThe length of the cone
openingAngleThe cone opening angle in degrees [1-360]
directionThe Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInACone< T >() [3/4]

static bool Caskev.GridToolkit.Extraction.IsTileInACone< T > ( grid[,],
tile,
center,
destinationTile,
float  openingAngle 
)
static

Is this tile on a cone or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
destinationTileThe destination tile
openingAngleThe cone opening angle in degrees [1-360]
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInACone< T >() [4/4]

static bool Caskev.GridToolkit.Extraction.IsTileInACone< T > ( grid[,],
tile,
center,
Vector2Int  endPosition,
float  openingAngle 
)
static

Is this tile on a cone or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
endPositionThe destination virtual coordinates (do not need to be into grid range)
openingAngleThe cone opening angle in degrees [1-360]
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileInARectangle< T >()

static bool Caskev.GridToolkit.Extraction.IsTileInARectangle< T > ( grid[,],
tile,
center,
Vector2Int  rectangleExtends 
)
static

Is this tile in a rectangle or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
rectangleExtendsThe Vector2Int representing the extends of the rectangle from the center
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileNeighbor< T >() [1/2]

static bool Caskev.GridToolkit.Extraction.IsTileNeighbor< T > ( neighbour,
center,
float  neighbourDirectionAngle,
bool  includeWalls = true 
)
static

Is a tile the neighbour of another tile with the given direction.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
neighbourThe tile to check as a neighbour
centerA tile
neighbourDirectionAngleThe cone direction angle in degrees [0-360]. 0 represents a direction pointing to the right in 2D coordinates
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileNeighbor< T >() [2/2]

static bool Caskev.GridToolkit.Extraction.IsTileNeighbor< T > ( neighbour,
center,
Vector2Int  neighbourDirection,
bool  includeWalls = true 
)
static

Is a tile the neighbour of another tile with the given direction.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
neighbourThe tile to check as a neighbour
centerA tile
neighbourDirectionThe position of the expected neighbour from the tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnACircleOutline< T >()

static bool Caskev.GridToolkit.Extraction.IsTileOnACircleOutline< T > ( grid[,],
tile,
center,
int  radius 
)
static

Is this tile on a circle outline or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
radiusThe circle radius
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnALine< T >() [1/4]

static bool Caskev.GridToolkit.Extraction.IsTileOnALine< T > ( grid[,],
start,
tile,
Vector2Int  endPosition,
bool  allowDiagonals = true,
bool  favorVertical = false 
)
static

Is a tile on a line.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
startThe start tile of the line
endPositionThe line destination virtual coordinates (do not need to be into grid range)
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnALine< T >() [2/4]

static bool Caskev.GridToolkit.Extraction.IsTileOnALine< T > ( grid[,],
tile,
start,
int  length,
float  directionAngle,
bool  allowDiagonals = true,
bool  favorVertical = false 
)
static

Is a tile on a line.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
startThe start tile of the line
lengthThe length of the line
directionAngleThe cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnALine< T >() [3/4]

static bool Caskev.GridToolkit.Extraction.IsTileOnALine< T > ( grid[,],
tile,
start,
int  length,
Vector2  direction,
bool  allowDiagonals = true,
bool  favorVertical = false 
)
static

Is a tile on a line.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
startThe center tile of the rectangle
lengthThe length of the line
directionThe Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnALine< T >() [4/4]

static bool Caskev.GridToolkit.Extraction.IsTileOnALine< T > ( grid[,],
tile,
start,
destinationTile,
bool  allowDiagonals = true,
bool  favorVertical = false 
)
static

Is a tile on a line.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
startThe start tile of the line
destinationTileThe destination tile of the line
allowDiagonalsAllows the diagonals or not. Default is true
favorVerticalIf diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value.
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOnARectangleOutline< T >()

static bool Caskev.GridToolkit.Extraction.IsTileOnARectangleOutline< T > ( grid[,],
tile,
center,
Vector2Int  rectangleExtends 
)
static

Is this tile on a rectangle outline or not.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
gridA two-dimensional array of tiles
tileA tile
centerThe center tile of the rectangle
rectangleExtendsThe Vector2Int representing the extends of the rectangle from the center
Returns
A boolean value
Type Constraints
T :ITile 

◆ IsTileOrthogonalNeighbor< T >()

static bool Caskev.GridToolkit.Extraction.IsTileOrthogonalNeighbor< T > ( neighbour,
center,
bool  includeWalls = true 
)
static

Is a tile an orthogonal neighbour of another tile.

Template Parameters
TThe user-defined type representing a tile (needs to implement the ITile interface)
Parameters
neighbourThe tile to check as a neighbour
centerA tile
includeWallsInclude the non-walkable tiles into the resulting array or not. Default is true
Returns
A boolean value
Type Constraints
T :ITile 

The documentation for this class was generated from the following file: