mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Remove unnecessary ComboItem logic
This commit is contained in:
parent
a124168e87
commit
e44100a9fd
3 changed files with 1 additions and 20 deletions
|
@ -37,7 +37,7 @@ namespace PKHeX.Core
|
||||||
public string Ball => Get(Strings.balllist, pkm.Ball);
|
public string Ball => Get(Strings.balllist, pkm.Ball);
|
||||||
public string OT => pkm.OT_Name;
|
public string OT => pkm.OT_Name;
|
||||||
public string Version => Get(Strings.gamelist, pkm.Version);
|
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() : "-"; } }
|
public string Legal { get { var la = new LegalityAnalysis(pkm); return la.Parsed ? la.Valid.ToString() : "-"; } }
|
||||||
|
|
||||||
#region Extraneous
|
#region Extraneous
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace PKHeX.Core
|
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.Equals(right);
|
||||||
public static bool operator !=(ComboItem left, ComboItem right) => !(left == 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace PKHeX.Core
|
||||||
{
|
{
|
||||||
public static readonly IReadOnlyList<ComboItem> Regions = Util.GetCSVUnsortedCBList("regions3ds");
|
public static readonly IReadOnlyList<ComboItem> Regions = Util.GetCSVUnsortedCBList("regions3ds");
|
||||||
public static readonly IReadOnlyList<ComboItem> LanguageList = Util.GetCSVUnsortedCBList("languages");
|
public static readonly IReadOnlyList<ComboItem> LanguageList = Util.GetCSVUnsortedCBList("languages");
|
||||||
public static readonly string[] Languages = LanguageList.GetArray();
|
|
||||||
|
|
||||||
// ignores Poke/Great/Ultra
|
// 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 };
|
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 };
|
||||||
|
|
Loading…
Reference in a new issue