private static SessionType GetSessionType(IEvent e)
{
var s = e.Summary;
if (s.StartsWith("First"))
{
return SessionType.P1;
}
if (s.StartsWith("Second"))
{
return SessionType.P2;
}
if (s.StartsWith("Third"))
{
return SessionType.P3;
}
if (s.StartsWith("Qualifying"))
{
return SessionType.Qually;
}
if (s.EndsWith("Prix"))
{
return SessionType.Race;
}
throw new FormatException("Failed to parse the session type from '" + s + "'.");
}