public List <Guitar> Search(GuitarSpec aGuitarSpec) { List <Guitar> aReturn = new List <Guitar>(); for (int i = 0; i < Chitare.Count; i++) { if (Chitare[i].Spec.Matches(aGuitarSpec)) { aReturn.Add(Chitare[i]); } } return(aReturn); }
public Boolean Matches(GuitarSpec aGuitarSpec) { if (Builder == aGuitarSpec.Builder && ( (aGuitarSpec.Model == "") || (Model.ToLower() == aGuitarSpec.Model.ToLower()) ) && Type == aGuitarSpec.Type && BackWood == aGuitarSpec.BackWood && TopWood == aGuitarSpec.TopWood ) { return(true); } return(false); }
public Guitar(string serialNumber, double price, GuitarSpec spec) { this.SerialNumber = serialNumber; this.Price = price; this.Spec = spec; }