overtakes are now detected and displayed
This commit is contained in:
@@ -209,6 +209,38 @@ namespace Test_Merge
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DisplayOvertakes(ListBox lsbResult)
|
||||
{
|
||||
if (LiveDriverDataLogs.Count > 1)
|
||||
{
|
||||
List<DriverData> oldList = LiveDriverDataLogs[LiveDriverDataLogs.Count - 2];
|
||||
List<DriverData> newList = LiveDriverDataLogs[LiveDriverDataLogs.Count - 1];
|
||||
for (int i = 0; i < LiveDriverDataLogs[LiveDriverDataLogs.Count - 1].Count;i++)
|
||||
{
|
||||
if (oldList[i].Name != newList[i].Name) {
|
||||
//There has been a change in the standings
|
||||
for(int y = 0; y < oldList.Count;y++)
|
||||
{
|
||||
if (newList[y].Name == oldList[i].Name)
|
||||
{
|
||||
//We found its new location
|
||||
if (y > i)
|
||||
{
|
||||
//The driver overtook someone
|
||||
lsbResult.Items.Add(newList[y].Name + " climbed to " + y);
|
||||
}
|
||||
else
|
||||
{
|
||||
//The driver got overtook by someone
|
||||
lsbResult.Items.Add(newList[y].Name + " fell to " + y);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DisplayLapTimeInfos(string driverName, int Lap, string LapTime)
|
||||
{
|
||||
List<int> sectors = Storage.GetSectorsFromLapTime(driverName, Lap);
|
||||
|
||||
Reference in New Issue
Block a user