/// <summary>
        /// User has the proper flags to be a builder
        /// </summary>
        public static bool IsBuilder(this IFlagContext flags)
        {
            Validation.IsNotNull(flags, "flags");

            return(flags.IsAdmin() || flags.HasFlag("Builder"));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="flags"></param>
        /// <returns></returns>
        public static bool IsWizard(this IFlagContext flags)
        {
            Validation.IsNotNull(flags, "flags");

            return(flags.HasFlag("Wizard"));
        }
示例#3
0
        /// <summary>
        /// Validates the user's keywords for admin flags and sends a standardized message
        /// to the user.
        /// </summary>
        public static bool AdminFlagCheckAndNotify(this ICommandManager commandManager, IEntity user, IFlagContext FlagContext)
        {
            var returnVal = true;

            try
            {
                Validation.IsNotNull(commandManager, "commandManager");
                Validation.IsNotNull(user, "user");
                Validation.IsNotNull(FlagContext, "FlagContext");
                Validation.Validate(FlagContext.IsAdmin());
            }
            catch
            {
                returnVal = false;
                commandManager.ReportToCharacter(Resources.MSG_NOT_AUTHORIZED, user);
            }

            return(returnVal);
        }