PKHeX.SAV_PokedexXY.saveChanges C# (CSharp) Method

saveChanges() private method

private saveChanges ( ) : void
return void
        private void saveChanges()
        {
            // Save back the Species Bools 
            // Return to Byte Array        
            for (int p = 0; p < 10; p++)
            {
                byte[] sdata = new byte[0x60];

                for (int i = 0; i < 0x60 * 8; i++)
                    if (specbools[p, i])
                        sdata[i / 8] |= (byte)(1 << i % 8);

                Array.Copy(sdata, 0, sav, savshift + 0x1A408 + 0x60 * p, 0x60);
            }

            // Build new bool array for the Languages
            {
                bool[] languagedata = new bool[0x280 * 8];
                for (int i = 0; i < 731; i++)
                    for (int l = 0; l < 7; l++)
                        languagedata[i * 7 + l] = langbools[l, i];

                // Return to Byte Array
                byte[] ldata = new byte[languagedata.Length / 8];

                for (int i = 0; i < languagedata.Length; i++)
                    if (languagedata[i])
                        ldata[i / 8] |= (byte)(1 << i % 8);

                Array.Copy(ldata, 0, sav, savshift + 0x1A7C8, 0x280);
            }

            // Return Foreign Array
            {
                byte[] foreigndata = new byte[0x52];
                for (int i = 0; i < 0x52 * 8; i++)
                    if (foreignbools[i])
                        foreigndata[i / 8] |= (byte)(1 << i % 8);
                Array.Copy(foreigndata, 0, sav, savshift + 0x1AA4C, 0x52);
            }

            // Store Spinda Spot
            uint PID = Util.getHEXval(TB_Spinda);
            Array.Copy(BitConverter.GetBytes(PID), 0, sav, 0x1AA48 + Convert.ToInt16(m_parent.savegame_oras) * 0x38 + savshift, 4);
        }