public State GetNode(string name) { if (!AllNodesDict.ContainsKey(name)) { throw new Exception(); } return(AllNodesDict[name]); }
public void RemoveNode(string name) { if (!AllNodesDict.ContainsKey(name)) { throw new Exception(); } State node = AllNodesDict[name]; AllNodesDict.Remove(name); AllNodes.Remove(node); }
public string AddNode(State node) { if (node.Name == "say") { throw new Exception(); } if (AllNodesDict.ContainsKey(node.Name)) { throw new Exception(); } AllNodesDict.Add(node.Name, node); AllNodes.Add(node); return(node.Name); }
public void RenameNode(string name, string newName) { if (newName == "say") { throw new Exception(); } if (AllNodesDict.ContainsKey(newName) || !AllNodesDict.ContainsKey(name)) { throw new Exception(); } AllNodesDict.Remove(name); State node = AllNodesDict[name]; AllNodesDict.Add(node.Name, node); }