Beispiel #1
0
        public static TelemetryEvent Create(string data)
        {
            Contract.Requires(data != null && data.Length > 0);

            TelemetryEvent ret = Analyser.DecodeLine(data);

            return(ret);
        }
Beispiel #2
0
        public Standings(string [] pars)
        {
            Positions = new List <StandingsEntry>();

            Flags           = (eStandingsFlags)int.Parse(pars[0]);
            SessionNum      = int.Parse(pars[1]);
            AverageLapTime  = Analyser.DblParse(pars[2]);
            LapsCompleted   = int.Parse(pars[3]);
            NumCautionFlags = int.Parse(pars[4]);
            NumCautionLaps  = int.Parse(pars[5]);
            NumLeadChanges  = int.Parse(pars[6]);

            FastestLap = (StandingsEntry)Analyser.DecodeLine(pars[7]);

            for (int i = 8; i < pars.Length; i++)
            {
                Positions.Add((StandingsEntry)Analyser.DecodeLine(pars[i]));
            }
        }
Beispiel #3
0
        public TelemetryEvent Read()
        {
            TelemetryEvent ret = null;

            if (previousItem != null)
            {
                ret          = previousItem;
                previousItem = null;
            }
            else
            {
                string line = rdr.ReadLine();
                if (line == null)
                {
                    isAtTheEnd = true;
                }
                else
                {
                    ret = Analyser.DecodeLine(line);
                }
            }

            return(ret);
        }