Exemplo n.º 1
0
        public void AddInstrument(string serialNumber, double price, InstrumentSpec spec)                                            //Builder builder, string model, Type type, Wood backwood, Wood topwood)
        {
            Instrument instrument = null;

            if (spec.GetType() == typeof(GuitarSpec))
            {
                instrument = new Guitar(serialNumber, price, (GuitarSpec)spec);
            }
            else if (spec.GetType() == typeof(MandolinSpec))
            {
                instrument = new Mandolin(serialNumber, price, (MandolinSpec)spec);
            }
            instruments.Add(instrument);
        }
Exemplo n.º 2
0
        public void AddGuitar(string serialno, double price, GuitarSpec spec)
        {
            Guitar guitar = new Guitar(serialno, price, spec);

            guitars.Add(guitar);
        }