"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
const _ids_1 = require("../../../../_ids");
class Register extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['unit', 'ref', 'name'],
            i: ['done'],
            fo: [],
            o: [],
        }, {
            input: {
                ref: {
                    ref: true,
                },
                unit: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_REGISTER);
    }
    f({ ref, unit, name }, done) {
        // TODO
        this.__system.global.scope[name] = ref;
        this.__system.emitter.emit('register', name, ref);
    }
    onIterDataInputData(name, data) {
        switch (name) {
            case 'done':
                this._done();
                this._backward('done');
                break;
        }
    }
}
exports.default = Register;
//# sourceMappingURL=index.js.map