Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public abstract void RemoveComponent(AbstractQuestComponent component);
Пример #4
0
 public abstract void AddComponent(AbstractQuestComponent component);