public override Bolid FactoryMethod(Bolid bolid, List <string> fields) { Bolid60 car = (Bolid60)bolid; fields.Add(car.name); fields.Add(car.engine); fields.Add(car.body); fields.Add(car.nose); return(car); }
public override Bolid FactoryMethod(List <string> fields) { Bolid60 bolid = new Bolid60(); bolid.name = fields[0]; bolid.engine = fields[1]; bolid.body = fields[2]; bolid.nose = fields[3]; return(bolid); }
public static Bolid60 Bolid60Deserialize(string str) { Bolid60 bolid60 = new Bolid60(); string strName = @"(?<=name:)([^;]*)"; string strBody = @"(?<=body:)([^;]*)"; string strEngine = @"(?<=engine:)([^;]*)"; string strNose = @"(?<=nose:)([^;]*)"; Regex regName = new Regex(strName); Regex regBody = new Regex(strBody); Regex regEngine = new Regex(strEngine); Regex regNose = new Regex(strNose); bolid60.name = regName.Match(str).ToString(); bolid60.body = regBody.Match(str).ToString(); bolid60.engine = regEngine.Match(str).ToString(); bolid60.nose = regNose.Match(str).ToString(); return(bolid60); }
public Bolid60Serializer(Bolid60 obj) { this.bolid = obj; }