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