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

            offset += 4;

            List <float> values = new List <float>(count);

            for (int i = 0; i < count; i++)
            {
                BitConverterUtility.ConvertEndianFrom(bytes, true, offset, 4);
                var value = BitConverter.ToSingle(bytes, offset);
                offset += 4;
                values.Add(value);
            }

            gameDataObj.SetListFloat(fieldName, values);
            return(offset);
        }