#ifndef PORYGONLANG_USERDATACOLLECTIONRANGEITERATOR_HPP
#define PORYGONLANG_USERDATACOLLECTIONRANGEITERATOR_HPP

#include "../../Evaluator/Iterator/Iterator.hpp"
#include "../../Evaluator/EvalValues/NumericEvalValue.hpp"

namespace Porygon::UserData{
    class UserDataCollectionRangeIterator : public Evaluation::Iterator{
        size_t _start;
        size_t _end;

        size_t _current;
    public:
        UserDataCollectionRangeIterator(size_t start, size_t end){
            _start = start;
            _end = end;
            _current = _start;
        }

        const Evaluation::EvalValue* GetCurrent() final{
            return new Evaluation::IntegerEvalValue(_current);
        }
        bool MoveNext() final{
            _current ++;
            return _current <= _end;
        }
        void Reset() final{
            _current = _start;
        }
    };
}

#endif //PORYGONLANG_USERDATACOLLECTIONRANGEITERATOR_HPP
