Beispiel #1
0
        protected static int ParseListFloat2(GameDataParser parser, byte[] bytes, int offset, GameDataBase gameDataObj, string fieldName)
        {
            BitConverterUtility.ConvertEndianFrom(bytes, true, offset, 4);
            var arrayCount = BitConverter.ToInt32(bytes, offset);

            offset += 4;

            List <List <float> > array = new List <List <float> >(arrayCount);

            for (int i = 0; i < arrayCount; i++)
            {
                BitConverterUtility.ConvertEndianFrom(bytes, true, offset, 4);
                var count = BitConverter.ToInt32(bytes, offset);
                offset += 4;

                List <float> values = new List <float>(count);
                for (int j = 0; j < count; j++)
                {
                    BitConverterUtility.ConvertEndianFrom(bytes, true, offset, 4);
                    var value = BitConverter.ToSingle(bytes, offset);
                    offset += 4;
                    values.Add(value);
                }
                array.Add(values);
            }

            gameDataObj.SetListFloat2(fieldName, array);
            return(offset);
        }