/// <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; }
/// <summary> /// Remove self from current group /// </summary> public void RemoveFromGroup() { CurrentGroup?.Elements.Remove(this); CurrentGroup = null; }