Table of Contents

Struct TMPEffectTagIndices

Namespace
TMPEffects.Tags

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 readonly 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.

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)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(TMPEffectTagIndices)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(TMPEffectTagIndices other)

Parameters

other TMPEffectTagIndices

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

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