public void ApplyParameter(IniValueObject obj)
        {
            switch (obj.Key)
            {
            case "Slope":
                Slope = obj.ReadAsFloat();
                break;

            case "Slip":
                AllowedSlip = obj.ReadAsFloat();
                break;
            }
        }
Exemple #2
0
 public override void ApplyParameter(IniValueObject obj)
 {
     base.ApplyParameter(obj);
     switch (obj.Key)
     {
     case "Ets2Engine":
         Ets2Torque = obj.ReadAsFloat();
         break;
     }
 }
Exemple #3
0
        public void ApplyParameter(IniValueObject obj)
        {
            switch (obj.Key)
            {
            case "Frame":
                var thr    = obj.ReadAsFloat(0);
                var clt    = obj.ReadAsFloat(1);
                var thrAbs = obj.ReadAsString(2);
                var gear   = obj.ReadAsString(3);

                var useNewGear       = gear == "new";
                var useOldGear       = gear == "old";
                var absoluteThrottle = thrAbs == "abs";

                var frame = new ShiftPatternFrame(clt, thr, absoluteThrottle, useOldGear, useNewGear);

                Frames.Add(frame);
                break;
            }
        }
Exemple #4
0
        public void ApplyParameter(IniValueObject obj)
        {
            switch (obj.Key)
            {
            case "P":
                PSlope = obj.ReadAsFloat();
                break;

            case "Imax":
                Imax = obj.ReadAsFloat();
                break;

            case "I":
                ISlope = obj.ReadAsFloat();
                break;

            case "D":
                DSlope = obj.ReadAsFloat();
                break;

                // TODO: implement PID
            }
        }
Exemple #5
0
        public void ApplyParameter(IniValueObject obj)
        {
            switch (obj.Key)
            {
            case "Adaptive":
                Adaptive = obj.ReadAsInteger() == 1;
                break;

            case "Limit":
                SpeedLimit = obj.ReadAsInteger();
                break;

            case "Slope":
                SpeedSlope = obj.ReadAsFloat();
                break;

            case "Disable":
                Enabled = false;
                break;
            }
        }
        public virtual void ApplyParameter(IniValueObject obj)
        {
            if (obj.Group == "Engine")
            {
                switch (obj.Key)
                {
                case "Idle":
                    StallRpm = obj.ReadAsFloat();
                    break;

                case "Max":
                    MaximumRpm = obj.ReadAsFloat();
                    break;

                case "Power":
                    Engine.Add(obj.ReadAsFloat(0), new GenericEngineData(obj.ReadAsFloat(1), obj.ReadAsFloat(2)));
                    break;
                }
            }
            else if (obj.Group == "Gearbox")
            {
                switch (obj.Key)
                {
                case "Gears":
                    Gears      = obj.ReadAsInteger();
                    GearRatios = new double[Gears];
                    break;

                case "Gear":
                    GearRatios[obj.ReadAsInteger(0)] = obj.ReadAsFloat(1);
                    break;

                case "GearR":
                    GearReverse = obj.ReadAsFloat();
                    break;
                }
            }
        }