Struct ValueChange<T>
Records a value change in a diff as recorded by a DiffAwareGridView<T>.
Inherited Members
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
[DataContract]
public readonly struct ValueChange<T> : IEquatable<ValueChange<T>>, IMatchable<ValueChange<T>> where T : struct
Type Parameters
| Name | Description |
|---|---|
| T | Type of value being changed. |
Constructors
View SourceValueChange(Point, T, T)
Creates a new value change record.
Declaration
public ValueChange(Point position, T oldValue, T newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | position | Position whose value was changed. |
| T | oldValue | Original value that was changed. |
| T | newValue | New value that was set. |
Fields
View SourceNewValue
New value that was set.
Declaration
[DataMember]
public readonly T NewValue
Field Value
| Type | Description |
|---|---|
| T |
OldValue
Original value that was changed.
Declaration
[DataMember]
public readonly T OldValue
Field Value
| Type | Description |
|---|---|
| T |
Position
Position whose value was changed.
Declaration
[DataMember]
public readonly Point Position
Field Value
| Type | Description |
|---|---|
| Point |
Methods
View SourceEquals(ValueChange<T>)
Compares the two changes according to their positions and values.
Declaration
public bool Equals(ValueChange<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChange<T> | other |
Returns
| Type | Description |
|---|---|
| bool | True if the two value changes represent the same change, false otherwise. |
Equals(object?)
Compares the two changes according to their types, positions and values.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool | True if the two value changes represent the same object and change, false otherwise. |
Overrides
View SourceGetHashCode()
Returns a hash value computed using the item's position, old value, and new value.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
View SourceMatches(ValueChange<T>)
Compares the two changes according to their positions and values.
Declaration
public bool Matches(ValueChange<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChange<T> | other |
Returns
| Type | Description |
|---|---|
| bool | True if the two value changes represent the same change, false otherwise. |
ToString()
Returns a string representing the object, including its position, old value, and new value.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Operators
View Sourceoperator ==(ValueChange<T>, ValueChange<T>)
Tests the two changes by their fields for equality.
Declaration
public static bool operator ==(ValueChange<T> left, ValueChange<T> right)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChange<T> | left | |
| ValueChange<T> | right |
Returns
| Type | Description |
|---|---|
| bool | True if all the changes are equivalent; false otherwise. |
operator !=(ValueChange<T>, ValueChange<T>)
Tests the two changes by their fields for inequality.
Declaration
public static bool operator !=(ValueChange<T> left, ValueChange<T> right)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChange<T> | left | |
| ValueChange<T> | right |
Returns
| Type | Description |
|---|---|
| bool | True if all the changes are equivalent; false otherwise. |