public void Internal_AddSubGroup(UnitGroup child) { if (child.GetParentGroupAsUG() != null) { child.GetParentGroupAsUG().Internal_RemoveSubGroup(child); } child.Internal_SetParentGroup(this); GetSubGroupsAsUG().Add(child); //onSubGroupAdded.Invoke(child); }
public UnitGroup GetRootGroupAsUG() { UnitGroup res = GetParentGroupAsUG(); if (res != null) { res = res.GetRootGroupAsUG(); } else { res = this; } return(res); }
public void Internal_RemoveSubGroup(UnitGroup child) { child.Internal_SetParentGroup(null); GetSubGroupsAsUG().Remove(child); //onSubGroupRemoved.Invoke(child); }
public void Internal_SetParentGroup(UnitGroup newParent) { _parent.Value = newParent as UnitGroup; }