Exemplo n.º 1
0
        public override bool matches(InstrumentSpec spec)
        {
            if (!base.matches(spec))
            {
                return(false);
            }
            GuitarSpec spec2 = (GuitarSpec)spec;

            if (_numstring != spec2.Getnumstring())
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
 }
Exemplo n.º 5
0
 public Instrument(string serialnumber, double price, InstrumentSpec spec)
 {
     _serialnumber = serialnumber;
     _price        = price;
     _spec         = spec;
 }
Exemplo n.º 6
0
 public Mandolin(string serialno, double price, InstrumentSpec spec) : base(serialno, price, spec)
 {
 }