예제 #1
0
 public void SetParent(HItem item)
 {
     if (item != null)
     {
         // Return if the parent already has this as a child
         if (item.childs.Contains(this))
         {
             return;
         }
         item.AddChild(this);
         parent = item;
     }
     else
     {
         // Return if we already have no other parent
         if (parent == null)
         {
             return;
         }
         parent.RemoveChild(this);
         parent = null;
     }
 }
예제 #2
0
 public void RemoveChild(HItem item)
 {
     childs.Remove(item);
 }
예제 #3
0
 public void AddChild(HItem item)
 {
     childs.Add(item);
 }