Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 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
     }
 }
Exemplo n.º 5
0
 public bool Equals(HudElement obj)
 {
     return name == obj.name;
 }