"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Primitive_1 = require("../../../../Primitive");
const _ids_1 = require("../../../_ids");
class Range extends Primitive_1.Primitive {
    constructor(system) {
        super({
            i: ['a', 'b'],
            o: ['i'],
        }, {}, system, _ids_1.ID_RANGE);
    }
    onDataInputData() {
        if (this._input.a.active() && this._input.b.active()) {
            if (this._i.a < this._i.b) {
                this._current = this._i.a;
                this._forward('i', this._current);
            }
            else {
                this._backward_all();
            }
        }
    }
    onDataInputDrop() {
        if (this._current !== undefined) {
            this._forward_all_empty();
        }
    }
    onDataOutputDrop() {
        this._current++;
        if (this._current < this._i.b) {
            this._forward('i', this._current);
        }
        else {
            this._backward_all();
        }
    }
}
exports.default = Range;
//# sourceMappingURL=Class.js.map