public override void RemoveComponent(AbstractQuestComponent component) { if (component is null) { throw new ArgumentNullException(nameof(component)); } if (!_components.Contains(component)) { throw new ArgumentException("The components collection does not contain this particular component."); } component.Clear(); _components.Remove(component); }
public override void AddComponent(AbstractQuestComponent component) { if (component is null) { throw new ArgumentNullException(nameof(component)); } if (_components.Contains(component)) { throw new ArgumentException("The components collection already contains this particular component."); } if (_components.Where(c => c.GetType() == component.GetType()).Count() > 0) { throw new ArgumentException("The quest already contains a component of this type."); } _components.Add(component); }
public abstract void RemoveComponent(AbstractQuestComponent component);
public abstract void AddComponent(AbstractQuestComponent component);