public static Bolid80 Bolid80Deserialize(string str) { Bolid80 bolid80 = new Bolid80(); string strName = @"(?<=name:)([^;]*)"; string strBody = @"(?<=body:)([^;]*)"; string strEngine = @"(?<=engine:)([^;]*)"; string strNose = @"(?<=nose:)([^;]*)"; string strRearWing = @"(?<=rearwing:)([^;]*)"; string strDownForce = @"(?<=downforce:)([^;]*)"; string strFrontWing = @"(?<=frontwing:)([^;]*)"; Regex regName = new Regex(strName); Regex regBody = new Regex(strBody); Regex regEngine = new Regex(strEngine); Regex regNose = new Regex(strNose); Regex regRearWing = new Regex(strRearWing); Regex regDownForce = new Regex(strDownForce); Regex regFrontWing = new Regex(strFrontWing); bolid80.name = regName.Match(str).ToString(); bolid80.body = regBody.Match(str).ToString(); bolid80.engine = regEngine.Match(str).ToString(); bolid80.nose = regNose.Match(str).ToString(); bolid80.DownForce = regDownForce.Match(str).ToString(); bolid80.RearWing = regRearWing.Match(str).ToString(); bolid80.FrontWing = regFrontWing.Match(str).ToString(); return(bolid80); }
public override Bolid FactoryMethod(Bolid bolid, List <string> fields) { Bolid80 car = (Bolid80)bolid; fields.Add(car.name); fields.Add(car.engine); fields.Add(car.body); fields.Add(car.nose); fields.Add(car.RearWing); fields.Add(car.DownForce); fields.Add(car.FrontWing); return(car); }
public override Bolid FactoryMethod(List <string> fields) { Bolid80 bolid = new Bolid80(); bolid.name = fields[0]; bolid.engine = fields[1]; bolid.body = fields[2]; bolid.nose = fields[3]; bolid.RearWing = fields[4]; bolid.DownForce = fields[5]; bolid.FrontWing = fields[6]; return(bolid); }
public Bolid80Serializer(Bolid80 obj) { this.bolid = obj; }