public override bool matches(InstrumentSpec spec) { if (!base.matches(spec)) { return(false); } GuitarSpec spec2 = (GuitarSpec)spec; if (_numstring != spec2.Getnumstring()) { return(false); } return(true); }
public void AddInstrument(string serialno, double price, InstrumentSpec spec) { Instrument instrument = null; if (spec is GuitarSpec) { instrument = new Guitar(serialno, price, (GuitarSpec)spec); } if (spec is MandolinSpec) { instrument = new Mandolin(serialno, price, (MandolinSpec)spec); } _inventory.Add(instrument); }
public override bool matches(InstrumentSpec spec) { if (!base.matches(spec)) { return(false); } MandolinSpec spec2 = (MandolinSpec)spec; if (_style != spec2.GetStyle) { return(false); } return(true); }
public virtual bool matches(InstrumentSpec spec) { if (_builder != spec.GetBuilder()) { return(false); } if ((_model != null) && (!_model.Equals("")) && (!_model.Equals(spec.GetModel()))) { return(false); } if (_type != spec.Gettype()) { return(false); } if (_backwood != spec.GetBackwood()) { return(false); } if (_topwood != spec.GetTopwood()) { return(false); } return(true); }
public Instrument(string serialnumber, double price, InstrumentSpec spec) { _serialnumber = serialnumber; _price = price; _spec = spec; }
public Mandolin(string serialno, double price, InstrumentSpec spec) : base(serialno, price, spec) { }