Example #1
0
            public string Serialize() {
                var s = new StringWriter();
                var w = new JsonTextWriter(s);

                w.WriteStartObject();
                w.Write(nameof(IdealLine), IdealLine);
                w.Write(nameof(AutoBlip), AutoBlip);
                w.Write(nameof(StabilityControl), StabilityControl);
                w.Write(nameof(AutoBrake), AutoBrake);
                w.Write(nameof(AutoShifter), AutoShifter);
                w.Write(nameof(SlipSteam), SlipSteam);
                w.Write(nameof(AutoClutch), AutoClutch);
                w.Write(nameof(Abs), Abs);
                w.Write(nameof(TractionControl), TractionControl);
                w.Write(nameof(VisualDamage), VisualDamage);
                w.Write(nameof(Damage), Damage);
                w.Write(nameof(TyreWear), TyreWear);
                w.Write(nameof(FuelConsumption), FuelConsumption);
                w.Write(nameof(TyreBlankets), TyreBlankets);
                w.WriteEndObject();

                return s.ToString();
            }
Example #2
0
            public string Serialize() {
                var s = new StringWriter();
                var w = new JsonTextWriter(s);
                w.WriteStartObject();

                w.Write(nameof(CarId), CarId);
                w.Write(nameof(TrackId), TrackId);

                w.Write(nameof(StartedAt), StartedAt);
                w.Write(nameof(Time), Time);
                w.Write(nameof(BestLap), BestLap);
                w.Write(nameof(BestLapId), BestLapId);

                w.WriteNonDefault(nameof(GoneOffroad), GoneOffroad);
                w.WriteNonDefault(nameof(Penalties), Penalties);

                w.WriteNonDefault(nameof(MaxSpeed), MaxSpeed, "F1");
                w.WriteNonDefault(nameof(Distance), Distance, "F1");
                w.WriteNonDefault(nameof(FuelBurnt), FuelBurnt, "F1");
                w.WriteNonDefault(nameof(LongestAirborne), LongestAirborne, "F3");
                w.WriteNonDefault(nameof(LongestWheelie), LongestWheelie, "F3");
                w.WriteNonDefault(nameof(LongestTwoWheels), LongestTwoWheels, "F3");
                w.WriteNonDefault(nameof(TotalAirborne), TotalAirborne, "F2");
                w.WriteNonDefault(nameof(TotalWheelie), TotalWheelie, "F2");
                w.WriteNonDefault(nameof(TotalTwoWheels), TotalTwoWheels, "F2");
                w.WriteNonDefault(nameof(TotalTyreWear), TotalTyreWear, "F3");

                w.WriteEndObject();
                return s.ToString();
            }
Example #3
0
            string IStringSerializable.Serialize() {
                var s = new StringWriter();
                var w = new JsonTextWriter(s);
                
                w.WriteStartObject();
                w.Write("ModeId", ModeId);
                w.Write("FilterValue", FilterValue);

                w.Write("CarIds", CarIds);
                w.Write("CandidatePriorities", CandidatePriorities);
                w.Write("AiLevels", AiLevels);

                w.Write("Names", Names);
                w.Write("Nationalities", Nationalities);
                w.Write("SkinIds", SkinIds);

                w.Write("AiLevelFixed", AiLevelFixed);
                w.Write("AiLevelArrangeRandom", AiLevelArrangeRandom);
                w.Write("AiLevelArrangeReverse", AiLevelArrangeReverse);
                w.Write("AiLevel", AiLevel);
                w.Write("AiLevelMin", AiLevelMin);
                w.Write("OpponentsNumber", OpponentsNumber);
                w.Write("StartingPosition", StartingPosition);
                w.WriteEndObject();

                return s.ToString();
            }