public override Bolids.Bolid FactoryMethod(Bolids.Bolid bolid, List <string> fields) { FirstBolid car = (FirstBolid)bolid; fields.Add(car.name); fields.Add(car.engine); fields.Add(car.body); return(car); }
public override Bolid FactoryMethod(List <string> fields) { FirstBolid bolid = new FirstBolid(); bolid.name = fields[0]; bolid.engine = fields[1]; bolid.body = fields[2]; return(bolid); }
public static FirstBolid FirstBolidDeserialize(string str) { FirstBolid firstbolid = new FirstBolid(); string strName = @"(?<=name:)([^;]*)"; string strBody = @"(?<=body:)([^;]*)"; string strEngine = @"(?<=engine:)([^;]*)"; Regex regName = new Regex(strName); Regex regBody = new Regex(strBody); Regex regEngine = new Regex(strEngine); firstbolid.name = regName.Match(str).ToString(); firstbolid.body = regBody.Match(str).ToString(); firstbolid.engine = regEngine.Match(str).ToString(); return(firstbolid); }
public FirstBolidSerializer(FirstBolid obj) { this.bolid = obj; }