Esempio n. 1
0
        public static Extension[] Check(Item item, Character character)
        {
            if (character == Character.None)
            {
                return(new Extension[0]);
            }

            var checker = new ItemEnablerExtensionChecker(character);

            item.AcceptVisitor(checker);
            return(checker._missingExtensions.ToArray());
        }
        public static void CheckEnablerExtensionsAndThrowIfFailed(this Item item, Character character, ErrorCodes error = ErrorCodes.ExtensionLevelMismatch)
        {
            var missingEnablerExtensions = ItemEnablerExtensionChecker.Check(item, character);

            missingEnablerExtensions.Length.ThrowIfGreater(0, error, gex => gex.SetData("missingEnablerExtensions", missingEnablerExtensions.ToDictionary("e", m => m.ToDictionary())));
        }
        public static bool HaveAllEnablerExtensions(this Item item, Character character)
        {
            var missingEnablerExtensions = ItemEnablerExtensionChecker.Check(item, character);

            return(missingEnablerExtensions.Length == 0);
        }