コード例 #1
0
        public void AddGuitar(String serialNumber, double price, Builder builder, String model, Type type, Wood backWood, Wood topWood, int numStrings)
        {
            GuitarSpec guitarSpec = new GuitarSpec(type, builder, backWood, topWood, model, numStrings);
            Guitar     guitar     = new Guitar(serialNumber, price, guitarSpec);

            guitars.Add(guitar);
        }
コード例 #2
0
 public Guitar GetGuitar(String serialNumber)
 {
     foreach (var item in guitars)
     {
         Guitar guitar = (Guitar)item;
         if (guitar.SerialNumber.Equals(serialNumber))
         {
             return(guitar);
         }
     }
     return(null);
 }