示例#1
0
 public XMLloop(XMLTree tree)
 {
     checkpoints = new List <Tuple <int, int, int> >();
     for (int i = 0; i < tree.ChildCount(); i++)
     {
         XMLTree t = tree.Child(i);
         if (t.Name().Equals("finish"))
         {
             finish = new Tuple <int, int>(int.Parse(t.Attribute("x")), int.Parse(t.Attribute("setback")));
         }
         else
         {
             checkpoints.Add(new Tuple <int, int, int>(
                                 int.Parse(t.Attribute("x")),
                                 int.Parse(t.Attribute("y")),
                                 int.Parse(t.Attribute("height"))
                                 ));
         }
     }
 }
示例#2
0
        public int EnemyCount()
        {
            XMLTree enemies = currentSublevel.SomeChild("enemies");

            return(enemies == null ? 0 : enemies.ChildCount());
        }
示例#3
0
        public int LoopCount()
        {
            XMLTree loops = currentSublevel.SomeChild("maze");

            return(loops == null ? 0 : loops.ChildCount());
        }
示例#4
0
        public int ObjectCount()
        {
            XMLTree objects = currentSublevel.SomeChild("objects");

            return(objects == null ? 0 : objects.ChildCount());
        }