Пример #1
0
        public List <ILap> GetLapTimes()
        {
            List <ILap> laps = new List <ILap>();

            if (rFactor.Simulator.Modules.Times_History_LapTimes == false)
            {
                return(laps);
            }

            int lapsbase = __LapsData.ToInt32();

            for (int l = 0; l < this.Laps + 1; l++)
            {
                float start = rFactor.Game.ReadFloat(new IntPtr(lapsbase + l * 0x04 * 0x06));
                float s1    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x04 + l * 0x04 * 0x06));
                float s2    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x08 + l * 0x04 * 0x06));
                float s3    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x0C + l * 0x04 * 0x06));
                s3 -= s2;
                s2 -= s1;
                Lap lap = new Lap(l, s1, s2, s3);
                laps.Add(lap);
            }

            return(laps);
        }
Пример #2
0
        public ILap GetLapTime(int l)
        {
            if (rFactor.Simulator.Modules.Times_History_LapTimes == false)
            {
                return(new Lap(0, 0, 0, 0));
            }
            int lapsbase = __LapsData.ToInt32();

            float start = rFactor.Game.ReadFloat(new IntPtr(lapsbase + l * 0x04 * 0x06));
            float s1    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x04 + l * 0x04 * 0x06));
            float s2    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x08 + l * 0x04 * 0x06));
            float s3    = rFactor.Game.ReadFloat(new IntPtr(lapsbase + 0x0C + l * 0x04 * 0x06));

            s3 -= s2;
            s2 -= s1;
            Lap lap = new Lap(l, s1, s2, s3);

            return(lap);
        }