Example #1
0
        private static bool DoesModApply(Modifyer mod, IEnumerable <string> tags)
        {
            // Has any forbidden tag that are included
            if (mod.ForbiddenTags.Where(f => tags.Contains(f)).Any())
            {
                return(false);
            }

            // Has any required tags that are NOT included
            if (mod.RequierdTags.Where(r => !tags.Contains(r)).Any())
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        public bool TryAddMod(Modifyer mod)
        {
            if (mod.ForbiddenTags.Where(s => _holder.Tags.Contains(s)).Any())
            {
                return(false);
            }

            if (mod.RequierdTags.Where(s => !_holder.Tags.Contains(s)).Any())
            {
                return(false);
            }

            if (!mod.IsActive)
            {
                return(false);
            }

            _activeMods.Add(mod);
            _dirty = true;
            return(TryRecache());
        }