Update GetPKMExtensions to support lower gens

gen1&2 are allowed for 1-2/7+, else the minimum is gen3.
This commit is contained in:
Kurt 2018-06-27 18:53:08 -07:00
parent 69cd79c6b5
commit e4a83dbbac

View File

@ -816,9 +816,18 @@ public static byte GetGCLangIDfromMain(byte value)
public static string[] GetPKMExtensions(int maxGeneration = Generation)
{
var result = new List<string>();
result.AddRange(new [] {"ck3", "xk3", "bk4"}); // Special Cases
for (int i = 1; i <= maxGeneration; i++)
result.Add("pk"+i);
int min = maxGeneration <= 2 || maxGeneration >= 7 ? 1 : 3;
for (int i = min; i <= maxGeneration; i++)
result.Add($"pk{i}");
if (maxGeneration >= 3)
{
result.Add("ck3");
result.Add("xk3");
}
if (maxGeneration >= 4)
result.Add("bk4");
return result.ToArray();
}