Esempio n. 1
0
 public uint GetGenderDisplayed(Zukan8Index entry)
 {
     var data = GetDexBlock(entry.DexType);
     var index = entry.Offset;
     var val = BitConverter.ToUInt32(data, index + OFS_CAUGHT);
     return (val >> 29) & 3;
 }
Esempio n. 2
0
 private void SetU32(Zukan8Index entry, uint value, int ofs)
 {
     var dex = entry.DexType;
     var index = entry.Offset;
     var data = GetDexBlock(dex);
     BitConverter.GetBytes(value).CopyTo(data, index + ofs);
 }
Esempio n. 3
0
 public uint GetAltFormDisplayed(Zukan8Index entry)
 {
     var data = GetDexBlock(entry.DexType);
     var index = entry.Offset;
     var val = BitConverter.ToUInt32(data, index + OFS_CAUGHT);
     return (val >> 15) & 0x1FFF; // (0x1FFF is really overkill, GameFreak)
 }
Esempio n. 4
0
 private uint GetU32(Zukan8Index entry, int ofs)
 {
     var dex = entry.DexType;
     var index = entry.Offset;
     var data = GetDexBlock(dex);
     return BitConverter.ToUInt32(data, index + ofs);
 }
Esempio n. 5
0
 public void SetGenderDisplayed(Zukan8Index entry, uint value = 0)
 {
     var data = GetDexBlock(entry.DexType);
     var index = entry.Offset;
     var val = BitConverter.ToUInt32(data, index + OFS_CAUGHT);
     uint nv = (val & ~(3u << 29)) | ((value & 3) << 29);
     BitConverter.GetBytes(nv).CopyTo(data, index + OFS_CAUGHT);
 }
Esempio n. 6
0
        public void SetSeenRegion(Zukan8Index entry, int form, int region, bool value = true)
        {
            if ((uint) region >= SeenRegionCount)
                throw new ArgumentException(nameof(region));
            if ((uint) form > 63)
                return;

            var data = GetDexBlock(entry.DexType);
            int index = entry.Offset;
            var ofs = SeenRegionSize * region;
            SetFlag(data, index + ofs, form, value);
        }
Esempio n. 7
0
        public bool GetSeen(Zukan8Index entry)
        {
            byte[] data = GetDexBlock(entry.DexType);
            int offset = entry.Offset;
            for (int i = 0; i < SeenRegionCount; i++)
            {
                var ofs = offset + (SeenRegionSize * i);
                if (BitConverter.ToUInt64(data, ofs) != 0)
                    return true;
            }

            return false;
        }
Esempio n. 8
0
        public bool GetSeenRegion(Zukan8Index entry, int form, int region)
        {
            if ((uint)region >= SeenRegionCount)
                throw new ArgumentException(nameof(region));
            if ((uint)form > 63)
                return false;

            var dex = entry.DexType;
            var offset = entry.Offset;
            var data = GetDexBlock(dex);
            var ofs = SeenRegionSize * region;
            return GetFlag(data, offset + ofs, form);
        }
Esempio n. 9
0
 public void SetBattledCount(Zukan8Index entry, uint value) => SetU32(entry, value, OFS_BATTLED);
Esempio n. 10
0
 public uint GetBattledCount(Zukan8Index entry) => GetU32(entry, OFS_BATTLED);
Esempio n. 11
0
 public void SetCaughtFlags32(Zukan8Index entry, uint value) => SetU32(entry, value, OFS_CAUGHT);
Esempio n. 12
0
 public void SetDisplayShiny(Zukan8Index entry, bool value = true) => SetCaughtFlagID(entry, 31, value);
Esempio n. 13
0
 public bool GetDisplayShiny(Zukan8Index entry) => GetCaughtFlagID(entry, 31);
Esempio n. 14
0
 public bool GetIsLanguageIndexObtained(Zukan8Index entry, int langIndex) => GetCaughtFlagID(entry, 2 + langIndex);
Esempio n. 15
0
 public bool GetCaught(Zukan8Index entry) => GetCaughtFlagID(entry, 0);
Esempio n. 16
0
 public void SetCaught(Zukan8Index entry, bool value = true) => SetCaughtFlagID(entry, 0, value);
Esempio n. 17
0
 private void ClearDexEntryAll(Zukan8Index entry)
 {
     var data = GetDexBlock(entry.DexType);
     Array.Clear(data, entry.Offset, EntrySize);
 }
Esempio n. 18
0
 public bool GetCaughtGigantamaxed(Zukan8Index entry) => GetCaughtFlagID(entry, 1);
Esempio n. 19
0
 public void SetCaughtFlagID(Zukan8Index entry, int bit, bool value = true)
 {
     var data = GetDexBlock(entry.DexType);
     SetFlag(data, entry.Offset + OFS_CAUGHT, bit, value);
 }
Esempio n. 20
0
 private bool GetCaughtFlagID(Zukan8Index entry, int bit)
 {
     var data = GetDexBlock(entry.DexType);
     return GetFlag(data, entry.Offset + OFS_CAUGHT, bit);
 }
Esempio n. 21
0
 public void SetIsLanguageIndexObtained(Zukan8Index entry, int langIndex, bool value = true) => SetCaughtFlagID(entry, 2 + langIndex, value);
Esempio n. 22
0
 public uint GetUnk2Count(Zukan8Index entry) => GetU32(entry, OFS_UNK2);
Esempio n. 23
0
 public void SetUnk2Count(Zukan8Index entry, uint value) => SetU32(entry, value, OFS_UNK2);
Esempio n. 24
0
 public bool GetDisplayDynamaxInstead(Zukan8Index entry) => GetCaughtFlagID(entry, 28);
Esempio n. 25
0
 public void SetDisplayDynamaxInstead(Zukan8Index entry, bool value = true) => SetCaughtFlagID(entry, 28, value);
Esempio n. 26
0
 public void SetCaughtGigantamax(Zukan8Index entry, bool value = true) => SetCaughtFlagID(entry, 1, value);
Esempio n. 27
0
 public Zukan8EntryInfo(int species, Zukan8Index entry)
 {
     Species = species;
     Entry = entry;
 }
Esempio n. 28
0
 public bool GetEntry(int species, out Zukan8Index entry) => DexLookup.TryGetValue(species, out entry);