protected override void Load(IniFileSection section)
 {
     base.Load(section);
     LapsCount = section.GetInt("LAPS", 5);
     WaitTime  = TimeSpan.FromSeconds(section.GetInt("WAIT_TIME", 60));
     JoinType  = section.GetIntEnum("IS_OPEN", ServerPresetRaceJoinType.CloseAtStart);
 }
Exemple #2
0
 public void LoadFrom(IniFileSection section)
 {
     PosX      = section.GetInt("POSX", 0);
     PosY      = section.GetInt("POSY", 0);
     IsVisible = section.GetBool("VISIBLE", false);
     IsBlocked = section.GetBool("BLOCKED", false);
     Scale     = section.GetDouble("SCALE", 1d).ToIntPercentage();
 }
Exemple #3
0
 public static TrackProperties Load(IniFileSection section)
 {
     return(new TrackProperties {
         Preset = section.GetIntNullable("Preset"),
         SessionStart = section.GetInt("SESSION_START", 95),
         Randomness = section.GetInt("RANDOMNESS", 2),
         LapGain = section.GetInt("LAP_GAIN", 10),
         SessionTransfer = section.GetInt("SESSION_TRANSFER", 90)
     });
 }
Exemple #4
0
            public ControlsInput(IniFileSection section, Keys key)
            {
                _joy          = section.GetInt("JOY", -1);
                _button       = section.GetInt("BUTTON", -1);
                _pov          = section.GetInt("__CM_POV", -1);
                _povDirection = section.GetIntEnum("__CM_POV_DIR", DirectInputPovDirection.Up);

                var k = section.GetInt("KEY", -1);

                _key = k == -1 ? key : (Keys)k;
            }
Exemple #5
0
 internal FlameDescription(string name, IniFileSection fileSection, Matrix graphicMatrix)
 {
     Name      = name;
     Position  = fileSection.GetSlimVector3("POSITION");
     Direction = fileSection.GetSlimVector3("DIRECTION");
     Group     = fileSection.GetInt("GROUP", 0);
 }
Exemple #6
0
 public BlurredObject(IniFileSection section)
 {
     WheelIndex = section.GetInt("WHEEL_INDEX", -1);
     Name       = section.GetNonEmpty("NAME");
     MinSpeed   = section.GetFloat("MIN_SPEED", 0f);
     MaxSpeed   = section.GetFloat("MAX_SPEED", 30f);
 }
Exemple #7
0
 public WingAnimation(IniFileSection section) : base(section.GetNonEmpty("FILE"), section.GetFloat("TIME", 1f))
 {
     Id         = section.GetInt("WING", 0);
     Next       = section.GetIntNullable("NEXT");
     StartAngle = section.GetFloat("MIN", 0f);
     AngleRange = section.GetFloat("MAX", 60f) - StartAngle;
 }
 /// <summary>
 /// Create a new AssistsViewModel which will load data from serialized string, but won’t
 /// save any changes if they will occur.
 /// </summary>
 /// <param name="section">INI-file section.</param>
 public static TrackStateViewModelBase CreateBuiltIn([NotNull] IniFileSection section)
 {
     return(new TrackStateViewModelBase(null, false)
     {
         GripStart = section.GetDouble("SESSION_START", 95d) / 100d,
         GripTransfer = section.GetDouble("SESSION_TRANSFER", 90d) / 100d,
         GripRandomness = section.GetDouble("RANDOMNESS", 2d) / 100d,
         LapGain = section.GetInt("LAP_GAIN", 132),
         Description = section.GetNonEmpty("DESCRIPTION")
     });
 }
Exemple #9
0
            public AxleSuspension(IniFileSection basic, IniFileSection section, IniFileSection axleSection, bool front, float wheelRadius) : base(front, wheelRadius)
            {
                var baseY      = section.GetFloat("BASEY", 1f);
                var track      = section.GetFloat("TRACK", 1f);
                var wheelbase  = basic.GetFloat("WHEELBASE", 2f);
                var cgLocation = basic.GetFloat("CG_LOCATION", 0.5f);

                StaticCamber = basic.GetFloat("STATIC_CAMBER", 0f);
                RefPoint     = front ?
                               new Vector3(0f, baseY, wheelbase * (1f - cgLocation)) :
                               new Vector3(0f, baseY, -wheelbase * cgLocation);

                AxleWidth = track;
                Links     = Enumerable.Range(0, axleSection.GetInt("LINK_COUNT", 0)).Select(i => new AxleLink(
                                                                                                axleSection.GetSlimVector3($"J{i}_CAR"),
                                                                                                axleSection.GetSlimVector3($"J{i}_AXLE"))).ToArray();
            }
Exemple #10
0
 protected override void Load(IniFileSection session, IniFileSection main)
 {
     base.Load(session, main);
     QualifyLimitPercentage = main.GetInt("QUALIFY_MAX_WAIT_PERC", 120);
 }