Example #1
0
        private static ShadowInfoEntryXD GetEntry(byte[] data, int i)
        {
            var d     = data.Slice(i * SIZE_ENTRY, SIZE_ENTRY);
            var entry = new ShadowInfoEntryXD(d);

            return(entry);
        }
Example #2
0
        private static ShadowInfoEntryXD GetEntry(byte[] data, int i)
        {
            var d = new byte[SIZE_ENTRY];

            Array.Copy(data, i * SIZE_ENTRY, d, 0, SIZE_ENTRY);

            var entry = new ShadowInfoEntryXD(d);

            return(entry);
        }
Example #3
0
        public void SetEntry(ShadowInfoEntryXD Entry)
        {
            var entry = GetEntry(Entry.Species, Entry.PID);
            if (entry.IsEmpty)
                return;

            int index = Array.FindIndex(Entries.ToArray(), ent => ent.Species == entry.Species);
            if (index > 0)
                Entries[index] = entry;
            else
                Entries.Add(entry);
        }
Example #4
0
        public ShadowInfoTableXD(byte[] data)
        {
            Entries = new List<ShadowInfoEntryXD>();
            MaxLength = data.Length;
            const int eSize = ShadowInfoEntryXD.SIZE_ENTRY;
            int eCount = data.Length/eSize;
            for (int i = 0; i < eCount; i++)
            {
                byte[] d = new byte[eSize];
                Array.Copy(data, i*eSize, d, 0, eSize);

                var entry = new ShadowInfoEntryXD(d);
                if (entry.Species != 0)
                    Entries.Add(entry);
            }
        }
Example #5
0
        public ShadowInfoTableXD(byte[] data)
        {
            Entries   = new List <ShadowInfoEntryXD>();
            MaxLength = data.Length;
            const int eSize  = ShadowInfoEntryXD.SIZE_ENTRY;
            int       eCount = data.Length / eSize;

            for (int i = 0; i < eCount; i++)
            {
                byte[] d = new byte[eSize];
                Array.Copy(data, i * eSize, d, 0, eSize);

                var entry = new ShadowInfoEntryXD(d);
                //if (entry.Species != 0)
                Entries.Add(entry);
            }
        }
Example #6
0
        public void SetEntry(ShadowInfoEntryXD Entry)
        {
            var entry = GetEntry(Entry.Species, Entry.PID);

            if (entry.IsEmpty)
            {
                return;
            }

            int index = Entries.FindIndex(ent => ent.Species == entry.Species);

            if (index >= 0)
            {
                Entries[index] = entry;
            }
            else
            {
                Entries.Add(entry);
            }
        }