public struct WorldUserChange : IEquatable<WorldUserChange>, IComparable<WorldUserChange>
Represents a change in users on a World. In addition to regular cell indexes, contains the LOD and World Grouping that the cell belongs to, as well as the zone.
Name | Type | Default Value | Description |
---|---|---|---|
Cell | readonly Cell |
The actual Cell this struct details. |
|
ChangeInUsers | readonly int |
The change in users. |
|
LOD | readonly int |
The LOD of the WorldUserChange. |
|
WorldGroupingIndex | readonly int |
The index of the World Grouping on the World this WorldUserChange is associated with. |
|
ZoneIndex |
The index fo the Zone on the World this WorldUserChange is associated with. |
public WorldUserChange(int zoneIndex, int groupingIndex, int lod, Cell cell, int changeInUsers)
Initializes a new instance of the WorldUserChange structure.
Name | Type | Description |
---|---|---|
zoneIndex | int |
The index of the Zone of the world the WorldUserChange is associated with. |
groupingIndex | int |
The index of the World Grouping of the world the WorldUserChange is associated with. |
lod | int |
The LOD of the WorldUserChange. |
cell | Cell |
The cell of the WorldUserChange. |
changeInUsers | int |
The change in users. |
public static bool operator !=(WorldUserChange left, WorldUserChange right)
!= operater implementation that allows you check if two WorldUserChanges are not equal
The two WorldUserChanges will not be equal if the ZoneIndex, WorldGroupingIndex, LOD,
rows, columns, or
layers do not match each other from one WorldUserChange to
the other (row != row, etc.)
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The first WorldUserChange. |
right | WorldUserChange |
The second WorldUserChange. |
bool
Returns true if the WorldUserChanges are not equal, false if they are equal.
public static bool operator <(WorldUserChange left, WorldUserChange right)
< operater implementation that allows you check if the left WorldUserChange is less than the right WorldUserChange.
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The left WorldUserChange. |
right | WorldUserChange |
The right WorldUserChange. |
bool
Please refer to the CompareTo method documentation to understand
how WorldUserChange comparison works.
public static bool operator <=(WorldUserChange left, WorldUserChange right)
<= operater implementation that allows you check if the left WorldUserChange is less than or equal to the right WorldUserChange.
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The left WorldUserChange. |
right | WorldUserChange |
The right WorldUserChange. |
bool
Please refer to the CompareTo method documentation to understand
how WorldUserChange comparison works.
public static bool operator ==(WorldUserChange left, WorldUserChange right)
!= operater implementation that allows you check if two WorldUserChanges are equal
The two WorldUserChanges will be equal if the ZoneIndex, WorldGroupingIndex, LOD,
rows, columns, or layers all match each other from one WorldUserChange to
the other (row == row, etc.)
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The first WorldUserChange. |
right | WorldUserChange |
The second WorldUserChange. |
bool
Returns true if the WorldUserChanges are equal, false if they are not equal.
public static bool operator >(WorldUserChange left, WorldUserChange right)
> operater implementation that allows you check if the left WorldUserChange is greater than the right WorldUserChange.
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The left WorldUserChange. |
right | WorldUserChange |
The right WorldUserChange. |
bool
Please refer to the CompareTo method documentation to understand
how WorldUserChange comparison works.
public static bool operator >=(WorldUserChange left, WorldUserChange right)
>= operater implementation that allows you check if the left WorldUserChange is greater than or equal to the right WorldUserChange.
Name | Type | Description |
---|---|---|
left | WorldUserChange |
The left WorldUserChange. |
right | WorldUserChange |
The right WorldUserChange. |
bool
Please refer to the CompareTo method documentation to understand
how WorldUserChange comparison works.
public WorldUserChange AdjustUserChange(int newChangeInUsers)
Returns a new instance of the WorldUserChange structure that is effectively the same as the current object, but with a new value for user change.
Name | Type | Description |
---|---|---|
newChangeInUsers | int |
The new change in users. |
WorldUserChange
The new structure.
public int CompareTo(WorldUserChange other)
Compares the input WorldUserChange against this WorldUserChange to determine whether this WorldUserChange procedes, follows, or is at the same position of the input WorldUserChange.
Name | Type | Description |
---|---|---|
other | object |
The other WorldUserChange to compare this WorldUserChange against. |
int
-1 if this WorldUserChange precedes (is less than) the input "other" WorldUserChange,
+1 if this WorldUserChange follows (is greater than)
the input "other" WorldUserChange, and 0 if the WorldUserChanges are at the same position
(are equal).
public bool Equals(WorldUserChange other)
Implementation of IEquatable<WorldUserChange>.Equals method. Use this, as it does
not box input struct.
This method compares the 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
WorldUserChange EqualityComparer
that ignores the layer
Name | Type | Description |
---|---|---|
other | object |
The other WorldUserChange to compare this WorldUserChange against. |
bool
false if the row, column, and/or layer value on
the other WorldUserChange is not equal to this WorldUserChange'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 WorldUserChange to be boxed.
Name | Type | Description |
---|---|---|
obj | object |
The object to check this WorldUserChange against. |
bool
false if the object is not a WorldUserChange or it is but the LOD, row, column, and/or
layer value on
the obj is not equal to this WorldUserChange's LOD, row, column, and/or layer value.
public override int GetHashCode()
Returns a hash code for this WorldUserChange. Uses all six indexes (ZoneIndex, WorldGroupingIndex, LOD, Row, Column and Layer) to compute it, so the WorldUserChange is treated as a 3D WorldUserChange.
int
The hash code of the WorldUserChange.