"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Graph_1 = require("../Class/Graph");
const boot_1 = require("../client/platform/node/boot");
const fromId_1 = require("../spec/fromId");
const _classes_1 = __importDefault(require("../system/_classes"));
const _components_1 = __importDefault(require("../system/_components"));
const _specs_1 = __importDefault(require("../system/_specs"));
const f_1 = require("../system/f/object/Keys/f");
const clone_1 = require("../util/clone");
const [system] = (0, boot_1.boot)((0, clone_1.clone)({
    specs: _specs_1.default,
    classes: _classes_1.default,
    components: _components_1.default,
}));
const specIds = (0, f_1.keys)(system.specs);
const spec = system.emptySpec();
const graph = new Graph_1.Graph(spec, {}, system);
for (const id of specIds) {
    const unit = (0, fromId_1.unitFromId)(system, id, system.specs, system.classes, {}, true);
    let unitId;
    do {
        unitId = `${Math.random()}`;
    } while (graph.hasUnit(unitId));
    graph.addUnit(unitId, unit);
    unit.destroy();
}
//# sourceMappingURL=instance.js.map