Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public FirstBolidSerializer(FirstBolid obj)
 {
     this.bolid = obj;
 }