Table of Contents

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

startIndex int
endIndex int
orderAtIndex int

Properties

ContainedIndices

Enumeration of all contained indices.

public IEnumerable<int> ContainedIndices { get; }

Property Value

IEnumerable<int>

EndIndex

The (exclusive) end index of the tag.

public int EndIndex { get; }

Property Value

int

IsEmpty

Whether the tag is empty, i.e. doesn't contain any indices.

public bool IsEmpty { get; }

Property Value

bool

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

bool

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

int

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

int

StartIndex

The (inclusive) start index of the tag.

public int StartIndex { get; }

Property Value

int

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 TMPEffectTagIndices

The 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 as other.
Greater than zero => This instance follows other in the sort order.

Contains(int)

Whether the indices contain the given index.

public bool Contains(int index)

Parameters

index int

The 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

bool

Equals(TMPEffectTagIndices)

public bool Equals(TMPEffectTagIndices other)

Parameters

other TMPEffectTagIndices

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(TMPEffectTagIndices, TMPEffectTagIndices)

public static bool operator ==(TMPEffectTagIndices c1, TMPEffectTagIndices c2)

Parameters

c1 TMPEffectTagIndices
c2 TMPEffectTagIndices

Returns

bool

operator >(TMPEffectTagIndices, TMPEffectTagIndices)

public static bool operator >(TMPEffectTagIndices c1, TMPEffectTagIndices c2)

Parameters

c1 TMPEffectTagIndices
c2 TMPEffectTagIndices

Returns

bool

operator !=(TMPEffectTagIndices, TMPEffectTagIndices)

public static bool operator !=(TMPEffectTagIndices c1, TMPEffectTagIndices c2)

Parameters

c1 TMPEffectTagIndices
c2 TMPEffectTagIndices

Returns

bool

operator <(TMPEffectTagIndices, TMPEffectTagIndices)

public static bool operator <(TMPEffectTagIndices c1, TMPEffectTagIndices c2)

Parameters

c1 TMPEffectTagIndices
c2 TMPEffectTagIndices

Returns

bool