diff --git a/PKHeX.Core/Game/RegionID.cs b/PKHeX.Core/Game/RegionID.cs index f6fc7477b..f80bf9112 100644 --- a/PKHeX.Core/Game/RegionID.cs +++ b/PKHeX.Core/Game/RegionID.cs @@ -1,6 +1,6 @@ namespace PKHeX.Core { - public enum RegionID + public enum RegionID : byte { None = 0, Japan = 1, diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterCriteria.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterCriteria.cs index 47ce4db87..beab09572 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterCriteria.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterCriteria.cs @@ -1,6 +1,4 @@ -using System; - -namespace PKHeX.Core +namespace PKHeX.Core { /// /// Object that can be fed to a converter to ensure that the resulting meets rough specifications. diff --git a/PKHeX.Core/PKM/Util/ItemConverter.cs b/PKHeX.Core/PKM/Util/ItemConverter.cs index deb51110b..f7f68844c 100644 --- a/PKHeX.Core/PKM/Util/ItemConverter.cs +++ b/PKHeX.Core/PKM/Util/ItemConverter.cs @@ -183,7 +183,7 @@ public static int GetFormatHeldItemID(int item, int srcFormat, int destFormat) if (destFormat != srcFormat && srcFormat <= 3) // past gen items { if (destFormat > 3) // try remapping - return item = srcFormat == 2 ? GetG4Item((byte)item) : GetG4Item((ushort)item); + return srcFormat == 2 ? GetG4Item((byte)item) : GetG4Item((ushort)item); if (destFormat > srcFormat) // can't set past gen items return 0; diff --git a/PKHeX.Core/Saves/Substructures/Battle Videos/RotateDirection.cs b/PKHeX.Core/Saves/Substructures/Battle Videos/RotateDirection.cs index 312a048fa..c55b56361 100644 --- a/PKHeX.Core/Saves/Substructures/Battle Videos/RotateDirection.cs +++ b/PKHeX.Core/Saves/Substructures/Battle Videos/RotateDirection.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PKHeX.Core +namespace PKHeX.Core { public enum RotateDirection { diff --git a/PKHeX.Core/Saves/Util/BoxUtil.cs b/PKHeX.Core/Saves/Util/BoxUtil.cs index b72e35ff7..182c16ba7 100644 --- a/PKHeX.Core/Saves/Util/BoxUtil.cs +++ b/PKHeX.Core/Saves/Util/BoxUtil.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 4e5bce395..5f37e0b06 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -276,11 +276,11 @@ private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external) Array.Resize(ref dragdata, SAV.SIZE_STORED); // Make File - PKM pkx = SAV.GetPKM(dragdata); - string newfile = FileUtil.GetPKMTempFileName(pkx, encrypt); + PKM pk = SAV.GetPKM(dragdata); + string newfile = FileUtil.GetPKMTempFileName(pk, encrypt); try { - TryMakeDragDropPKM(pb, encrypt, pkx, newfile, out external); + TryMakeDragDropPKM(pb, encrypt, pk, newfile, out external); } catch (Exception x) { @@ -291,9 +291,9 @@ private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external) return newfile; } - private bool TryMakeDragDropPKM(PictureBox pb, bool encrypt, PKM pkx, string newfile, out bool external) + private bool TryMakeDragDropPKM(PictureBox pb, bool encrypt, PKM pk, string newfile, out bool external) { - File.WriteAllBytes(newfile, encrypt ? pkx.EncryptedBoxData : pkx.DecryptedBoxData); + File.WriteAllBytes(newfile, encrypt ? pk.EncryptedBoxData : pk.DecryptedBoxData); var img = (Bitmap)pb.Image; SetCursor(new Cursor(img.GetHicon()), pb); HoverCancel(); diff --git a/PKHeX.WinForms/MainWindow/PluginLoader.cs b/PKHeX.WinForms/MainWindow/PluginLoader.cs index 61ed6d241..611c570bf 100644 --- a/PKHeX.WinForms/MainWindow/PluginLoader.cs +++ b/PKHeX.WinForms/MainWindow/PluginLoader.cs @@ -10,7 +10,7 @@ public static class PluginLoader { public static IEnumerable LoadPlugins(string pluginPath) { - IEnumerable dllFileNames = !Directory.Exists(pluginPath) + var dllFileNames = !Directory.Exists(pluginPath) ? Enumerable.Empty() : Directory.EnumerateFiles(pluginPath, "*.dll", SearchOption.AllDirectories); var assemblies = GetAssemblies(dllFileNames); diff --git a/Tests/PKHeX.Core.Tests/PKM/PKMTests.cs b/Tests/PKHeX.Core.Tests/PKM/PKMTests.cs index 3eb872b21..63aff0490 100644 --- a/Tests/PKHeX.Core.Tests/PKM/PKMTests.cs +++ b/Tests/PKHeX.Core.Tests/PKM/PKMTests.cs @@ -48,13 +48,13 @@ public void EncodesNicknameCorrectly() private static void CheckStringGetSet(string check, string instr, string outstr, byte[] indata, byte[] outdata) { + Assert.Equal(instr, outstr); + outdata = outdata.Take(indata.Length).ToArray(); Assert.True(indata.SequenceEqual(outdata), $"{check} did not set properly." + Environment.NewLine + string.Join(", ", outdata.Select(z => $"{z:X2}"))); - - Assert.Equal(instr, outstr); } }