public Entity AddChainComponent(string chain, IUpdateComponent component) { if (!UpdateChains.ContainsKey(chain)) { UpdateChains.Add(chain, new UpdateChain()); } UpdateChains[chain].Add(component); component.Owner = this; return(this); }
public void Update(string chain = null) { if (!Active) { return; } if (Parent != null) { inheritedVisibility = Parent.InheritedVisibility; } else { inheritedVisibility = Visible; } if (chain == null) { if (UpdateComponent != null) { UpdateComponent.Update(); } } else { if (UpdateChains != null && UpdateChains.ContainsKey(chain)) { foreach (IUpdateComponent component in UpdateChains[chain]) { component.Update(); } } } if (Children.Count != 0) { LinkedListNode <Entity> child = Children.First; while (child != null) { child.Value.Update(chain); child = child.Next; } } }