using System.Collections.Generic;
namespace PKHeX.Core
{
///
/// Key Value pair for a displayed and underlying value.
///
public struct ComboItem
{
public string Text { get; set; }
public int Value { get; set; }
}
public static class ComboItemExtensions
{
public static string[] GetArray(this IReadOnlyList list)
{
var max = list[list.Count - 1].Value;
return GetArray(list, max);
}
public static string[] GetArray(this IEnumerable list, int max)
{
var arr = new string[max + 1];
foreach (var item in list)
arr[item.Value] = item.Text;
return arr;
}
}
}