Remove unnecessary ComboItem logic

This commit is contained in:
Kurt 2020-12-28 11:56:00 -08:00
parent a124168e87
commit e44100a9fd
3 changed files with 1 additions and 20 deletions

View file

@ -37,7 +37,7 @@ namespace PKHeX.Core
public string Ball => Get(Strings.balllist, pkm.Ball);
public string OT => pkm.OT_Name;
public string Version => Get(Strings.gamelist, pkm.Version);
public string OTLang => Get(GameDataSource.Languages, pkm.Language);
public string OTLang => ((LanguageID)pkm.Language).ToString();
public string Legal { get { var la = new LegalityAnalysis(pkm); return la.Parsed ? la.Valid.ToString() : "-"; } }
#region Extraneous

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
namespace PKHeX.Core
{
@ -24,21 +23,4 @@ namespace PKHeX.Core
public static bool operator ==(ComboItem left, ComboItem right) => left.Equals(right);
public static bool operator !=(ComboItem left, ComboItem right) => !(left == right);
}
public static class ComboItemExtensions
{
public static string[] GetArray(this IReadOnlyList<ComboItem> list)
{
var max = list[list.Count - 1].Value;
return GetArray(list, max);
}
public static string[] GetArray(this IEnumerable<ComboItem> list, int max)
{
var arr = new string[max + 1];
foreach (var item in list)
arr[item.Value] = item.Text;
return arr;
}
}
}

View file

@ -11,7 +11,6 @@ namespace PKHeX.Core
{
public static readonly IReadOnlyList<ComboItem> Regions = Util.GetCSVUnsortedCBList("regions3ds");
public static readonly IReadOnlyList<ComboItem> LanguageList = Util.GetCSVUnsortedCBList("languages");
public static readonly string[] Languages = LanguageList.GetArray();
// ignores Poke/Great/Ultra
private static readonly int[] ball_nums = { 007, 576, 013, 492, 497, 014, 495, 493, 496, 494, 011, 498, 008, 006, 012, 015, 009, 005, 499, 010, 001, 016, 851 };