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")) )); } } }
public int EnemyCount() { XMLTree enemies = currentSublevel.SomeChild("enemies"); return(enemies == null ? 0 : enemies.ChildCount()); }
public int LoopCount() { XMLTree loops = currentSublevel.SomeChild("maze"); return(loops == null ? 0 : loops.ChildCount()); }
public int ObjectCount() { XMLTree objects = currentSublevel.SomeChild("objects"); return(objects == null ? 0 : objects.ChildCount()); }