ThreeDimensionalChunkCellComparer Class

public sealed class ThreeDimensionalChunkCellComparer : SingletonEqualityComparer<ChunkCell, ThreeDimensionalChunkCellComparer>

An equality comparer for a ChunkCell structure that treats the cells as three dimensional (using the layer field from the Cell property).

The built in equality and GetHashCode methods on the ChunkCell structure already use the layer field, so it may not be becessary for you to use this class. However, you may 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<ChunkCell> 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(ChunkCell, ChunkCell)

public override bool Equals(ChunkCell cell1, ChunkCell cell2)

Determines whether two 3D cells are equal.

Parameters

Name Type Description
cell1 ChunkCell

The first cell.

cell2 ChunkCell

The second cell.

Returns

bool
True of the two cells are equal, false if they are not.


GetHashCode(ChunkCell)

public override int GetHashCode(ChunkCell cell))

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

Parameters

Name Type Description
cell ChunkCell

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

Returns

int
The hash code of the cell.