Example #1
0
 public void load(XmlReader reader)
 {
     this.nodes.Clear();
     while (reader.Name != "NetworkMap")
     {
         reader.Read();
     }
     if (reader.MoveToAttribute("sort"))
     {
         string str = reader.ReadContentAsString();
         if (!Enum.TryParse <NetmapSortingAlgorithm>(str, out this.SortingAlgorithm))
         {
             Console.WriteLine("Error parsing netmap sorting algorithm: " + str);
             Utils.AppendToErrorFile("Error parsing netmap sorting algorithm: " + str);
         }
     }
     while (reader.Name != "visible")
     {
         reader.Read();
     }
     foreach (string str in reader.ReadElementContentAsString().Split())
     {
         this.visibleNodes.Add(Convert.ToInt32(str));
     }
     while (reader.Name != "network")
     {
         reader.Read();
     }
     reader.Read();
     while (reader.Name != "network")
     {
         while (reader.Name == "computer" && reader.NodeType != XmlNodeType.EndElement)
         {
             this.nodes.Add(Computer.load(reader, this.os));
         }
         while ((!(reader.Name == "computer") || reader.NodeType == XmlNodeType.EndElement) && reader.Name != "network")
         {
             reader.Read();
         }
     }
     for (int index1 = 0; index1 < this.nodes.Count; ++index1)
     {
         Computer node = this.nodes[index1];
         for (int index2 = 0; index2 < node.daemons.Count; ++index2)
         {
             node.daemons[index2].loadInit();
         }
     }
     this.loadAssignGameNodes();
     Console.WriteLine("Done loading");
 }
Example #2
0
        public void load(XmlReader reader)
        {
            nodes.Clear();
            while (reader.Name != "visible")
            {
                reader.Read();
            }
            foreach (var str in reader.ReadElementContentAsString().Split())
            {
                visibleNodes.Add(Convert.ToInt32(str));
            }
            while (reader.Name != "network")
            {
                reader.Read();
            }
            reader.Read();
label_13:
            while (reader.Name != "network")
            {
                while (reader.Name == "computer" && reader.NodeType != XmlNodeType.EndElement)
                {
                    nodes.Add(Computer.load(reader, os));
                }
                while (true)
                {
                    if ((!(reader.Name == "computer") || reader.NodeType == XmlNodeType.EndElement) &&
                        reader.Name != "network")
                    {
                        reader.Read();
                    }
                    else
                    {
                        goto label_13;
                    }
                }
            }
            for (var index1 = 0; index1 < nodes.Count; ++index1)
            {
                var computer = nodes[index1];
                for (var index2 = 0; index2 < computer.daemons.Count; ++index2)
                {
                    computer.daemons[index2].loadInit();
                }
            }
            loadAssignGameNodes();
            Console.WriteLine("Done loading");
        }