Minor reorganization

amount of pkm obj classes is pretty high, move the static utility
classes to another folder

breaks usage of pkm.ShowdownText; removes a dependency from PKM.
This commit is contained in:
Kurt 2018-05-18 19:33:11 -07:00
parent 8cf70770cf
commit 95b4d0820d
14 changed files with 8 additions and 32 deletions

View file

@ -2173,7 +2173,7 @@ namespace PKHeX.Core
}
if (IsYellow)
return false;
// Yellow only moves in Red/Blue game, must be Allakazham
// Yellow only moves in Red/Blue game, must be Alakazam
if (pk1.Moves.Contains(134)) // Kinesis, yellow only move
return true;
if (pk1.CurrentLevel < 20 && pkm.Moves.Contains(50)) // Obtaining Disable below level 20 implies a yellow only move

View file

@ -352,7 +352,6 @@ namespace PKHeX.Core
x = (x << p1) | (x << p2);
return value ^ x;
}
public string ShowdownText => ShowdownSet.GetShowdownText(this);
public string[] QRText => this.GetQRLines();
public virtual string FileName

View file

@ -1133,7 +1133,7 @@ namespace PKHeX.WinForms.Controls
{
try
{
var str = string.Join(Environment.NewLine + Environment.NewLine, SAV.PartyData.Select(pk => pk.ShowdownText));
var str = string.Join(Environment.NewLine + Environment.NewLine, SAV.PartyData.Select(ShowdownSet.GetShowdownText));
if (string.IsNullOrWhiteSpace(str)) return;
Clipboard.SetText(str);
}
@ -1144,7 +1144,7 @@ namespace PKHeX.WinForms.Controls
{
try
{
var str = string.Join(Environment.NewLine + Environment.NewLine, SAV.BattleBoxData.Select(pk => pk.ShowdownText));
var str = string.Join(Environment.NewLine + Environment.NewLine, SAV.BattleBoxData.Select(ShowdownSet.GetShowdownText));
if (string.IsNullOrWhiteSpace(str)) return;
Clipboard.SetText(str);
}

View file

@ -170,7 +170,7 @@ namespace PKHeX.WinForms.Controls
if (pk.Species == 0)
ShowSet.RemoveAll();
else
ShowSet.SetToolTip(pb, pk.ShowdownText);
ShowSet.SetToolTip(pb, ShowdownSet.GetShowdownText(pk));
}
private void PlayCry(PKM pk)
{

View file

@ -413,7 +413,8 @@ namespace PKHeX.WinForms
return;
}
var text = PreparePKM().ShowdownText;
var pk = PreparePKM();
var text = ShowdownSet.GetShowdownText(pk);
Clipboard.SetText(text);
var clip = Clipboard.GetText();
if (clip != text)
@ -421,32 +422,8 @@ namespace PKHeX.WinForms
else
WinFormsUtil.Alert(MsgSimulatorExportSuccess, text);
}
private void ClickShowdownExportParty(object sender, EventArgs e)
{
var data = C_SAV.SAV.PartyData;
if (data.Count <= 0) return;
try
{
var split = Environment.NewLine + Environment.NewLine;
var sets = data.Select(z => z.ShowdownText);
Clipboard.SetText(string.Join(split, sets));
WinFormsUtil.Alert(MsgSimulatorExportParty);
}
catch { }
}
private void ClickShowdownExportBattleBox(object sender, EventArgs e)
{
var data = C_SAV.SAV.BattleBoxData;
if (data.Count <= 0) return;
try
{
var split = Environment.NewLine + Environment.NewLine;
var sets = data.Select(z => z.ShowdownText);
Clipboard.SetText(string.Join(split, sets));
WinFormsUtil.Alert(MsgSimulatorExportBattleBox);
}
catch { }
}
private void ClickShowdownExportParty(object sender, EventArgs e) => C_SAV.ClickShowdownExportParty(sender, e);
private void ClickShowdownExportBattleBox(object sender, EventArgs e) => C_SAV.ClickShowdownExportBattleBox(sender, e);
// Main Menu Subfunctions
private void OpenQuick(string path, bool force = false)