コード例 #1
0
            public override void Set(IniFile file)
            {
                var section = file["RACE"];

                section.SetId("MODEL", CarId ?? "");
                section.SetId("MODEL_CONFIG", "");
                section.SetId("SKIN", CarSkinId ?? "");
                section.SetId("TRACK", TrackId ?? "");
                section.SetId("CONFIG_TRACK", TrackConfigurationId ?? "");

                if (!section.ContainsKey("AI_LEVEL"))
                {
                    section.Set("AI_LEVEL", 100);
                }

                file["CAR_0"] = new IniFileSection(null)
                {
                    ["SETUP"]        = CarSetupId?.ToLowerInvariant() ?? "",
                    ["SKIN"]         = CarSkinId?.ToLowerInvariant(),
                    ["MODEL"]        = "-",
                    ["MODEL_CONFIG"] = "",
                    ["BALLAST"]      = Ballast,
                    ["RESTRICTOR"]   = Restrictor,
                    ["DRIVER_NAME"]  = DriverName,
                    ["NATION_CODE"]  = DriverNationCode ?? GetNationCode(DriverNationality),
                    ["NATIONALITY"]  = DriverNationality
                };

                file["OPTIONS"].Set("USE_MPH", UseMph);
            }
コード例 #2
0
ファイル: Game.Properties.cs プロジェクト: WildGenie/actools
            public override void Set(IniFile file)
            {
                var section = file["RACE"];

                section.SetId("MODEL", CarId ?? "");
                section.SetId("MODEL_CONFIG", "");
                section.SetId("SKIN", CarSkinId ?? "");
                section.SetId("TRACK", TrackId ?? "");
                section.SetId("CONFIG_TRACK", TrackConfigurationId ?? "");

                if (!section.ContainsKey("AI_LEVEL"))
                {
                    section.Set("AI_LEVEL", 100);
                }

                file["CAR_0"] = new IniFileSection {
                    ["SETUP"]        = CarSetupId?.ToLowerInvariant() ?? "",
                    ["SKIN"]         = CarSkinId?.ToLowerInvariant(),
                    ["MODEL"]        = "-",
                    ["MODEL_CONFIG"] = "",
                    ["DRIVER_NAME"]  = DriverName,
                    ["NATIONALITY"]  = DriverNationality
                };
            }