Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public abstract void RemoveComponent(AbstractQuestComponent component);
Esempio n. 4
0
 public abstract void AddComponent(AbstractQuestComponent component);