Show / Hide Table of Contents

Class GridExtensions

Inheritance
System.Object
GridExtensions
Namespace: Sylves
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
Type Name Description
IGrid grid
Vector3 position
Returns
Type Description
System.Nullable<Cell>

GetMeshData(IGrid, Cell)

Declaration
public static MeshData GetMeshData(this IGrid grid, Cell cell)
Parameters
Type Name Description
IGrid grid
Cell cell
Returns
Type Description
MeshData

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
Type Name Description
IGrid grid
Cell cell
Returns
Type Description
System.Collections.Generic.IEnumerable<Cell>

GetPolygon(IGrid, Cell)

Declaration
public static Vector3[] GetPolygon(this IGrid grid, Cell cell)
Parameters
Type Name Description
IGrid grid
Cell cell
Returns
Type Description
Vector3[]

Masked(IGrid, ISet<Cell>)

Filters the grid cells to the given subset. MaskModifier

Declaration
public static IGrid Masked(this IGrid grid, ISet<Cell> allCells)
Parameters
Type Name Description
IGrid grid
System.Collections.Generic.ISet<Cell> allCells
Returns
Type Description
IGrid

Masked(IGrid, Func<Cell, Boolean>, IEnumerable<Cell>)

Filters the grid cells to the given subset. MaskModifier

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
Type Description
IGrid

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
Type Name Description
IGrid grid
Cell cell
CellDir dir
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
Type Description
MeshData

Transformed(IGrid, Matrix4x4)

Applies a linear transformation to each of the cells of the grid. TransformModifier

Declaration
public static IGrid Transformed(this IGrid grid, Matrix4x4 transform)
Parameters
Type Name Description
IGrid grid
Matrix4x4 transform
Returns
Type Description
IGrid
In This Article
Back to top Generated by DocFX