static void UpdateRecursively(Gear gear, GameTime gameTime) { if (gear.Enabled) { foreach (var child in gear.Children) { UpdateRecursively(child, gameTime); } gear.Update(gameTime); } }
static void DrawRecursively(Gear gear, GameTime gameTime) { if (gear.Visible) { gear.Draw(gameTime); foreach (var child in gear.Children) { DrawRecursively(child, gameTime); } } }