Esempio n. 1
0
 public State GetNode(string name)
 {
     if (!AllNodesDict.ContainsKey(name))
     {
         throw new Exception();
     }
     return(AllNodesDict[name]);
 }
Esempio n. 2
0
        public void RemoveNode(string name)
        {
            if (!AllNodesDict.ContainsKey(name))
            {
                throw new Exception();
            }

            State node = AllNodesDict[name];

            AllNodesDict.Remove(name);
            AllNodes.Remove(node);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }