public static ThemePark Read(TextReader reader) { var values = from x in reader.ReadLineAsync().Result.Split(' ') select x.ParseInteger(); // ReSharper disable once PossibleMultipleEnumeration var attractionCount = values.ElementAt(0); // ReSharper disable once PossibleMultipleEnumeration var maxHoursPerDay = values.ElementAt(1); var attractions = Attraction.ReadAll(reader, attractionCount).ToList(); var result = new ThemePark(attractions, maxHoursPerDay); var queryCount = reader.ReadLineAsync().Result.ParseInteger(); result.Guests = Guest.ReadAll(reader, queryCount, result).ToList(); return result; }
protected override void Read(TextReader reader) { _themePark = ThemePark.Read(reader); }