From 8ce4f64239aa8c5d703fbd1c9af5a0a0f409f40c Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 24 May 2020 17:11:39 -0700 Subject: [PATCH] Move files to their correct location --- PKHeX.Core/Saves/SAV8BlockIndex.cs | 26 ------------------ .../Gen4}/SAV4BlockDetection.cs | 0 .../Saves/Substructures/Gen6/BattleBox6.cs | 27 +++++++++++++++++++ PKHeX.Core/Saves/Substructures/Gen6/Puff6.cs | 27 +------------------ .../Gen7}/SAV7BlockIndex.cs | 0 5 files changed, 28 insertions(+), 52 deletions(-) delete mode 100644 PKHeX.Core/Saves/SAV8BlockIndex.cs rename PKHeX.Core/Saves/{ => Substructures/Gen4}/SAV4BlockDetection.cs (100%) create mode 100644 PKHeX.Core/Saves/Substructures/Gen6/BattleBox6.cs rename PKHeX.Core/Saves/{ => Substructures/Gen7}/SAV7BlockIndex.cs (100%) diff --git a/PKHeX.Core/Saves/SAV8BlockIndex.cs b/PKHeX.Core/Saves/SAV8BlockIndex.cs deleted file mode 100644 index 3f458a466..000000000 --- a/PKHeX.Core/Saves/SAV8BlockIndex.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace PKHeX.Core -{ - public enum SAV8BlockIndex - { - // todo - MyItem, - Situation, - RandomGroup, - MyStatus, - PokePartySave, - EventWork, - ZukanData, - GtsData, - UnionPokemon, - Misc, - FieldMenu, - ConfigSave, - GameTime, - BOX, - BoxPokemon, - PlayTime, - FieldMoveModelSave, - Records, - Pokedex - } -} \ No newline at end of file diff --git a/PKHeX.Core/Saves/SAV4BlockDetection.cs b/PKHeX.Core/Saves/Substructures/Gen4/SAV4BlockDetection.cs similarity index 100% rename from PKHeX.Core/Saves/SAV4BlockDetection.cs rename to PKHeX.Core/Saves/Substructures/Gen4/SAV4BlockDetection.cs diff --git a/PKHeX.Core/Saves/Substructures/Gen6/BattleBox6.cs b/PKHeX.Core/Saves/Substructures/Gen6/BattleBox6.cs new file mode 100644 index 000000000..dc38d0377 --- /dev/null +++ b/PKHeX.Core/Saves/Substructures/Gen6/BattleBox6.cs @@ -0,0 +1,27 @@ +namespace PKHeX.Core +{ + public sealed class BattleBox6 : SaveBlock + { + public BattleBox6(SaveFile SAV, int offset) : base(SAV) => Offset = offset; + + private int LockedFlagOffset => Offset + (6 * PokeCrypto.SIZE_6STORED); + + public bool Locked + { + get => LockedWiFiTournament || LockedLiveTournament; + set => LockedWiFiTournament = LockedLiveTournament = value; + } + + public bool LockedWiFiTournament + { + get => (Data[LockedFlagOffset] & 1) != 0; + set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~1) | (value ? 1 : 0)); + } + + public bool LockedLiveTournament + { + get => (Data[LockedFlagOffset] & 2) != 0; + set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~2) | (value ? 2 : 0)); + } + } +} diff --git a/PKHeX.Core/Saves/Substructures/Gen6/Puff6.cs b/PKHeX.Core/Saves/Substructures/Gen6/Puff6.cs index a9a6ac50a..8d438c719 100644 --- a/PKHeX.Core/Saves/Substructures/Gen6/Puff6.cs +++ b/PKHeX.Core/Saves/Substructures/Gen6/Puff6.cs @@ -57,29 +57,4 @@ namespace PKHeX.Core Array.Reverse(Data, Offset, PuffCount); } } - - public sealed class BattleBox6 : SaveBlock - { - public BattleBox6(SaveFile SAV, int offset) : base(SAV) => Offset = offset; - - private int LockedFlagOffset => Offset + (6 * PokeCrypto.SIZE_6STORED); - - public bool Locked - { - get => LockedWiFiTournament || LockedLiveTournament; - set => LockedWiFiTournament = LockedLiveTournament = value; - } - - public bool LockedWiFiTournament - { - get => (Data[LockedFlagOffset] & 1) != 0; - set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~1) | (value ? 1 : 0)); - } - - public bool LockedLiveTournament - { - get => (Data[LockedFlagOffset] & 2) != 0; - set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~2) | (value ? 2 : 0)); - } - } -} \ No newline at end of file +} diff --git a/PKHeX.Core/Saves/SAV7BlockIndex.cs b/PKHeX.Core/Saves/Substructures/Gen7/SAV7BlockIndex.cs similarity index 100% rename from PKHeX.Core/Saves/SAV7BlockIndex.cs rename to PKHeX.Core/Saves/Substructures/Gen7/SAV7BlockIndex.cs