コード例 #1
0
ファイル: Guitar.cs プロジェクト: edisongt/MTVersionHFOOAD
 public Guitar(string serialNumber,
               double price,
               GuitarSpec spec)
     : base(serialNumber, price)
 {
     this.spec = spec;
 }
コード例 #2
0
ファイル: Guitar.cs プロジェクト: MarkPThomas/HeadFirst-OOAD
 public Guitar(string serialNumber,
               double price,
               GuitarSpec spec)
     : base(serialNumber, price)
 {         
     this.spec = spec;
 }
コード例 #3
0
ファイル: Guitar.cs プロジェクト: MarkPThomas/HeadFirst-OOAD
 public Guitar(string serialNumber,
               double price,
               GuitarSpec spec)
     : base(serialNumber, price, spec)
 {         
     
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public List<Guitar> search(GuitarSpec searchSpec)
 {
     List<Guitar> matchingGuitars = new List<Guitar>();
     for (int i = 0; i < _inventory.Count; i++)
     {
         if (!(_inventory[i] is Guitar)) { continue; }
         Guitar guitar = (Guitar)_inventory[i];
         if (guitar.spec.matches(searchSpec))
         {
             matchingGuitars.Add(guitar);
         }
         
     }
     return matchingGuitars;
 }
コード例 #7
0
        public List <Guitar> search(GuitarSpec searchSpec)
        {
            List <Guitar> matchingGuitars = new List <Guitar>();

            for (int i = 0; i < _inventory.Count; i++)
            {
                if (!(_inventory[i] is Guitar))
                {
                    continue;
                }
                Guitar guitar = (Guitar)_inventory[i];
                if (guitar.spec.matches(searchSpec))
                {
                    matchingGuitars.Add(guitar);
                }
            }
            return(matchingGuitars);
        }
コード例 #8
0
        public override bool matches(InstrumentSpec spec)
        {
            if (!base.matches(spec))
            {
                return(false);
            }
            if (!(spec is GuitarSpec))
            {
                return(false);
            }
            GuitarSpec guitarSpec = (GuitarSpec)spec;

            if (!stringsMatch(model, guitarSpec.model))
            {
                return(false);
            }

            return(true);
        }
コード例 #9
0
ファイル: Guitar.cs プロジェクト: edisongt/MTVersionHFOOAD
 public Guitar(string serialNumber,
               double price,
               GuitarSpec spec)
     : base(serialNumber, price, spec)
 {
 }