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)
|
public void DisplayLapTimeInfos(string driverName, int Lap, string LapTime)
|
||||||
{
|
{
|
||||||
List<int> sectors = Storage.GetSectorsFromLapTime(driverName, Lap);
|
List<int> sectors = Storage.GetSectorsFromLapTime(driverName, Lap);
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ namespace Test_Merge
|
|||||||
DisplayResults(errorCode, sw, screen);
|
DisplayResults(errorCode, sw, screen);
|
||||||
DisplayBattles();
|
DisplayBattles();
|
||||||
DisplayDeltas();
|
DisplayDeltas();
|
||||||
|
DisplayOvertakes();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -134,6 +135,10 @@ namespace Test_Merge
|
|||||||
btnSettings.Enabled = true;
|
btnSettings.Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void DisplayOvertakes()
|
||||||
|
{
|
||||||
|
Wrapper.DisplayOvertakes(lsbOvertakes);
|
||||||
|
}
|
||||||
private void DisplayBattles()
|
private void DisplayBattles()
|
||||||
{
|
{
|
||||||
Wrapper.DisplayBattles(pnlBattles,this);
|
Wrapper.DisplayBattles(pnlBattles,this);
|
||||||
|
|||||||
Reference in New Issue
Block a user