"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ChargeNodeService = void 0;
const charge_node_config_1 = require("./charge-node-config");
const charge_node_1 = require("./charge-node");
class ChargeNodeService {
  constructor() {
    this.programNodeConfig = new charge_node_config_1.ChargeNodeConfig();
    this.funcMap = new Map();
  }
  loadFromXml(dataModel) {
    const node = new charge_node_1.ChargeNode(this.programModel);
    node.setDataModel(dataModel);
    return node;
  }
  setProgramModel(programModel) {
    this.programModel = programModel;
  }
  getProgramNodeConfig() {
    return this.programNodeConfig;
  }
  getRpcMap() {
    return this.funcMap;
  }
  createNode() {
    return {
      nodeId: this.programNodeConfig.id,
      node: new charge_node_1.ChargeNode(this.programModel),
      children: []
    };
  }
  cloneNode(node) {
    return new charge_node_1.ChargeNode(this.programModel).cloneNode(node);
  }
}
exports.ChargeNodeService = ChargeNodeService;
//# sourceMappingURL=charge-node-service.js.map