//没有合适的方法来重新,难道是因为签名有问题吗???? public void Add(string serialNumber, double price, Builder_Enum builder, string model, Type_Enum type, Wood_Enum backWood, Wood_Enum topWood, Style_Enum style) { PianoSpec pianoSpec = new PianoSpec(builder, model, type, backWood, topWood, style); Piano piano = new Piano(serialNumber, price, pianoSpec); pianos.Add(piano); }
public PianoSpec(Builder_Enum builder, string Model, Type_Enum type, Wood_Enum backWood, Wood_Enum topWood, Style_Enum style) : base(builder, Model, type, backWood, topWood) { this.builder = builder; this.model = model; this.type = type; this.backWood = backWood; this.topWood = topWood; this.style = style; }
public List <Piano> Search(PianoSpec searchSpec) { List <Piano> matchGuitar = new List <Piano>(); for (int i = 0; i < pianos.Count; i++) { Piano piano = pianos[i]; Builder_Enum builder = searchSpec.Builder; if (builder != piano.InstrumentSpec.Builder) { continue; } string model = searchSpec.Model.ToLower(); if ((model != null) && (!model.Equals("")) && (!model.Equals(piano.InstrumentSpec.Model.ToLower()))) { continue; } Type_Enum type = searchSpec.Type; if (type != piano.InstrumentSpec.Type) { continue; } Wood_Enum backWood = searchSpec.BackWood; if (backWood != piano.InstrumentSpec.BackWood) { continue; } Wood_Enum topWood = searchSpec.TopWood; if (topWood != piano.InstrumentSpec.Top_Wood) { continue; } Style_Enum style = searchSpec.Style; if (style != piano.InstrumentSpec.Style) { continue; } matchGuitar.Add(piano); } return(matchGuitar); }
public PianoSpec(Model_Enum model, Builder_Enum builder, Type_Enum type, Wood_Enum topWood, Wood_Enum backWood, Style_Enum style) : base(model, builder, type, topWood, backWood) { this.style = style; }
public Piano(string serialNumber, double price, Style_Enum a, InstrumentsSpec instrumensSpec) : base(serialNumber, price, instrumensSpec) { }