Exemplo n.º 1
0
        private List <Race> ConvertToListOfRaces(JsonSchedule jsonSchedule)
        {
            var listRaces = new List <Race>();

            listRaces.AddRange(jsonSchedule.AircraftRaces.ConvertAll(aircraftRace => (Race)aircraftRace));
            listRaces.AddRange(jsonSchedule.BusRaces.ConvertAll(busRace => (Race)busRace));
            listRaces.AddRange(jsonSchedule.TrainRaces.ConvertAll(trainRace => (Race)trainRace));
            return(listRaces);
        }
Exemplo n.º 2
0
        public List <Race> GetRaces()
        {
            JsonSchedule jsonSchedule = JsonConvert.DeserializeObject <JsonSchedule>(LoadSettings.Content);

            return(ConvertToListOfRaces(jsonSchedule));
        }