Beispiel #1
0
        public static TSR_File Parse(TSR_Reader tsrReader, List <byte> bytes, byte[] rawBytes)
        {
            TSR_File tsrFile = new TSR_File()
            {
                Functions = new List <TSR_Function>()
            };

            int functionCount  = BitConverter.ToUInt16(rawBytes, 0);
            int functionOffset = 2 + (functionCount * 4);

            for (int i = 0; i < functionCount; i++)
            {
                int funcSize = BitConverter.ToInt32(rawBytes, 2 + (4 * i));
                tsrFile.Functions.Add(TSR_Function.Load(tsrReader, functionOffset));
                functionOffset += funcSize;
            }

            return(tsrFile);
        }