示例#1
0
        public EncounterTable(byte[] t)
        {
            Rates       = new int[10];
            Encounter7s = new Encounter7[9][];
            MinLevel    = t[0];
            MaxLevel    = t[1];

            for (int i = 0; i < Rates.Length; i++)
            {
                Rates[i] = t[2 + i];
            }

            for (int i = 0; i < Encounter7s.Length - 1; i++)
            {
                Encounter7s[i] = new Encounter7[10];
                var ofs = 0xC + i * 4 * Encounter7s[i].Length;
                for (int j = 0; j < Encounter7s[i].Length; j++)
                {
                    Encounter7s[i][j] = new Encounter7(BitConverter.ToUInt32(t, ofs + 4 * j));
                }
            }

            AdditionalSOS = new Encounter7[6];
            for (var i = 0; i < AdditionalSOS.Length; i++)
            {
                AdditionalSOS[i] = new Encounter7(BitConverter.ToUInt32(t, 0x14C + 4 * i));
            }

            Encounter7s[8] = AdditionalSOS;
            Data           = (byte[])t.Clone();
        }
示例#2
0
        public void Reset()
        {
            var t = Data;

            MinLevel = t[0];
            MaxLevel = t[1];

            for (int i = 0; i < Rates.Length; i++)
            {
                Rates[i] = t[2 + i];
            }

            for (int i = 0; i < Encounter7s.Length - 1; i++)
            {
                Encounter7s[i] = new Encounter7[10];
                var ofs = 0xC + i * 4 * Encounter7s[i].Length;
                for (int j = 0; j < Encounter7s[i].Length; j++)
                {
                    Encounter7s[i][j] = new Encounter7(BitConverter.ToUInt32(t, ofs + 4 * j));
                }
            }

            for (var i = 0; i < AdditionalSOS.Length; i++)
            {
                AdditionalSOS[i] = new Encounter7(BitConverter.ToUInt32(t, 0x14C + 4 * i));
            }

            Encounter7s[8] = AdditionalSOS;
        }