Class GridExtensions
Inheritance
System.Object
GridExtensions
Assembly: Sylves.dll
Syntax
public static class GridExtensions : Object
Methods
FindCell(IGrid, Vector3)
Finds the cell containg the give position
Declaration
public static Nullable<Cell> FindCell(this IGrid grid, Vector3 position)
Parameters
Returns
Type |
Description |
System.Nullable<Cell> |
|
GetMeshData(IGrid, Cell)
Declaration
public static MeshData GetMeshData(this IGrid grid, Cell cell)
Parameters
Returns
GetNeighbours(IGrid, Cell)
Returns all the cells that you can move to from a given cell.
Declaration
public static IEnumerable<Cell> GetNeighbours(this IGrid grid, Cell cell)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Cell> |
|
GetPolygon(IGrid, Cell)
Declaration
public static Vector3[] GetPolygon(this IGrid grid, Cell cell)
Parameters
Returns
Masked(IGrid, ISet<Cell>)
Declaration
public static IGrid Masked(this IGrid grid, ISet<Cell> allCells)
Parameters
Type |
Name |
Description |
IGrid |
grid |
|
System.Collections.Generic.ISet<Cell> |
allCells |
|
Returns
Masked(IGrid, Func<Cell, Boolean>, IEnumerable<Cell>)
Declaration
public static IGrid Masked(this IGrid grid, Func<Cell, bool> containsFunc, IEnumerable<Cell> allCells = null)
Parameters
Type |
Name |
Description |
IGrid |
grid |
|
System.Func<Cell, System.Boolean> |
containsFunc |
|
System.Collections.Generic.IEnumerable<Cell> |
allCells |
|
Returns
Move(IGrid, Cell, CellDir)
Returns the cell that is in the given direction from cell, or null if that move is not possible.
Declaration
public static Nullable<Cell> Move(this IGrid grid, Cell cell, CellDir dir)
Parameters
Returns
Type |
Description |
System.Nullable<Cell> |
|
ToMeshData(IGrid, IEnumerable<Cell>)
Converts a finite grid to a MeshData.
Declaration
public static MeshData ToMeshData(this IGrid grid, IEnumerable<Cell> cells = null)
Parameters
Type |
Name |
Description |
IGrid |
grid |
|
System.Collections.Generic.IEnumerable<Cell> |
cells |
|
Returns
Declaration
public static IGrid Transformed(this IGrid grid, Matrix4x4 transform)
Parameters
Returns