Class SylvesExtensions
Inheritance
SylvesExtensions
Assembly: Tessera.dll
Syntax
public static class SylvesExtensions
Fields
CubeCellType
Declaration
public static readonly ICellType CubeCellType
Field Value
Type |
Description |
ICellType |
|
CubeGridInstance
Declaration
public static readonly IGrid CubeGridInstance
Field Value
HexPrismCellType
Declaration
public static readonly ICellType HexPrismCellType
Field Value
Type |
Description |
ICellType |
|
HexPrismGridInstance
Declaration
public static readonly IGrid HexPrismGridInstance
Field Value
SquareCellType
Declaration
public static readonly ICellType SquareCellType
Field Value
Type |
Description |
ICellType |
|
SquareGridInstance
Declaration
public static readonly IGrid SquareGridInstance
Field Value
TrianglePrismCellType
Declaration
public static readonly ICellType TrianglePrismCellType
Field Value
Type |
Description |
ICellType |
|
Properties
TrianglePrismGridInstance
Declaration
public static IGrid TrianglePrismGridInstance { get; }
Property Value
Methods
FindCell(IGrid, Vector3, Matrix4x4, out Cell, out CellRotation)
Declaration
public static bool FindCell(this IGrid grid, Vector3 tileCenter, Matrix4x4 tileLocalToGridMatrix, out Cell cell, out CellRotation rotation)
Parameters
Type |
Name |
Description |
IGrid |
grid |
|
Vector3 |
tileCenter |
|
Matrix4x4 |
tileLocalToGridMatrix |
|
Cell |
cell |
|
CellRotation |
rotation |
|
Returns
GetCellCenter(IGrid, Vector3Int, Vector3, Vector3)
Declaration
public static Vector3 GetCellCenter(this IGrid sylvesCellGrid, Vector3Int offset, Vector3 center, Vector3 cellSize)
Parameters
Type |
Name |
Description |
IGrid |
sylvesCellGrid |
|
Vector3Int |
offset |
|
Vector3 |
center |
|
Vector3 |
cellSize |
|
Returns
GetCellCorner(IGrid, Vector3Int, CellCorner, Vector3, Vector3)
Declaration
public static Vector3 GetCellCorner(this IGrid sylvesCellGrid, Vector3Int offset, CellCorner corner, Vector3 center, Vector3 cellSize)
Parameters
Type |
Name |
Description |
IGrid |
sylvesCellGrid |
|
Vector3Int |
offset |
|
CellCorner |
corner |
|
Vector3 |
center |
|
Vector3 |
cellSize |
|
Returns
GetCellGrid(ICellType)
Declaration
public static IGrid GetCellGrid(this ICellType cellType)
Parameters
Type |
Name |
Description |
ICellType |
cellType |
|
Returns
Returns a transform from the canonical cell (of unit size) to a specific cell size and center.
Declaration
public static Matrix4x4 GetCellSizeTransform(this IGrid sylvesCellGrid, Vector3 center, Vector3 cellSize)
Parameters
Type |
Name |
Description |
IGrid |
sylvesCellGrid |
|
Vector3 |
center |
|
Vector3 |
cellSize |
|
Returns
Type |
Description |
Matrix4x4 |
|
GetCellType(IGrid)
Declaration
public static ICellType GetCellType(this IGrid grid)
Parameters
Type |
Name |
Description |
IGrid |
grid |
|
Returns
Type |
Description |
ICellType |
|
GetDirPairs(ICellType)
Declaration
public static IEnumerable<(CellDir, CellDir)> GetDirPairs(this ICellType cellType)
Parameters
Type |
Name |
Description |
ICellType |
cellType |
|
Returns
GetDisplayName(ICellType, CellDir)
Declaration
public static string GetDisplayName(this ICellType cellType, CellDir cellDir)
Parameters
Type |
Name |
Description |
ICellType |
cellType |
|
CellDir |
cellDir |
|
Returns
GetReflectX(ICellType)
Declaration
public static CellRotation GetReflectX(this ICellType cellType)
Parameters
Type |
Name |
Description |
ICellType |
cellType |
|
Returns
Type |
Description |
CellRotation |
|
GetRotations(ICellType, bool, bool, RotationGroupType)
Declaration
public static IList<CellRotation> GetRotations(this ICellType cellType, bool rotatable = true, bool reflectable = true, RotationGroupType rotationGroupType = RotationGroupType.All)
Parameters
Returns
Type |
Description |
IList<CellRotation> |
|
RotateBy(ICellType, CellDir, FaceDetails, CellRotation)
Declaration
public static (CellDir, FaceDetails) RotateBy(this ICellType cellType, CellDir dir, FaceDetails faceDetails, CellRotation rot)
Parameters
Type |
Name |
Description |
ICellType |
cellType |
|
CellDir |
dir |
|
FaceDetails |
faceDetails |
|
CellRotation |
rot |
|
Returns
ToTesseraMatrix(Connection)
Declaration
public static Matrix4x4 ToTesseraMatrix(this Connection connection)
Parameters
Type |
Name |
Description |
Connection |
connection |
|
Returns
Type |
Description |
Matrix4x4 |
|