Ignore empty pkms when exporting a list of sets

chain method calls
This commit is contained in:
Kurt 2018-06-16 21:46:43 -07:00
parent 39ce7e56e4
commit 1ab7acc958

View File

@ -561,7 +561,7 @@ public static IEnumerable<ShowdownSet> GetShowdownSets(IEnumerable<string> lines
/// </summary>
/// <param name="data">Pokémon data to summarize.</param>
/// <returns>Consumable list of <see cref="ShowdownSet.Text"/> lines.</returns>
public static IEnumerable<string> GetShowdownSets(IEnumerable<PKM> data) => data.Select(GetShowdownText);
public static IEnumerable<string> GetShowdownSets(IEnumerable<PKM> data) => data.Where(p => p.Species != 0).Select(GetShowdownText);
/// <summary>
/// Fetches ShowdownSet lines from the input <see cref="PKM"/> data, and combines it into one string.
@ -569,6 +569,6 @@ public static IEnumerable<ShowdownSet> GetShowdownSets(IEnumerable<string> lines
/// <param name="data">Pokémon data to summarize.</param>
/// <param name="separator">Splitter between each set.</param>
/// <returns>Single string containing all <see cref="ShowdownSet.Text"/> lines.</returns>
public static string GetShowdownSets(IEnumerable<PKM> data, string separator) => string.Join(separator, data.Select(GetShowdownText));
public static string GetShowdownSets(IEnumerable<PKM> data, string separator) => string.Join(separator, GetShowdownSets(data));
}
}