public void RemoveNode(string name) { if (!AllNodesDict.ContainsKey(name)) { throw new Exception(); } State node = AllNodesDict[name]; AllNodesDict.Remove(name); AllNodes.Remove(node); }
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); }