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

A DijkstraAtlas object holds DijkstraGrid objects for each tile.
More...

Collaboration diagram for Caskev.GridToolkit.DijkstraAtlas:
[legend]

Public Member Functions

bool HasPath< T > (T[,] grid, T startTile, T destinationTile)
 Is there a path between two tiles.
 
GetNextTile< T > (T[,] grid, T startTile, T destinationTile)
 Get the next tile on the path between a start tile and a destination tile.
 
TileDirection GetNextDirection< T > (T[,] grid, T startTile, T destinationTile)
 Get the next tile on the path between a start tile and a destination tile.
 
float GetDistanceBetweenTiles< T > (T[,] grid, T startTile, T destinationTile)
 Get the distance between two tiles.
 
T[] GetPath< T > (T[,] grid, T startTile, T destinationTile, bool includeStart=true, bool includeDestination=true)
 Get all the tiles on the path from a start tile to a destination tile. If there is no path between the two tiles then an empty array will be returned.
 
byte[] ToByteArray ()
 Serializes a DijkstraAtlas to a byte array.
 
Task< byte[]> ToByteArrayAsync (IProgress< float > progress=null, CancellationToken cancelToken=default)
 Asynchronously serializes a DijkstraAtlas to a byte array.
 
async Awaitable< byte[]> ToByteArrayAwaitable (IProgress< float > progress=null, CancellationToken cancelToken=default)
 Asynchronously serializes a DijkstraAtlas to a byte array.
 

Static Public Member Functions

static DijkstraAtlas FromByteArray< T > (T[,] grid, byte[] bytes)
 Deserializes a DijkstraAtlas from a byte array.
 
static Task< DijkstraAtlasFromByteArrayAsync< T > (T[,] grid, byte[] bytes, IProgress< float > progress=null, CancellationToken cancelToken=default)
 Asynchronously deserializes a DijkstraAtlas from a byte array.
 
static async Awaitable< DijkstraAtlasFromByteArrayAwaitable< T > (T[,] grid, byte[] bytes, IProgress< float > progress=null, CancellationToken cancelToken=default)
 Asynchronously deserializes a DijkstraAtlas from a byte array.
 

Detailed Description

A DijkstraAtlas object holds DijkstraGrid objects for each tile.

Member Function Documentation

◆ FromByteArray< T >()

static DijkstraAtlas Caskev.GridToolkit.DijkstraAtlas.FromByteArray< T > ( grid[,],
byte[]  bytes 
)
static

Deserializes a DijkstraAtlas from a byte array.

Parameters
gridThe user grid.
bytesThe serialized DijkstraAtlas.
Returns
The deserialized DijkstraAtlas.
Type Constraints
T :ITile 

◆ FromByteArrayAsync< T >()

static Task< DijkstraAtlas > Caskev.GridToolkit.DijkstraAtlas.FromByteArrayAsync< T > ( grid[,],
byte[]  bytes,
IProgress< float >  progress = null,
CancellationToken  cancelToken = default 
)
static

Asynchronously deserializes a DijkstraAtlas from a byte array.

Parameters
gridThe user grid.
bytesThe serialized DijkstraAtlas.
progressAn optional IProgress object to get the deserialization progression
cancelTokenAn optional CancellationToken object to cancel the deserialization
Returns
The deserialized DijkstraAtlas.
Type Constraints
T :ITile 

◆ FromByteArrayAwaitable< T >()

static async Awaitable< DijkstraAtlas > Caskev.GridToolkit.DijkstraAtlas.FromByteArrayAwaitable< T > ( grid[,],
byte[]  bytes,
IProgress< float >  progress = null,
CancellationToken  cancelToken = default 
)
static

Asynchronously deserializes a DijkstraAtlas from a byte array.

Parameters
gridThe user grid.
bytesThe serialized DijkstraAtlas.
progressAn optional IProgress object to get the deserialization progression
cancelTokenAn optional CancellationToken object to cancel the deserialization
Returns
The deserialized DijkstraAtlas.
Type Constraints
T :ITile 

◆ GetDistanceBetweenTiles< T >()

float Caskev.GridToolkit.DijkstraAtlas.GetDistanceBetweenTiles< T > ( grid[,],
startTile,
destinationTile 
)

Get the distance between two tiles.

Parameters
gridThe user grid
startTileThe start tile
destinationTileThe destination tile
Returns
The distance between the two tiles.
Type Constraints
T :IWeightedTile 

◆ GetNextDirection< T >()

TileDirection Caskev.GridToolkit.DijkstraAtlas.GetNextDirection< T > ( grid[,],
startTile,
destinationTile 
)

Get the next tile on the path between a start tile and a destination tile.

Parameters
gridThe user grid
startTileThe start tile
destinationTileThe destination tile
Returns
A Vector2Int direction
Type Constraints
T :IWeightedTile 

◆ GetNextTile< T >()

T Caskev.GridToolkit.DijkstraAtlas.GetNextTile< T > ( grid[,],
startTile,
destinationTile 
)

Get the next tile on the path between a start tile and a destination tile.

Parameters
gridThe user grid
startTileThe start tile
destinationTileThe destination tile
Returns
A tile object
Type Constraints
T :IWeightedTile 

◆ GetPath< T >()

T[] Caskev.GridToolkit.DijkstraAtlas.GetPath< T > ( grid[,],
startTile,
destinationTile,
bool  includeStart = true,
bool  includeDestination = true 
)

Get all the tiles on the path from a start tile to a destination tile. If there is no path between the two tiles then an empty array will be returned.

Parameters
gridThe user grid
startTileThe start tile
destinationTileThe destination tile
includeStartInclude the start tile into the resulting array or not. Default is true
includeDestinationInclude the target tile into the resulting array or not
Returns
An array of tiles
Type Constraints
T :IWeightedTile 

◆ HasPath< T >()

bool Caskev.GridToolkit.DijkstraAtlas.HasPath< T > ( grid[,],
startTile,
destinationTile 
)

Is there a path between two tiles.

Parameters
gridThe user grid
startTileThe start tile
destinationTileThe destination tile
Returns
A boolean value
Type Constraints
T :IWeightedTile 

◆ ToByteArray()

byte[] Caskev.GridToolkit.DijkstraAtlas.ToByteArray ( )

Serializes a DijkstraAtlas to a byte array.

Returns
The serialized DijkstraAtlas.

◆ ToByteArrayAsync()

Task< byte[]> Caskev.GridToolkit.DijkstraAtlas.ToByteArrayAsync ( IProgress< float >  progress = null,
CancellationToken  cancelToken = default 
)

Asynchronously serializes a DijkstraAtlas to a byte array.

Parameters
progressAn optional IProgress object to get the deserialization progression
cancelTokenAn optional CancellationToken object to cancel the serialization
Returns
The serialized DijkstraAtlas.

◆ ToByteArrayAwaitable()

async Awaitable< byte[]> Caskev.GridToolkit.DijkstraAtlas.ToByteArrayAwaitable ( IProgress< float >  progress = null,
CancellationToken  cancelToken = default 
)

Asynchronously serializes a DijkstraAtlas to a byte array.

Parameters
progressAn optional IProgress object to get the deserialization progression
cancelTokenAn optional CancellationToken object to cancel the serialization
Returns
The serialized DijkstraAtlas.

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