Exemplo n.º 1
0
        public override IRedHandle <T> ReadCHandle <T>()
        {
            var handle = new CHandle <T>();

            int pointer;

            if (header.version == 2)
            {
                pointer = _reader.ReadInt16();
            }
            else if (header.version == 3 || header.version == 04)
            {
                pointer = _reader.ReadInt32();
            }
            else
            {
                throw new NotImplementedException(nameof(ReadCHandle));
            }

            if (!HandleQueue.ContainsKey(pointer))
            {
                HandleQueue.Add(pointer, new List <IRedBaseHandle>());
            }

            HandleQueue[pointer].Add(handle);

            return(handle);
        }
Exemplo n.º 2
0
        public override IRedWeakHandle <T> ReadCWeakHandle <T>()
        {
            var handle = new CWeakHandle <T>();

            var pointer = _reader.ReadInt32();

            if (!HandleQueue.ContainsKey(pointer))
            {
                HandleQueue.Add(pointer, new List <IRedBaseHandle>());
            }

            HandleQueue[pointer].Add(handle);

            return(handle);
        }