コード例 #1
0
ファイル: CommandUtility.cs プロジェクト: 0xFh/Asda2-Project
        public static bool GetRequiresContext(this BaseCommand <RealmServerCmdArgs> cmd)
        {
            RealmServerCommand rootCmd = cmd.RootCmd as RealmServerCommand;

            if (rootCmd != null)
            {
                return(rootCmd.RequiresContext);
            }
            return(false);
        }
コード例 #2
0
        /// <summary>
        /// Whether this the supplied arguments match the specified target criteria.
        /// </summary>
        public bool CheckArgs(Command <RealmServerCmdArgs> cmd)
        {
            if (!(cmd is RealmServerCommand))
            {
                return(true);
            }
            RealmServerCommand realmServerCommand = (RealmServerCommand)cmd;
            Unit             target      = this.Target;
            ObjectTypeCustom targetTypes = realmServerCommand.TargetTypes;

            if (realmServerCommand.RequiresCharacter && this.m_chr == null)
            {
                return(false);
            }
            if (targetTypes == ObjectTypeCustom.None)
            {
                return(true);
            }
            if (target != null)
            {
                return(targetTypes.HasAnyFlag(target.CustomType));
            }
            return(false);
        }
コード例 #3
0
 private static void OnInvalidArguments(CmdTrigger <RealmServerCmdArgs> trigger, RealmServerCommand cmd)
 {
     trigger.Reply("Invalid command arguments - " +
                   "Required target-type: " + cmd.TargetTypes +
                   " - Context required: " + cmd.GetRequiresContext());
 }