Esempio n. 1
0
 public void PushScene(Node scene)
 {
     this._scenesStack.Add(scene);
     this.RunningScene = scene;
 }
Esempio n. 2
0
 public void RunWithScene(Node scene)
 {
     if (this._scenesStack.Count > 0)
         this.PopScene();
     this.PushScene(scene);
 }
Esempio n. 3
0
 protected void internalRemoveChild(Node child, bool dispose)
 {
     child.Parent = null;
     if (dispose == true)
         child.Dispose();
     this.Children.Remove(child);
 }
Esempio n. 4
0
        protected void internalAddChild(Node node, int zOrder)
        {
            if (this.Children == null) this.Children = new List<Node>();

            Node last = this.Children.Count > 0 ? this.Children[this.Children.Count - 1] : null;
            if (last == null || last.ZOrder <= zOrder)
            {
                this.Children.Add(node);
            }
            else
            {
                int index = 0;
                foreach (Node child in this.Children)
                {
                    if (child.ZOrder > zOrder)
                    {
                        this.Children.Insert(index, node);
                        break;
                    }
                    ++index;
                }
            }
            node.ZOrder = zOrder;
        }
Esempio n. 5
0
 public virtual void ReorderChild(Node child, int zOrder)
 {
     this.Children.Remove(child);
     this.internalAddChild(child, zOrder);
 }
Esempio n. 6
0
 public virtual void RemoveChild(Node child, bool dispose)
 {
     this.internalRemoveChild(child, dispose);
 }
Esempio n. 7
0
 public virtual void AddChild(Node child, int zOrder = 0, int id = 0)
 {
     if (child.Parent != null) throw new Exception("child is already added.");
     this.internalAddChild(child, zOrder);
     child.ID = id;
     child.Parent = this;
 }