Class Instrument<TChord>
- Namespace
- ChartTools
- Assembly
- ChartTools.dll
Set of tracks common to an instrument
public abstract record Instrument<TChord> : Instrument, IEmptyVerifiable, IEquatable<Instrument>, IEquatable<Instrument<TChord>> where TChord : Chord
Type Parameters
TChord
- Inheritance
-
Instrument<TChord>
- Implements
-
IEquatable<Instrument<TChord>>
- Derived
- Inherited Members
- Extension Methods
Constructors
Instrument()
protected Instrument()
Instrument(Instrument<TChord>)
protected Instrument(Instrument<TChord> original)
Parameters
originalInstrument<TChord>
Properties
Easy
Easy track
public Track<TChord>? Easy { get; set; }
Property Value
- Track<TChord>
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Expert
Expert track
public Track<TChord>? Expert { get; set; }
Property Value
- Track<TChord>
Hard
Hard track
public Track<TChord>? Hard { get; set; }
Property Value
- Track<TChord>
Medium
Medium track
public Track<TChord>? Medium { get; set; }
Property Value
- Track<TChord>
Methods
CreateTrack(SafeEnum<Difficulty>)
Creates a track
public override Track<TChord> CreateTrack(SafeEnum<Difficulty> difficulty)
Parameters
difficultySafeEnum<Difficulty>Difficulty of the track
Returns
- Track<TChord>
Equals(Instrument?)
public override sealed bool Equals(Instrument? other)
Parameters
otherInstrument
Returns
Equals(Instrument<TChord>?)
public virtual bool Equals(Instrument<TChord>? other)
Parameters
otherInstrument<TChord>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetEasy()
Exposes the Easy track to the base class.
protected override Track? GetEasy()
Returns
GetExistingTracks()
Creates an array containing all tracks with data.
public override IEnumerable<Track<TChord>> GetExistingTracks()
Returns
- IEnumerable<Track<TChord>>
GetExpert()
Exposes the Expert track to the base class.
protected override Track? GetExpert()
Returns
GetHard()
Exposes the Hard track to the base class.
protected override Track? GetHard()
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetMedium()
Exposes the Medium track to the base class.
protected override Track? GetMedium()
Returns
GetTrack(SafeEnum<Difficulty>)
Gets the Track<TChord> that matches a Difficulty
public override Track<TChord>? GetTrack(SafeEnum<Difficulty> difficulty)
Parameters
difficultySafeEnum<Difficulty>
Returns
- Track<TChord>
GetTracks()
Creates an array containing all tracks.
public override Track<TChord>?[] GetTracks()
Returns
- Track<TChord>[]
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
RemoveTrack(SafeEnum<Difficulty>)
Removes a track.
public override bool RemoveTrack(SafeEnum<Difficulty> difficulty)
Parameters
difficultySafeEnum<Difficulty>Difficulty of the target track
Returns
SetTrack(Track<TChord>)
Sets a track for a given Difficulty.
public Track<TChord> SetTrack(Track<TChord> track)
Parameters
trackTrack<TChord>
Returns
- Track<TChord>
Track instance assigned to the instrument. Changed made to the passed reference will not be reflected in the instrument.
Exceptions
ToString()
public override string ToString()
Returns
Operators
operator ==(Instrument<TChord>?, Instrument<TChord>?)
public static bool operator ==(Instrument<TChord>? left, Instrument<TChord>? right)
Parameters
leftInstrument<TChord>rightInstrument<TChord>
Returns
operator !=(Instrument<TChord>?, Instrument<TChord>?)
public static bool operator !=(Instrument<TChord>? left, Instrument<TChord>? right)
Parameters
leftInstrument<TChord>rightInstrument<TChord>