public IActionPossible CanRemoveComponent(CarPart.CarPart carPart)
 {
     if (carPart is null)
     {
         return(new ActionImpossible("Cannot remove null part"));
     }
     if (!_carParts.Contains(carPart))
     {
         return(new ActionImpossible("Cannot remove part"));
     }
     if (carPart is ComponentCarPart)
     {
         return(new ActionImpossible("This part is non component"));
     }
     return(new ActionPossible());
 }
        public IActionPossible CanAddComponent(CarPart.CarPart carPart)
        {
            if (carPart is null)
            {
                return(new ActionImpossible("Cannot add null part"));
            }

            if (_carParts.Contains(carPart))
            {
                return(new ActionImpossible("Part already added"));
            }

            if (carPart is ComponentCarPart)
            {
                return(new ActionImpossible("This part is non component"));
            }
            return(new ActionPossible());
        }
 public abstract void RemoveComponent(CarPart.CarPart carPart);
 public abstract void AddComponent(CarPart.CarPart carPart);