"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const Graph_1 = require("../../Class/Graph");
const debug_1 = require("../../debug");
const _ids_1 = require("../../system/_ids");
const system_1 = require("../util/system");
const UNIT_ID_RANDOM_COLOR_BOX = 'randomcolorbox';
const UNIT_ID_EMTPY = 'empty';
const UNIT_ID_IDENTITY = 'identity';
const UNIT_ID_IDENTITY_0 = 'identity0';
const UNIT_ID_IDENTITY_1 = 'identity1';
const spec = system_1.system.newSpec({});
const composition0 = new Graph_1.Graph(spec, {}, system_1.system);
false && (0, debug_1.watchUnitAndLog)(composition0);
false && (0, debug_1.watchGraphAndLog)(composition0);
const UNIT_ID_RANDOM_NUMBER_LTE = 'randomnumberlte';
composition0.addUnitSpec(UNIT_ID_RANDOM_COLOR_BOX, {
    unit: { id: _ids_1.ID_RANDOM_COLOR_BOX },
});
composition0.explodeUnit(UNIT_ID_RANDOM_COLOR_BOX, {}, {}, {});
assert.equal(composition0.getUnitCount(), 3);
assert.equal(composition0.getInputCount(), 1);
assert.equal(composition0.getOutputCount(), 0);
const spec0 = system_1.system.newSpec({});
const composition1 = new Graph_1.Graph(spec0, {}, system_1.system);
false && (0, debug_1.watchUnitAndLog)(composition1);
false && (0, debug_1.watchGraphAndLog)(composition1);
composition1.play();
composition1.addUnitSpec(UNIT_ID_RANDOM_NUMBER_LTE, {
    unit: { id: _ids_1.ID_RANDOM_NATURAL_LTE },
});
const randomNaturalLTE = composition1.getUnit(UNIT_ID_RANDOM_NUMBER_LTE);
assert.equal(composition1.getUnitCount(), 1);
composition1.explodeUnit(UNIT_ID_RANDOM_NUMBER_LTE, {}, {}, {});
assert.equal(composition1.getUnitCount(), 2);
const spec6 = system_1.system.newSpec({
    units: {
        [UNIT_ID_EMTPY]: {
            id: _ids_1.ID_EMPTY,
        },
        [UNIT_ID_IDENTITY]: {
            id: _ids_1.ID_IDENTITY,
        },
        [UNIT_ID_IDENTITY_0]: {
            id: _ids_1.ID_IDENTITY,
        },
        [UNIT_ID_IDENTITY_1]: {
            id: _ids_1.ID_IDENTITY,
        },
    },
    merges: {
        0: {
            [UNIT_ID_IDENTITY]: {
                output: {
                    a: true,
                },
            },
            [UNIT_ID_IDENTITY_0]: {
                input: {
                    a: true,
                },
            },
        },
        1: {
            [UNIT_ID_IDENTITY_0]: {
                output: {
                    a: true,
                },
            },
            [UNIT_ID_IDENTITY_1]: {
                input: {
                    a: true,
                },
            },
        },
    },
    inputs: {},
});
const composition6 = new Graph_1.Graph(spec6, {}, system_1.system);
false && (0, debug_1.watchUnitAndLog)(composition6);
false && (0, debug_1.watchGraphAndLog)(composition6);
composition6.play();
//# sourceMappingURL=explodeUnit.js.map