示例#1
0
        /// <summary>
        /// Add specified hudElement as child, and rename it.
        /// </summary>
        /// <param name="hudElement">The hudElement to be added</param>
        /// <param name="newName">The new hudElement name</param>
        public void Add(HudElement hudElement, string newName)
        {
            hudElement.name = newName;
            if(hudElement == this)
            {

            }
            else
            {
                hudElement.parent = this;
                children.Add(hudElement.name, hudElement);
            }
        }
示例#2
0
        /// <summary>
        /// Add specified hudElement as child.
        /// </summary>
        /// <param name="hudElement">The hudElement to be added</param>
        public void Add(HudElement hudElement)
        {
            if(hudElement == this)
            {

            }
            else
            {
                hudElement.parent = this;
                children.Add(hudElement.name, hudElement);
            }
        }
示例#3
0
 /// <summary>
 /// Checks if this hudElement contains the specified hudElement. 
 /// </summary>
 /// <param name="hudElement">The hudElement</param>
 /// <returns>True if this hudElement contains the specified hudElement</returns>
 public bool HasChild(HudElement hudElement)
 {
     return this == hudElement.parent; // TODO: performance check
     //return children.ContainsValue(hudElement);
 }
示例#4
0
 /// <summary>
 /// Delete and detach specified child.
 /// </summary>
 /// <param name="hudElement">The child</param>
 public void RemoveChild(HudElement hudElement)
 {
     if(children.ContainsValue(hudElement))
     {
         hudElement = null;
         children.Remove(hudElement.name); //TODO: performance
     }
 }
示例#5
0
 public bool Equals(HudElement obj)
 {
     return name == obj.name;
 }