public struct ZoneGroupingLODCell : IEquatable<ZoneGroupingLODCell>, IComparable<ZoneGroupingLODCell>
Represents a LOD cell on a Zone Grouping. In addition to regular cell indexes, contains the LOD and index of the Zone/World Grouping that the cell belongs to.
Name | Type | Default Value | Description |
---|---|---|---|
LODCell | readonly int |
The LOD Cell of the ZoneGroupingLODCell. Contains the LOD and Cell values. |
|
WorldGroupingIndex | readonly int |
The index of the World Grouping that this cell is associated with. |
|
ZoneIndex | int |
The index of the Zone that this cell is associated with. |
public ZoneGroupingLODCell(LODCell lodCell, int zoneIndex, int groupingIndex)
Initializes a new instance of the ZoneGroupingLODCell structure.
Name | Type | Description |
---|---|---|
lodCell | LODCell |
The LOD Cell of the ZoneGroupingLODCell. Contains the LOD and Cell values. |
zoneIndex | int |
The index of the Zone that this cell is associated with. |
groupingIndex | int |
The index of the World Grouping that this cell is associated with. |
public static bool operator !=(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
!= operater implementation that allows you check if two ZoneGroupingLODCells are not
equal
The two ZoneGroupingLODCells will not be equal if the ZoneIndex, WorldGroupingIndex,
LOD, rows, columns, or
layers do not match each other from one ZoneGroupingLODCell to
the other (row != row, etc.)
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The first ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The second ZoneGroupingLODCell. |
bool
Returns true if the ZoneGroupingLODCells are not equal, false if they are equal.
public static bool operator <(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
< operater implementation that allows you check if the left ZoneGroupingLODCell is less than the right ZoneGroupingLODCell.
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The left ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The right ZoneGroupingLODCell. |
bool
Please refer to the CompareTo method documentation to understand
how ZoneGroupingLODCell comparison works.
public static bool operator <=(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
<= operater implementation that allows you check if the left ZoneGroupingLODCell is less than or equal to the right ZoneGroupingLODCell.
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The left ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The right ZoneGroupingLODCell. |
bool
Please refer to the CompareTo method documentation to understand
how ZoneGroupingLODCell comparison works.
public static bool operator ==(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
!= operater implementation that allows you check if two ZoneGroupingLODCells are equal
The two ZoneGroupingLODCells will be equal if the ZoneIndex, WorldGroupingIndex, LOD,
rows, columns, or layers all match each other from one ZoneGroupingLODCell to
the other (row == row, etc.)
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The first ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The second ZoneGroupingLODCell. |
bool
Returns true if the ZoneGroupingLODCells are equal, false if they are not equal.
public static bool operator >(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
> operater implementation that allows you check if the left ZoneGroupingLODCell is greater than the right ZoneGroupingLODCell.
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The left ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The right ZoneGroupingLODCell. |
bool
Please refer to the CompareTo method documentation to understand
how ZoneGroupingLODCell comparison works.
public static bool operator >=(ZoneGroupingLODCell left, ZoneGroupingLODCell right)
>= operater implementation that allows you check if the left ZoneGroupingLODCell is greater than or equal to the right ZoneGroupingLODCell.
Name | Type | Description |
---|---|---|
left | ZoneGroupingLODCell |
The left ZoneGroupingLODCell. |
right | ZoneGroupingLODCell |
The right ZoneGroupingLODCell. |
bool
Please refer to the CompareTo method documentation to understand
how ZoneGroupingLODCell comparison works.
public int CompareTo(ZoneGroupingLODCell other)
Compares the input ZoneGroupingLODCell against this ZoneGroupingLODCell to determine whether this ZoneGroupingLODCell procedes, follows, or is at the same position of the input ZoneGroupingLODCell. This can be used to order a collection of ZoneGroupingLODCells in the same manner as they would appear in the scene (if they were associated with World ZoneGroupingLODCells, that is). The method utilizes the LOD, row, column, and layer values. If you know the layer value is not used (such as in a 2D world), you may choose to use a different method rather than this one.
Name | Type | Description |
---|---|---|
other | object |
The other ZoneGroupingLODCell to compare this ZoneGroupingLODCell against. |
int
-1 if this ZoneGroupingLODCell precedes (is less than) the input "other" ZoneGroupingLODCell,
+1 if this ZoneGroupingLODCell follows (is greater than)
the input "other" ZoneGroupingLODCell, and 0 if the ZoneGroupingLODCells are at the
same position (are equal).
The following logic is used to determine the order. First, the ZoneIndex of the two
cell's is compared. If this cell's
ZoneIndex is less than the input cell's ZoneIndex, -1 is returned. If it is greater
than the input cell's
ZoneIndex, +1 is returned. If they are equal, the WorldGroupingIndex is compared in
the same way. Then the LOD values, following be the Cell Layer,
Cell Row, and finally Cell Column. 0 is returned if all values are the same.
An important thing to note is that higher quality LODs (which have a smaller value)
will precede lower quality LODs. However, this
also means that according to SAM, ZoneGroupingLODCell's with higher quality LODs are
less than ZoneGroupingLODCell's with lower quality LODs. In addition,
lower World Groupings (which are actually probably more important) will be before
higher World Groupings. As such, they are considered less
than the higher World Grouping cells.
public bool Equals(ZoneGroupingLODCell other)
Implementation of IEquatable<ZoneGroupingLODCell>.Equals method. Use this, as it does
not box input struct.
This method compares the ZoneIndex, WorldGroupingIndex, LOD, row, column, and layer.
In some instances where you know the layer does not
matter (on 2D worlds for instance), it may be slightly more performant to use a custom
ZoneGroupingLODCell EqualityComparer
that ignores the layer
Name | Type | Description |
---|---|---|
other | object |
The other ZoneGroupingLODCell to compare this ZoneGroupingLODCell against. |
bool
false if the row, column, and/or layer value on
the other ZoneGroupingLODCell is not equal to this ZoneGroupingLODCell's LOD, row,
column, and/or layer value.
public override bool Equals(object obj)
Override of Equals method. You shouldn't need to use this, and you should not use it since it will cause the input ZoneGroupingLODCell to be boxed.
Name | Type | Description |
---|---|---|
obj | object |
The object to check this ZoneGroupingLODCell against. |
bool
false if the object is not a ZoneGroupingLODCell or it is but the ZoneIndex, WorldGroupingIndex,
LOD, row, column, and/or layer value on
the obj is not equal to this ZoneGroupingLODCell's ZoneIndex, WorldGroupingIndex,
LOD, row, column, and/or layer value.
public override int GetHashCode()
Returns a hash code for this ZoneGroupingLODCell. Uses all six indexes (WorldGroupingIndex, LOD, Row, Column and Layer) to compute it, so the ZoneGroupingLODCell is treated as a 3D ZoneGroupingLODCell.
int
The hash code of the ZoneGroupingLODCell.