Blaze.Server.TdfDecoder.DecodeList C# (CSharp) Method

DecodeList() private method

private DecodeList ( TdfBaseType listType, int listSize ) : ArrayList
listType TdfBaseType
listSize int
return System.Collections.ArrayList
        private ArrayList DecodeList(TdfBaseType listType, int listSize)
        {
            var list = new ArrayList();

            // weird Tdf check #1: HNET, for example.
            if (_data[_stream.Position] == 0x02 && listType == TdfBaseType.Struct)
            {
                _stream.Seek(1, SeekOrigin.Current);

                // also hack, should be 'read until 0x00' or something
                list.Add(ReadTdf());
                list.Add(ReadTdf());

                _stream.ReadByte();
            }
            else
            {
                for (int i = 0; i < listSize; i++)
                {
                    switch (listType)
                    {
                        case TdfBaseType.Integer:
                            list.Add(DecodeInteger());
                            break;

                        case TdfBaseType.String:
                            list.Add(DecodeString());
                            break;

                        case TdfBaseType.Struct:
                            list.Add(DecodeStruct());
                            break;

                        default:
                            break;
                    }
                }
            }

            return list;
        }