import {NodeSerializer} from "../../../engine/nodes/utils/Serializer";
export class PolySceneSerializer {
  constructor(scene) {
    this.scene = scene;
  }
  toJSON(include_node_param_components = false) {
    const nodes_by_graph_node_id = {};
    const params_by_graph_node_id = {};
    for (let node of this.scene.nodesController.allNodes()) {
      const node_serializer = new NodeSerializer(node);
      nodes_by_graph_node_id[node.graphNodeId()] = node_serializer.toJSON(include_node_param_components);
      const params = node.params.all;
      for (let param of params) {
        params_by_graph_node_id[param.graphNodeId()] = param.toJSON();
      }
    }
    return {
      nodes_by_graph_node_id,
      params_by_graph_node_id
    };
  }
}
