TwoDimensionalCellComparer Class

public sealed class TwoDimensionalCellComparer : SingletonEqualityComparer<Cell, TwoDimensionalCellComparer>

An equality comparer for a Cell structure that treats the cells as two dimensional (ignoring the layer field on the cells).

It is recommended to use this comparer rather than the Cell's built in equality and GetHashCode methods if your cell is 2D, as the built in methods treat the cell as a 3D cell. You may also wish to use this when you don't know whether the cells will be 2D or 3D ahead of time. In this case, you can use the base EqualityComparer<Cell> for your type, and instantiate a 2D or 3D equality comparare at runtime depending on your cell type (which will typically depend on the Axes uses by your Streamable Grid).

Methods

Equals(Cell, Cell)

public override bool Equals(Cell cell1, Cell cell2)

Determines whether two 2D cells are equal (layer field is ignored)

Parameters

Name Type Description
cell1 Cell

The first cell.

cell2 Cell

The second cell.

Returns

bool
True of the two cells are equal, false if they are not. The layer field is ignored for the comparison


GetHashCode(Cell)

public override int GetHashCode(Cell cell))

Calculates a hash code using the row and column fields of the cell.

Parameters

Name Type Description
cell Cell

The cell who's hash code you wish to get.

Returns

int
The hash code of the cell.