Пример #1
0
        public bool MoveNext(out int count)
        {
            count = 0;
            if (_enums.Count != 0)
            {
                _current = default;
                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <RecommendIndexEntry> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current > _current)
                    {
                        count    = 0;
                        _current = enumerator.Current;
                    }
                }

                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <RecommendIndexEntry> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current == _current)
                    {
                        count++;
                        if (!enumerator.MoveNext())
                        {
                            _enums.RemoveAt(i);
                            i--;//Dirty hack to make list work after removal
                        }
                    }
                }
Пример #2
0
        public void Prepare()
        {
            _enums.Clear();

            foreach (var enumerable in _list)
            {
                HList <RecommendIndexEntry> .Enumerator enumerator = enumerable.GetEnumerator();
                if (enumerator.MoveNext())
                {
                    _enums.Add(enumerator);
                }
            }
        }
Пример #3
0
        public void Reset()
        {
            _enum0 = _list[0].GetEnumerator();
            _enum1 = _list[1].GetEnumerator();
            _enum2 = _list[2].GetEnumerator();
            _enum3 = _list[3].GetEnumerator();
            _enum4 = _list[4].GetEnumerator();

            _move0 = _enum0.MoveNext();
            _move1 = _enum1.MoveNext();
            _move2 = _enum2.MoveNext();
            _move3 = _enum3.MoveNext();
            _move4 = _enum4.MoveNext();
        }
Пример #4
0
        public IEnumerator <uint> GetEnumerator()
        {
            _enums.Clear();

            foreach (var enumerable in _list)
            {
                HList <uint> .Enumerator enumerator = enumerable.GetEnumerator();
                if (enumerator.MoveNext())
                {
                    _enums.Add(enumerator);
                }
            }

            return(this);
        }
Пример #5
0
        public bool MoveNext()
        {
            if (_enums.Count != 0)
            {
                _current = default;
                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <uint> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current > _current)
                    {
                        _current = enumerator.Current;
                    }
                }

                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <uint> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current == _current && !enumerator.MoveNext())
                    {
                        _enums.Remove(enumerator);
                        i--;//Dirty hack to make list work after removal
                    }
                }
Пример #6
0
        public bool MoveNext()
        {
            uint current = default;

            if (_move0)
            {
                current = _enum0.Current;
            }

            if (_move1 && current < _enum1.Current)
            {
                current = _enum1.Current;
            }

            if (_move2 && current < _enum2.Current)
            {
                current = _enum2.Current;
            }

            if (_move3 && current < _enum3.Current)
            {
                current = _enum3.Current;
            }

            if (_move4 && current < _enum4.Current)
            {
                current = _enum4.Current;
            }

            if (current == default)
            {
                return(false);
            }

            if (current == _enum0.Current)
            {
                _move0 = _enum0.MoveNext();
            }

            if (current == _enum1.Current)
            {
                _move1 = _enum1.MoveNext();
            }

            if (current == _enum2.Current)
            {
                _move2 = _enum2.MoveNext();
            }

            if (current == _enum3.Current)
            {
                _move3 = _enum3.MoveNext();
            }

            if (current == _enum4.Current)
            {
                _move4 = _enum4.MoveNext();
            }

            _current = current;
            return(true);
        }