Laptimes and sectors are now fixed
This commit is contained in:
@@ -47,6 +47,7 @@ namespace Test_Merge
|
||||
|
||||
List<(int LapTime, int Lap)> lapsInfos = Storage.GetDriverLaptimes(driverName, 5);
|
||||
|
||||
int id = 0;
|
||||
foreach ((int LapTime, int Lap) lapData in lapsInfos)
|
||||
{
|
||||
Button newButton = new Button();
|
||||
@@ -55,6 +56,8 @@ namespace Test_Merge
|
||||
newButton.Text = Reader.ConvertMsToTime(lapData.LapTime);
|
||||
newButton.Size = labelDimensions;
|
||||
newButton.Click += form1.btnLapTime_Click;
|
||||
newButton.Location = new Point(0, id * newButton.Height);
|
||||
id++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,16 +155,13 @@ namespace Test_Merge
|
||||
{
|
||||
List<int> sectors = Storage.GetSectorsFromLapTime(driverName, Lap);
|
||||
string message = "Lap time infos" + Environment.NewLine;
|
||||
if (sectors.Count() == 3)
|
||||
{
|
||||
message += LapTime + Environment.NewLine;
|
||||
if (sectors.Count > 0)
|
||||
message += "Sector 1 : " + Reader.ConvertMsToTime(sectors[0]) + Environment.NewLine;
|
||||
if (sectors.Count > 1)
|
||||
message += "Sector 2 : " + Reader.ConvertMsToTime(sectors[1]) + Environment.NewLine;
|
||||
if (sectors.Count > 2)
|
||||
message += "Sector 3 : " + Reader.ConvertMsToTime(sectors[2]) + Environment.NewLine;
|
||||
}
|
||||
if (sectors.Count > 0)
|
||||
message += "Sector 1 : " + Reader.ConvertMsToTime(sectors[0]) + Environment.NewLine;
|
||||
if (sectors.Count > 1)
|
||||
message += "Sector 2 : " + Reader.ConvertMsToTime(sectors[1]) + Environment.NewLine;
|
||||
if (sectors.Count > 2)
|
||||
message += "Sector 3 : " + Reader.ConvertMsToTime(sectors[2]) + Environment.NewLine;
|
||||
MessageBox.Show(message);
|
||||
}
|
||||
public void DisplayLiveRanking(Panel pnl, Form1 form1)
|
||||
|
||||
Reference in New Issue
Block a user