Skip to content

Group Relation

ZjzMisaka edited this page Jul 16, 2024 · 4 revisions

Group relation allows establishing parent-child relationships between groups. When performing operations on a parent group, the operations will also include the child groups.

Setting Group Relations

To set group relations, use the SetGroupRelation method. This method establishes a parent-child relationship between two groups.

// Establishes GroupB as a child of GroupA
powerPool.SetGroupRelation("GroupA", "GroupB");

Removing Group Relations

To remove group relations, use the RemoveGroupRelation method. This method can either remove a specific child group from a parent group or remove all child groups from a parent group.

// Removes all child groups from GroupA
powerPool.RemoveGroupRelation("GroupA"); 
// Removes GroupB from GroupA's child groups
powerPool.RemoveGroupRelation("GroupA", "GroupB"); 

Resetting Group Relations

To reset all group relations, use the ResetGroupRelation method. This method removes all existing parent-child relationships between groups.

// Clears all group relations, resetting the structure to its initial state
powerPool.ResetGroupRelation();