Esempio n. 1
0
 public Mandolin(string serialNumber,
                 double price,
                 MandolinSpec spec)
     : base(serialNumber, price)
 {
     this.spec = spec;
 }
Esempio n. 2
0
 public Mandolin(string serialNumber,
                 double price,
                 MandolinSpec spec)
     : base(serialNumber, price)
 {
     this.spec = spec;
 }
Esempio n. 3
0
        public Mandolin(string serialNumber,
                        double price,
                        MandolinSpec spec)
            : base(serialNumber, price, spec)
        {

        }
        public static void testInstrumentSearch()
        {
            // Set up Rick's instrument inventory
            Inventory inventory = new Inventory();
            initializeInventory(inventory);

            GuitarSpec whatErinLikes = new GuitarSpec(Builder.Fender, "Stratocastor", Type.electric, Wood.Alder, Wood.Alder, 6);
            findInstrument("Erin", whatErinLikes, inventory);

            MandolinSpec whatPhilLikes = new MandolinSpec(Builder.Fender, "Stratocastor", Type.acoustic, Wood.Alder, Wood.Alder, Style.A);
            findInstrument("Phil", whatPhilLikes, inventory);
        }
        public static void testInstrumentSearch()
        {
            // Set up Rick's instrument inventory
            Inventory inventory = new Inventory();

            initializeInventory(inventory);

            GuitarSpec whatErinLikes = new GuitarSpec(Builder.Fender, "Stratocastor", Type.electric, Wood.Alder, Wood.Alder, 6);

            findInstrument("Erin", whatErinLikes, inventory);

            MandolinSpec whatPhilLikes = new MandolinSpec(Builder.Fender, "Stratocastor", Type.acoustic, Wood.Alder, Wood.Alder, Style.A);

            findInstrument("Phil", whatPhilLikes, inventory);
        }
Esempio n. 6
0
        public List<Mandolin> search(MandolinSpec searchSpec)
        {
            List<Mandolin> matchingMandolins = new List<Mandolin>();
            for (int i = 0; i < _inventory.Count; i++)
            {
                if (!(_inventory[i] is Mandolin)) { continue; }
                Mandolin mandolin = (Mandolin)_inventory[i];
                if (mandolin.spec.matches(searchSpec))
                {
                    matchingMandolins.Add(mandolin);
                }

            }
            return matchingMandolins;
        }
        public List <Mandolin> search(MandolinSpec searchSpec)
        {
            List <Mandolin> matchingMandolins = new List <Mandolin>();

            for (int i = 0; i < _inventory.Count; i++)
            {
                if (!(_inventory[i] is Mandolin))
                {
                    continue;
                }
                Mandolin mandolin = (Mandolin)_inventory[i];
                if (mandolin.spec.matches(searchSpec))
                {
                    matchingMandolins.Add(mandolin);
                }
            }
            return(matchingMandolins);
        }
Esempio n. 8
0
        public override bool matches(InstrumentSpec spec)
        {
            if (!base.matches(spec))
            {
                return(false);
            }
            if (!(spec is MandolinSpec))
            {
                return(false);
            }
            MandolinSpec mandolinSpec = (MandolinSpec)spec;

            if (style != mandolinSpec.style)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 9
0
 public Mandolin(string serialNumber,
                 double price,
                 MandolinSpec spec)
     : base(serialNumber, price, spec)
 {
 }