Struct SequenceId
Represents an auto incrementing sequence identifier. Usually a value between 0 and 127 (7 bits). After 127 it wraps around to 0.
public struct SequenceId
Constructors
SequenceId(byte)
Constructing a SequenceId
public SequenceId(byte id)
Parameters
id
byte
Exceptions
- Exception
Thrown when the provided id is not between 0 and 127.
Fields
Max
public static SequenceId Max
Field Value
MaxRange
public const byte MaxRange = 128
Field Value
MaxValue
public const byte MaxValue = 127
Field Value
Properties
Value
public readonly byte Value { get; }
Property Value
Methods
Distance(SequenceId)
Returns the closest distance between the otherId and this SequenceId.
public int Distance(SequenceId otherId)
Parameters
otherId
SequenceId
Returns
Equals(SequenceId)
public bool Equals(SequenceId other)
Parameters
other
SequenceId
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
IsValidSuccessor(SequenceId)
Checks if the nextId comes after this SequenceId.
public bool IsValidSuccessor(SequenceId nextId)
Parameters
nextId
SequenceId
Returns
Next()
Returns the next SequenceId. Note that the value wraps around 127.
public SequenceId Next()
Returns
ToString()
public override string ToString()