Пример #1
0
        private static List <StorageSlotOffset> GetExtraSlots7(SAV7 sav, bool all)
        {
            var list = new List <StorageSlotOffset>
            {
                new StorageSlotOffset {
                    Type = StorageSlotType.GTS, Offset = sav.GTS
                },
                new StorageSlotOffset {
                    Type = StorageSlotType.Fused, Offset = sav.GetFusedSlotOffset(0)
                }
            };

            if (sav.USUM)
            {
                list.AddRange(new[]
                {
                    new StorageSlotOffset {
                        Type = StorageSlotType.Fused, Offset = sav.GetFusedSlotOffset(1)
                    },
                    new StorageSlotOffset {
                        Type = StorageSlotType.Fused, Offset = sav.GetFusedSlotOffset(2)
                    },
                });
            }

            if (!all)
            {
                return(list);
            }

            for (int i = 0; i < SAV7.ResortCount; i++)
            {
                list.Add(new StorageSlotOffset {
                    Type = StorageSlotType.Resort, Offset = sav.GetResortSlotOffset(i)
                });
            }
            return(list);
        }
Пример #2
0
 public Record6(SAV7 sav, int offset, IReadOnlyList <byte> maxes) : base(sav)
 {
     Offset    = offset;
     RecordMax = maxes;
 }
Пример #3
0
 public BoxLayout7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #4
0
 public MysteryBlock7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #5
0
 public FashionBlock7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #6
0
        /// <summary>Creates an instance of a SaveFile using the given save data.</summary>
        /// <param name="data">Save data from which to create a SaveFile.</param>
        /// <returns>An appropriate type of save file for the given data, or null if the save data is invalid.</returns>
        public static SaveFile getVariantSAV(byte[] data)
        {
            // Pre-check for header/footer signatures
            SaveFile sav;
            byte[] header = new byte[0], footer = new byte[0];
            CheckHeaderFooter(ref data, ref header, ref footer);

            switch (getSAVGeneration(data))
            {
                // Main Games
                case GameVersion.Gen1:      sav = new SAV1(data); break;
                case GameVersion.Gen2:      sav = new SAV2(data); break;
                case GameVersion.Gen3:      sav = new SAV3(data); break;
                case GameVersion.Gen4:      sav = new SAV4(data); break;
                case GameVersion.Gen5:      sav = new SAV5(data); break;
                case GameVersion.Gen6:      sav = new SAV6(data); break;
                case GameVersion.Gen7:      sav = new SAV7(data); break;

                // Side Games
                case GameVersion.COLO:      sav = new SAV3Colosseum(data); break;
                case GameVersion.XD:        sav = new SAV3XD(data); break;
                case GameVersion.RSBOX:     sav = new SAV3RSBox(data); break;
                case GameVersion.BATREV:    sav = new SAV4BR(data); break;
                
                // No pattern matched
                default: return null;
            }
            sav.Header = header;
            sav.Footer = footer;
            return sav;
        }
Пример #7
0
 public BattleTree7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #8
0
 public void CopyTo(SAV7 sav) => sav.SetData(Data, ofs);
Пример #9
0
 public Situation7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #10
0
 public Misc7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #11
0
 public ResortSave7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #12
0
 public PokeFinder7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #13
0
            public void WriteToSAV(SAV7 SAV)
            {
                if (SAV.Generation != 7)
                    return;

                int ofs = SAV.PokeDex + 0x8 + MiscLen;
                setBits(Owned).CopyTo(SAV.Data, ofs);

                ofs += OwnedLen;
                for (int i = 0; i < 4; i++)
                {
                    setBits(Seen[i]).CopyTo(SAV.Data, ofs);
                    ofs += SeenDispLen;
                }
                for (int i = 0; i < 4; i++)
                {
                    setBits(Displayed[i]).CopyTo(SAV.Data, ofs);
                    ofs += SeenDispLen;
                }
                setBits(LanguageFlags).CopyTo(SAV.Data, SAV.PokeDexLanguageFlags);
            }
Пример #14
0
            public PokeDex7(SAV7 SAV)
            {
                if (SAV.Generation != 7)
                    return;

                int ofs = SAV.PokeDex + 0x8 + MiscLen;
                Owned = getBits(SAV.Data, ofs, OwnedLen);

                ofs += OwnedLen;
                for (int i = 0; i < 4; i++)
                {
                    Seen[i] = getBits(SAV.Data, ofs, SeenDispLen);
                    ofs += SeenDispLen;
                }
                for (int i = 0; i < 4; i++)
                {
                    Displayed[i] = getBits(SAV.Data, ofs, SeenDispLen);
                    ofs += SeenDispLen;
                }
                LanguageFlags = getBits(SAV.Data, SAV.PokeDexLanguageFlags, LanguageLen);
            }
Пример #15
0
 public FieldMoveModelSave7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #16
0
 public FestaFacility(SAV7 sav, int index)
 {
     ofs      = (index * SIZE) + sav.Festa.Offset + 0x310;
     Data     = sav.GetData(ofs, SIZE);
     Language = sav.Language;
 }
Пример #17
0
 public FestaFacility(SAV7 sav, int index)
 {
     ofs      = index * SIZE + sav.JoinFestaData + 0x310;
     Data     = sav.GetData(ofs, SIZE);
     Language = sav.Language;
 }
Пример #18
0
        public const int NexUniqueIDSize = 32; // 128 bits

        public MyStatus7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #19
0
 public JoinFesta7(SAV7 sav, int offset) : base(sav) => Offset = offset;
Пример #20
0
 public BeanPouch(SAV7 sav) => SAV = sav;
Пример #21
0
        /* ===32 bits===
         * talkSpeed:2      0,1
         * battleAnim:1     2
         * battleStyle:1    3
         * unknown:9        4..12
         * buttonMode:2     13,14
         * boxStatus:1      15
         * everything else: unknown
         */

        public ConfigSave7(SAV7 sav, int offset) : base(sav) => Offset = offset;