Example #1
0
        public void SetValues(FuelManagerData fuelData)
        {
            this.InTank = fuelData.FuelInTank;

            this.LapsCompleted = fuelData.LapsCompleted;

            this.LapsRemaining = fuelData.LapsRemaining;

            this.PerLap = fuelData.FuelUsagePerLap;

            this.TotalLapTime = fuelData.TotalRaceTime;

            this.TotalUsed = fuelData.TotalFuelUsed;

            this.AmountToAdd = fuelData.FuelToFinish;

            this.RemainingSessionTime = fuelData.RemainingRacetime;

            this.Liters  = false;
            this.Gallons = false;
            if (fuelData.Unit == FuelUnit.Liters)
            {
                this.Liters  = true;
                this.Gallons = false;
            }
            else if (fuelData.Unit == FuelUnit.Gallons)
            {
                this.Liters  = false;
                this.Gallons = true;
            }

            this.GraceLaps    = false;
            this.GracePercent = false;
            this.GraceValue   = fuelData.GraceOption.Value;
            if (fuelData.GraceOption.Mode == GraceMode.Lap)
            {
                this.GraceLaps    = true;
                this.GracePercent = false;
            }
            else if (fuelData.GraceOption.Mode == GraceMode.Percent)
            {
                this.GraceLaps    = false;
                this.GracePercent = true;
            }
        }
Example #2
0
 public FuelModel(FuelManagerData fuelData)
 {
     this.SetValues(fuelData);
 }