/// <summary> /// Добавление дочерней сущности /// </summary> /// <param name="entity">дочерняя сущность</param> public void AddChild(Entity entity) { entity.Parent = this; _Children.AddEntity(entity); #region [.defense.] if (_positionInfo.End < entity._positionInfo.End) { throw new InvalidOperationException("Child not inside Parent"); } #endregion }
/// <summary> /// Добавление сущности /// </summary> /// <param name="newEntity">сущность</param> /// <param name="isReplaceIntersected">флаг, что заданная сущность заменяет пересекающиеся с ней</param> public void AddEntity(Entity newEntity, bool isReplaceIntersected = false) { _entitiesTree.AddEntity(newEntity, isReplaceIntersected); }