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

            offset += 4;

            Dictionary <string, int> values = new Dictionary <string, int>(count);

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

                BitConverterUtility.ConvertEndianFrom(bytes, true, offset, 4);
                var value = BitConverter.ToInt32(bytes, offset);
                offset += 4;

                values.Add(parser.m_StringBuffList[key], value);
            }

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