public List <TimeInquiringInfo> InquireTimeNumbers(Game game) { dynamic json = null; List <TimeInquiringInfo> result = new List <TimeInquiringInfo>(); try { json = Communicator.Check(); } catch { return(new List <TimeInquiringInfo>()); } try { int[] availability = game switch { Game.TrainSimulator => json.availability.ts, Game.ModelTrainDriving => json.availability.mk, _ => throw new ArgumentOutOfRangeException(), }; for (int i = 0; i < availability.Length; i++) { if (availability[i] >= 0) { string title = gameNames[(int)game - 1] + " " + Strings.StrConv((i + 1).ToString(), VbStrConv.Wide); result.Add(new TimeInquiringInfo(game, i + 1, (result.Count + 1).ToString() + ":" + title.PadRight(16, ' ') + json.availability.time1[(int)game - 1][i] + " " + json.availability.time2[(int)game - 1][i] + " " + Strings.StrConv(json.availability.type[(int)game - 1][i], VbStrConv.Wide) + " " + availability[i].ToString().PadLeft(3, '0'))); } } } catch { return(new List <TimeInquiringInfo>()); } return(result); }