Class SeqPair<T>
Represents a sequence pair containing previous and current values. Used to track sequential state changes of a value.
public class SeqPair<T> : IEquatable<SeqPair<T>>, IWriteBin
Type Parameters
T
The type of values stored in the sequence pair
- Inheritance
-
SeqPair<T>
- Implements
-
IEquatable<SeqPair<T>>
- Inherited Members
- Extension Methods
Constructors
SeqPair()
Initializes a new instance of the SeqPair<T> class with default values for previous and current elements.
public SeqPair()
SeqPair(BinaryReader, Func<BinaryReader, T>)
Initializes a new instance of the SeqPair<T> class by deserializing from binary data.
public SeqPair(BinaryReader reader, Func<BinaryReader, T> Generator)
Parameters
reader
BinaryReaderThe binary reader to read data from
Generator
Func<BinaryReader, T>A function that creates objects of type T from binary data
SeqPair(T, T)
Initializes a new instance of the SeqPair<T> class with specified previous and current values.
public SeqPair(T pre, T cur)
Parameters
pre
TThe previous value in the sequence
cur
TThe current value in the sequence
Fields
cur
Gets or sets the current value in the sequence.
public T cur
Field Value
- T
pre
Gets or sets the previous value in the sequence.
public T pre
Field Value
- T
Methods
Equals(SeqPair<T>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(SeqPair<T> other)
Parameters
other
SeqPair<T>An object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
WriteBin(BinaryWriter)
Writes the object's data to a binary stream.
public void WriteBin(BinaryWriter writer)
Parameters
writer
BinaryWriterThe binary writer to write to