Table of Contents

Class LaneNoteCollection<TNote, TLane>

Namespace
ChartTools
Assembly
ChartTools.dll
public class LaneNoteCollection<TNote, TLane> : ILaneNoteCollection, ICollection<TNote>, IReadOnlyList<TNote>, IReadOnlyCollection<TNote>, IEnumerable<TNote>, IEnumerable where TNote : struct, IDefinedLaneNote<TLane> where TLane : struct, Enum

Type Parameters

TNote
TLane
Inheritance
LaneNoteCollection<TNote, TLane>
Implements
Inherited Members
Extension Methods

Constructors

LaneNoteCollection()

public LaneNoteCollection()

Properties

Count

public int Count { get; }

Property Value

int

this[SafeEnum<TLane>]

Gets the note matching a given lane.

public TNote? this[SafeEnum<TLane> lane] { get; }

Parameters

lane SafeEnum<TLane>

Lane of the note

Property Value

TNote?

Note with the lane if present, otherwise null.

OpenExclusivity

If true, trying to combine an open note with other notes will remove the current ones.

public bool OpenExclusivity { get; }

Property Value

bool

Methods

Add(SafeEnum<TLane>)

public void Add(SafeEnum<TLane> lane)

Parameters

lane SafeEnum<TLane>

Add(in TNote)

public void Add(in TNote note)

Parameters

note TNote

Note to add

Remarks

Adding a note that already exists will overwrite the existing note.

            <p>If <xref href="ChartTools.LaneNoteCollection%602.OpenExclusivity" data-throw-if-not-resolved="false"></xref> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, combining an open note with other notes will remove the current ones.</p>

AddRange(params ReadOnlySpan<SafeEnum<TLane>>)

public void AddRange(params ReadOnlySpan<SafeEnum<TLane>> notes)

Parameters

notes ReadOnlySpan<SafeEnum<TLane>>

AddRange(params ReadOnlySpan<TNote>)

public void AddRange(params ReadOnlySpan<TNote> notes)

Parameters

notes ReadOnlySpan<TNote>

AsSpan()

public ReadOnlySpan<TNote> AsSpan()

Returns

ReadOnlySpan<TNote>

Clear()

Removes all notes from the LaneNoteCollection<TNote, TLane>.

public void Clear()

Contains(SafeEnum<TLane>)

Determines if any note matches a given lane.

public bool Contains(SafeEnum<TLane> lane)

Parameters

lane SafeEnum<TLane>

Returns

bool

Contains(in TNote)

Determines if any note matches the lane of a given note.

public bool Contains(in TNote note)

Parameters

note TNote

Returns

bool

Exceptions

ArgumentNullException

CopyTo(TNote[], int)

public void CopyTo(TNote[] array, int arrayIndex)

Parameters

array TNote[]
arrayIndex int

GetEnumerator()

public IEnumerator<TNote> GetEnumerator()

Returns

IEnumerator<TNote>

Proxy(SafeEnum<TLane>)

public NoteProxy<TNote, TLane>? Proxy(SafeEnum<TLane> lane)

Parameters

lane SafeEnum<TLane>

Returns

NoteProxy<TNote, TLane>?

ProxyAll()

public NoteProxy<TNote, TLane>[] ProxyAll()

Returns

NoteProxy<TNote, TLane>[]

Remove(SafeEnum<TLane>)

Removes the note that matches a given lane.

public bool Remove(SafeEnum<TLane> lane)

Parameters

lane SafeEnum<TLane>

Returns

bool

true if a matching note was found.

Remove(in TNote)

Removes the note that matches the lane of a given note.

public bool Remove(in TNote note)

Parameters

note TNote

Returns

bool

true if a matching note was found.