Struct TMPEffectTagIndices
- Namespace
- TMPEffects.Tags
- Assembly
- TMPEffects.dll
The indices of an TMPEffectTag.
The indices can be regarded as a half-open interval of [StartIndex, EndIndex).
For example, an instance with StartIndex == 5 and EndIndex == 10 "contains" the indices 5, 6, 7, 8 and 9.
public struct TMPEffectTagIndices : IComparable<TMPEffectTagIndices>, IEquatable<TMPEffectTagIndices>
- Implements
- Inherited Members
Constructors
TMPEffectTagIndices(int, int, int)
public TMPEffectTagIndices(int startIndex, int endIndex, int orderAtIndex)
Parameters
Properties
ContainedIndices
Enumeration of all contained indices.
public IEnumerable<int> ContainedIndices { get; }
Property Value
EndIndex
The (exclusive) end index of the tag.
public int EndIndex { get; }
Property Value
IsEmpty
Whether the tag is empty, i.e. doesn't contain any indices.
public bool IsEmpty { get; }
Property Value
IsOpen
Whether the tag is open, meaning it is never closed and therefore does not have a defined end index;
the tag's index interval ranges from the StartIndex to the end of whatever text it is applied to.
public bool IsOpen { get; }
Property Value
Length
The length of the interval, meaning the difference between EndIndex and StartIndex.
Is -1 if the tag is open.
public int Length { get; }
Property Value
OrderAtIndex
The order at the start index.
If there are multiple tags with the same start index, this will define their order:
tags with lower order come first, tags with higher index come later.
Note that the order may have gaps (e.g. there are three tags at a given index, with order -5, 4 and 10 respectively).
public int OrderAtIndex { get; }
Property Value
StartIndex
The (inclusive) start index of the tag.
public int StartIndex { get; }
Property Value
Methods
CompareTo(TMPEffectTagIndices)
Compares this instance to another instance of TMPEffectTagIndices.
First compares StartIndex. If those are equal, compares OrderAtIndex. The EndIndex is not considered.
public int CompareTo(TMPEffectTagIndices other)
Parameters
other
TMPEffectTagIndicesThe instance to compare this instance to.
Returns
- int
Less than zero => This instance precedes
other
in the sort order.
Zero => This instance occurs in the same position in the sort order asother
.
Greater than zero => This instance followsother
in the sort order.
Contains(int)
Whether the indices contain the given index.
public bool Contains(int index)
Parameters
index
intThe index.
Returns
- bool
true if the indices containg the given index; false otherwise.
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Equals(TMPEffectTagIndices)
public bool Equals(TMPEffectTagIndices other)
Parameters
other
TMPEffectTagIndices
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(TMPEffectTagIndices, TMPEffectTagIndices)
public static bool operator ==(TMPEffectTagIndices c1, TMPEffectTagIndices c2)
Parameters
Returns
operator >(TMPEffectTagIndices, TMPEffectTagIndices)
public static bool operator >(TMPEffectTagIndices c1, TMPEffectTagIndices c2)
Parameters
Returns
operator !=(TMPEffectTagIndices, TMPEffectTagIndices)
public static bool operator !=(TMPEffectTagIndices c1, TMPEffectTagIndices c2)
Parameters
Returns
operator <(TMPEffectTagIndices, TMPEffectTagIndices)
public static bool operator <(TMPEffectTagIndices c1, TMPEffectTagIndices c2)