Beispiel #1
0
        public override bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
        {
            if (e.Length >= 1)
            {
                Type t = ScriptCompiler.FindTypeByName(e.GetString(0));

                if (t == null)
                {
                    e.Mobile.SendMessage("No type with that name was found.");

                    string match = e.GetString(0).Trim();

                    if (match.Length < 3)
                    {
                        e.Mobile.SendMessage("Invalid search string.");
                        e.Mobile.SendGump(new AddGump(e.Mobile, match, 0, Type.EmptyTypes, false));
                    }
                    else
                    {
                        e.Mobile.SendGump(new AddGump(e.Mobile, match, 0, AddGump.Match(match).ToArray(), true));
                    }
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                e.Mobile.SendGump(new CategorizedAddGump(e.Mobile));
            }

            return(false);
        }
Beispiel #2
0
        public static void Register(BaseCommand command)
        {
            m_AllCommands.Add(command);

            List <BaseCommandImplementor> impls = BaseCommandImplementor.Implementors;

            for (int i = 0; i < impls.Count; ++i)
            {
                BaseCommandImplementor impl = impls[i];

                if ((command.Supports & impl.SupportRequirement) != 0)
                {
                    impl.Register(command);
                }
            }
        }
Beispiel #3
0
 public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
 {
     return(true);
 }
Beispiel #4
0
 public static void Register(BaseCommandImplementor impl)
 {
     m_Implementors.Add(impl);
     impl.Register();
 }