public static string GetType(Game.StartProperties startProperties, [CanBeNull] Game.Result result) {
// TODO: drag mode
if (startProperties.ModeProperties is Game.DriftProperties) {
return "Drift";
}
if (startProperties.ModeProperties is Game.TimeAttackProperties) {
return "Time Attack";
}
if (startProperties.ModeProperties is Game.HotlapProperties) {
return "Hotlap";
}
if (startProperties.ModeProperties is Game.OnlineProperties) {
return "Online";
}
if (startProperties.ModeProperties is Game.PracticeProperties) {
return "Practice";
}
if (result?.Sessions?.Length == 1) {
return "Race";
}
if (result?.Sessions?.Length > 1) {
return "Weekend";
}
return startProperties.ModeProperties is Game.RaceProperties ? "Race" : "Something Unspeakable";
}