Beispiel #1
0
            public CharacterSetResult(CharacterSetRequirement requirement)
            {
                if (requirement == null)
                {
                    throw new ArgumentNullException(nameof(requirement));
                }

                CharacterSet = requirement.CharacterSet;
                MinCount     = requirement.MinCount;
            }
Beispiel #2
0
        public bool TryRemoveExistingRequirement(CharacterSetRequirement requirement)
        {
            var existingRequirement = _requirements.SingleOrDefault(r => r.CharacterSet.Name.Equals(requirement.CharacterSet.Name));

            if (existingRequirement == null)
            {
                return(false);
            }

            return(_requirements.Remove(existingRequirement));
        }
Beispiel #3
0
        public bool TryAddNewRequirement(CharacterSetRequirement requirement)
        {
            var existingRequirement = _requirements.SingleOrDefault(r => r.CharacterSet.Name.Equals(requirement.CharacterSet.Name));

            if (existingRequirement != null)
            {
                return(false);
            }

            _requirements.Add(requirement);
            return(true);
        }
Beispiel #4
0
        public bool AddOrReplaceRequirement(CharacterSetRequirement requirement)
        {
            TryRemoveExistingRequirement(requirement);

            return(TryAddNewRequirement(requirement));
        }