// matches() uses the superclass's matches() and then performs additional checks to make sure the spec is the right type // and matches the guitar-specific properties public override bool matches(InstrumentSpec searchInstrumentSpec) { if (!base.matches(searchInstrumentSpec)) { return(false); } if (!(searchInstrumentSpec is GuitarSpec)) { return(false); } GuitarSpec spec = (GuitarSpec)searchInstrumentSpec; if (numStrings != spec.numStrings) { return(false); } return(true); }
public Guitar(string serialNumber, double price, GuitarSpec spec) : base(serialNumber, price, spec) { }