UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 455 B
import{GraphView}from"./GraphView.js";export class GraphManager{graphMapByContextId=new Map;createContext(t){const e=new GraphView(t);this.graphMapByContextId.set(t,e)}destroyContext(t){if(!this.graphMapByContextId.has(t))return;this.graphMapByContextId.get(t)&&this.graphMapByContextId.delete(t)}hasContext(t){return this.graphMapByContextId.has(t)}clearGraphs(){this.graphMapByContextId.clear()}getGraph(t){return this.graphMapByContextId.get(t)||null}}