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
TNoteTLane
- Inheritance
-
LaneNoteCollection<TNote, TLane>
- Implements
-
ICollection<TNote>IReadOnlyList<TNote>IReadOnlyCollection<TNote>IEnumerable<TNote>
- Inherited Members
- Extension Methods
Constructors
LaneNoteCollection()
public LaneNoteCollection()
Properties
Count
public int Count { get; }
Property Value
this[SafeEnum<TLane>]
Gets the note matching a given lane.
public TNote? this[SafeEnum<TLane> lane] { get; }
Parameters
laneSafeEnum<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
Methods
Add(SafeEnum<TLane>)
public void Add(SafeEnum<TLane> lane)
Parameters
laneSafeEnum<TLane>
Add(in TNote)
Adds a note to the LaneNoteCollection<TNote, TLane>.
public void Add(in TNote note)
Parameters
noteTNoteNote 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
notesReadOnlySpan<SafeEnum<TLane>>
AddRange(params ReadOnlySpan<TNote>)
public void AddRange(params ReadOnlySpan<TNote> notes)
Parameters
notesReadOnlySpan<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
laneSafeEnum<TLane>
Returns
Contains(in TNote)
Determines if any note matches the lane of a given note.
public bool Contains(in TNote note)
Parameters
noteTNote
Returns
Exceptions
CopyTo(TNote[], int)
public void CopyTo(TNote[] array, int arrayIndex)
Parameters
arrayTNote[]arrayIndexint
GetEnumerator()
public IEnumerator<TNote> GetEnumerator()
Returns
- IEnumerator<TNote>
Proxy(SafeEnum<TLane>)
public NoteProxy<TNote, TLane>? Proxy(SafeEnum<TLane> lane)
Parameters
laneSafeEnum<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
laneSafeEnum<TLane>
Returns
Remove(in TNote)
Removes the note that matches the lane of a given note.
public bool Remove(in TNote note)
Parameters
noteTNote