Class WrapModifier
Turns any bounded grid into a grid which connects back on itself when you leave the grounds.
This is done via a canonicalize method that is responsible for replacing cells that are outside of the bounds.
Inheritance
System.Object
WrapModifier
Assembly: Sylves.dll
Syntax
public class WrapModifier : BaseModifier, IGrid
Constructors
WrapModifier(IGrid, Func<Cell, Nullable<Cell>>)
Declaration
public WrapModifier(IGrid underlying, Func<Cell, Nullable<Cell>> canonicalize)
Parameters
Type |
Name |
Description |
IGrid |
underlying |
|
System.Func<Cell, System.Nullable<Cell>> |
canonicalize |
|
Properties
Unbounded
Declaration
public override IGrid Unbounded { get; }
Property Value
Overrides
Methods
Canonicalize(Cell)
Declaration
public Nullable<Cell> Canonicalize(Cell cell)
Parameters
Type |
Name |
Description |
Cell |
cell |
|
Returns
Type |
Description |
System.Nullable<Cell> |
|
FindGridSymmetry(ISet<Cell>, ISet<Cell>, Cell, CellRotation)
Declaration
public override GridSymmetry FindGridSymmetry(ISet<Cell> src, ISet<Cell> dest, Cell srcCell, CellRotation cellRotation)
Parameters
Type |
Name |
Description |
System.Collections.Generic.ISet<Cell> |
src |
|
System.Collections.Generic.ISet<Cell> |
dest |
|
Cell |
srcCell |
|
CellRotation |
cellRotation |
|
Returns
Overrides
ParallelTransport(IGrid, Cell, Cell, Cell, CellRotation, out Cell, out CellRotation)
Declaration
public override bool ParallelTransport(IGrid aGrid, Cell aSrcCell, Cell aDestCell, Cell srcCell, CellRotation startRotation, out Cell destCell, out CellRotation destRotation)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
Raycast(Vector3, Vector3, Single)
Declaration
public override IEnumerable<RaycastInfo> Raycast(Vector3 origin, Vector3 direction, float maxDistance = InfinityF)
Parameters
Type |
Name |
Description |
Vector3 |
origin |
|
Vector3 |
direction |
|
System.Single |
maxDistance |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<RaycastInfo> |
|
Overrides
Rebind(IGrid)
Declaration
protected override IGrid Rebind(IGrid underlying)
Parameters
Type |
Name |
Description |
IGrid |
underlying |
|
Returns
Overrides
TryApplySymmetry(GridSymmetry, Cell, out Cell, out CellRotation)
Declaration
public override bool TryApplySymmetry(GridSymmetry s, Cell src, out Cell dest, out CellRotation r)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
TryMove(Cell, CellDir, out Cell, out CellDir, out Connection)
Declaration
public override bool TryMove(Cell cell, CellDir dir, out Cell dest, out CellDir inverseDir, out Connection connection)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
TryMoveByOffset(Cell, Vector3Int, Vector3Int, CellRotation, out Cell, out CellRotation)
Declaration
public override bool TryMoveByOffset(Cell startCell, Vector3Int startOffset, Vector3Int destOffset, CellRotation startRotation, out Cell destCell, out CellRotation destRotation)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
Implements