Example #1
0
        public override string Serialize(Bolids.Bolid serializableBolid)
        {
            Bolids.Bolid  bolid = serializableBolid as Bolid60;
            List <string> propertiesCollection = new List <string>();
            string        str       = "{";
            string        strclass  = "class:";
            string        strname   = "name:";
            string        strengine = "engine:";
            string        strbody   = "body:";
            string        strnose   = "nose:";

            strclass  = String.Concat(strclass, "Bolid60;");
            strname   = String.Concat(String.Concat(strname, bolid.name), ";");
            strengine = String.Concat(String.Concat(strengine, bolid.engine), ";");
            strbody   = String.Concat(String.Concat(strbody, bolid.body), ";");
            strnose   = String.Concat(strnose, (bolid as Bolid60).nose, ";");
            propertiesCollection.Add(str);
            propertiesCollection.Add(strclass);
            propertiesCollection.Add(strname);
            propertiesCollection.Add(strengine);
            propertiesCollection.Add(strbody);
            propertiesCollection.Add(strnose);
            propertiesCollection.Add("}");
            str = String.Concat(propertiesCollection);
            return(str);
        }
Example #2
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);
        }
Example #3
0
        public override Bolids.Bolid FactoryMethod(Bolids.Bolid bolid, List <string> fields)
        {
            BolidAtmo car = (BolidAtmo)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);
            return(car);
        }