public void RemoveElement(GameElement e) { if (e.Parent == null) RootElements.Remove(e); AllElements.Remove(e); }
public void Add(GameElement element) { element.Parent = this; if (children == null) children = new List<GameElement>(); children.Add(element); Game.AddAndInitElement(element); }
public virtual void AddAndInitElement(GameElement e) { e.Game = this; e.ZIndex = cc++; if (e.Parent == null) RootElements.Add(e); AllElements.Add(e); // Finally e.Init(); }
public void Remove(GameElement element) { if (children == null) return; children.Remove(element); Game.RemoveElement(element); element.Parent = null; }