Table of Contents

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
Derived
Inherited Members
Extension Methods

Constructors

Instrument()

protected Instrument()

Instrument(Instrument<TChord>)

protected Instrument(Instrument<TChord> original)

Parameters

original Instrument<TChord>

Properties

Easy

Easy track

public Track<TChord>? Easy { get; set; }

Property Value

Track<TChord>

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

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

difficulty SafeEnum<Difficulty>

Difficulty of the track

Returns

Track<TChord>

Equals(Instrument?)

public override sealed bool Equals(Instrument? other)

Parameters

other Instrument

Returns

bool

Equals(Instrument<TChord>?)

public virtual bool Equals(Instrument<TChord>? other)

Parameters

other Instrument<TChord>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetEasy()

Exposes the Easy track to the base class.

protected override Track? GetEasy()

Returns

Track

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

Track

GetHard()

Exposes the Hard track to the base class.

protected override Track? GetHard()

Returns

Track

GetHashCode()

public override int GetHashCode()

Returns

int

GetMedium()

Exposes the Medium track to the base class.

protected override Track? GetMedium()

Returns

Track

GetTrack(SafeEnum<Difficulty>)

Gets the Track<TChord> that matches a Difficulty

public override Track<TChord>? GetTrack(SafeEnum<Difficulty> difficulty)

Parameters

difficulty SafeEnum<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

builder StringBuilder

Returns

bool

RemoveTrack(SafeEnum<Difficulty>)

Removes a track.

public override bool RemoveTrack(SafeEnum<Difficulty> difficulty)

Parameters

difficulty SafeEnum<Difficulty>

Difficulty of the target track

Returns

bool

SetTrack(Track<TChord>)

Sets a track for a given Difficulty.

public Track<TChord> SetTrack(Track<TChord> track)

Parameters

track Track<TChord>

Returns

Track<TChord>

Track instance assigned to the instrument. Changed made to the passed reference will not be reflected in the instrument.

Exceptions

ArgumentNullException
UndefinedEnumException

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Instrument<TChord>?, Instrument<TChord>?)

public static bool operator ==(Instrument<TChord>? left, Instrument<TChord>? right)

Parameters

left Instrument<TChord>
right Instrument<TChord>

Returns

bool

operator !=(Instrument<TChord>?, Instrument<TChord>?)

public static bool operator !=(Instrument<TChord>? left, Instrument<TChord>? right)

Parameters

left Instrument<TChord>
right Instrument<TChord>

Returns

bool