Some utilitary methods.
More...
|
| static Vector2Int | NextNodeDirectionToVector2Int (TileDirection direction) |
| | Converts a TileDirection to a Vector2Int.
|
| |
| static TileDirection | GetDirectionBetweenAdjacentTiles (ITile tileA, ITile tileB) |
| | Gets the direction between two adjacent tiles.
|
| |
| static bool | TileEquals< T > (T tileA, T tileB) |
| | Compare two tiles to check if they share the same coordinates values.
|
| |
| static Vector2Int | ClampCoordsIntoGrid< T > (T[,] grid, int x, int y) |
| | Return clamped coordinates into the grid.
|
| |
| static bool | AreCoordsIntoGrid< T > (T[,] grid, int x, int y) |
| | Check if specific coordinates are into the grid range.
|
| |
| static T | GetTile< T > (T[,] grid, int x, int y) |
| | Returns a tile from the grid at specific coordinates.
|
| |
| static int | GetHorizontalLength< T > (T[,] grid) |
| | Returns the horizontal length of a grid.
|
| |
| static int | GetVerticalLength< T > (T[,] grid) |
| | Returns the vertical length of a grid.
|
| |
◆ AreCoordsIntoGrid< T >()
| static bool Caskev.GridToolkit.GridUtils.AreCoordsIntoGrid< T > |
( |
T |
grid[,], |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
static |
Check if specific coordinates are into the grid range.
- Template Parameters
-
- Parameters
-
| grid | A two-dimensional array |
| x | Horizontal coordinate to check |
| y | Vertical coordinate to check |
- Returns
- A boolean value
◆ ClampCoordsIntoGrid< T >()
| static Vector2Int Caskev.GridToolkit.GridUtils.ClampCoordsIntoGrid< T > |
( |
T |
grid[,], |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
static |
Return clamped coordinates into the grid.
- Template Parameters
-
- Parameters
-
| grid | A two-dimensional array |
| x | Horizontal coordinate to clamp |
| y | Vertical coordinate to clamp |
- Returns
- A Vector2Int representing the clamped coordinates
◆ GetDirectionBetweenAdjacentTiles()
Gets the direction between two adjacent tiles.
- Parameters
-
| tileA | The first tile |
| tileB | The second tile |
- Returns
- The direction from the first tile to the second tile.
◆ GetHorizontalLength< T >()
| static int Caskev.GridToolkit.GridUtils.GetHorizontalLength< T > |
( |
T |
grid[,] | ) |
|
|
static |
Returns the horizontal length of a grid.
- Template Parameters
-
- Parameters
-
| grid | A two-dimensional array |
- Returns
- The horizontal length of a grid
◆ GetTile< T >()
| static T Caskev.GridToolkit.GridUtils.GetTile< T > |
( |
T |
grid[,], |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
static |
Returns a tile from the grid at specific coordinates.
- Template Parameters
-
- Parameters
-
| grid | A two-dimensional array |
| x | Horizontal coordinate of the tile |
| y | Vertical coordinate of the tile |
- Returns
- A tile
◆ GetVerticalLength< T >()
| static int Caskev.GridToolkit.GridUtils.GetVerticalLength< T > |
( |
T |
grid[,] | ) |
|
|
static |
Returns the vertical length of a grid.
- Template Parameters
-
- Parameters
-
| grid | A two-dimensional array |
- Returns
- The vertical length of a grid
◆ NextNodeDirectionToVector2Int()
| static Vector2Int Caskev.GridToolkit.GridUtils.NextNodeDirectionToVector2Int |
( |
TileDirection |
direction | ) |
|
|
static |
Converts a TileDirection to a Vector2Int.
- Parameters
-
| direction | The TileDirection enumeration case |
- Returns
- The corresponding Vector2Int
◆ TileEquals< T >()
| static bool Caskev.GridToolkit.GridUtils.TileEquals< T > |
( |
T |
tileA, |
|
|
T |
tileB |
|
) |
| |
|
static |
Compare two tiles to check if they share the same coordinates values.
- Template Parameters
-
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
- Parameters
-
| tileA | The first tile |
| tileB | The second tile |
- Returns
- A boolean value
The documentation for this class was generated from the following file: