Esempio n. 1
0
 /// <summary>
 /// Place self to the target group
 /// </summary>
 /// <param name="target">Target group</param>
 public void ToGroup(Group target)
 {
     if (Equals(target))
         throw new InvalidOperationException($"Group {target} can`t move to self");
     CurrentGroup?.Elements.Remove(this);
     CurrentGroup = target;
 }
Esempio n. 2
0
 /// <summary>
 /// Remove self from current group
 /// </summary>
 public void RemoveFromGroup()
 {
     CurrentGroup?.Elements.Remove(this);
     CurrentGroup = null;
 }