Inheritance: IConfigurable
コード例 #1
0
        public void ApplyParameter(IniValueObject obj)
        {
            switch (obj.Key)
            {
            case "Antistall":
                Antistall = obj.ReadAsString();
                break;

            case "CruiseControl":
                CruiseControl = obj.ReadAsString();
                break;

            case "ShiftCurve":
                ShiftCurve = obj.ReadAsString();
                break;

            case "SpeedLimiter":
                SpeedLimiter = obj.ReadAsString();
                break;

            case "TractionControl":
                TractionControl = obj.ReadAsString();
                break;

            case "ShiftPattern":
                var file   = obj.ReadAsString(2);
                var region = obj.ReadAsString(0).ToLower() + "_" + obj.ReadAsString(1) + "thr";
                ShiftPattern.Add(new ConfigurableShiftPattern(region, file));
                break;
            }
        }
コード例 #2
0
ファイル: Transmission.cs プロジェクト: nlhans/SimShift
        public Transmission()
        {
            configuration = new ShifterTableConfiguration(ShifterTableConfigurationDefault.PeakRpm, Main.Drivetrain, 20, 0);

            LoadShiftPattern("up_1thr", "normal");
            LoadShiftPattern("up_0thr", "normal");
            LoadShiftPattern("down_1thr", "normal");
            LoadShiftPattern("down_0thr", "normal");

            // Add power shift pattern
            var powerShiftPattern = new ShiftPattern();
            powerShiftPattern.Frames.Add(new ShiftPatternFrame(0, 1, false, false, true));
            powerShiftPattern.Frames.Add(new ShiftPatternFrame(0, 1, false, false, false));
            powerShiftPattern.Frames.Add(new ShiftPatternFrame(0, 1, false, false, true));
            powerShiftPattern.Frames.Add(new ShiftPatternFrame(1, 0.5, true, false, true));
            powerShiftPattern.Frames.Add(new ShiftPatternFrame(1, 0.5, true, false, true));
            ShiftPatterns.Add("PowerShift", powerShiftPattern);

            // Initialize all shfiting stuff.
            Shift(0, 1, "up_1thr");
            Enabled = true;
            IsShifting = false;
        }