class_name TakeIterator extends Iterator

var iter: Iterator
var limit: int

func _init(iter: Iterator, limit: int) -> void:
    self.iter = iter
    self.limit = limit

func next() -> Option:
    if limit < 0:
        return Option.none

    limit -= 1
    return iter.next()
