Ejemplo n.º 1
0
 public ItemTrashedEventArgs(BaseTrashHandler handler, Mobile from, Item trashed, int tokens, bool message)
 {
     Handler = handler;
     Mobile  = from;
     Trashed = trashed;
     Tokens  = tokens;
     Message = message;
 }
Ejemplo n.º 2
0
		public ItemTrashedEventArgs(BaseTrashHandler handler, Mobile from, Item trashed, int tokens, bool message)
		{
			Handler = handler;
			Mobile = from;
			Trashed = trashed;
			Tokens = tokens;
			Message = message;
		}
Ejemplo n.º 3
0
		public TrashHandlerAcceptListGump(Mobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Accepted,
				title: handler.GetType().Name + " Accept List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
Ejemplo n.º 4
0
 public TrashHandlerAcceptListGump(Mobile user, BaseTrashHandler handler, Gump parent = null)
     : base(
         user,
         parent,
         list: handler.Accepted,
         title: handler.GetType().Name + " Accept List",
         emptyText: "There are no Types in the list.")
 {
     TrashHandler = handler;
 }
Ejemplo n.º 5
0
 public TrashHandlerIgnoreListGump(PlayerMobile user, BaseTrashHandler handler, Gump parent = null)
     : base(
         user,
         parent,
         list: handler.Ignored,
         title: handler.GetType().Name + " Ignore List",
         emptyText: "There are no Types in the list.")
 {
     TrashHandler = handler;
 }
Ejemplo n.º 6
0
		public TrashHandlerIgnoreListGump(PlayerMobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Ignored,
				title: handler.GetType().Name + " Ignore List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
Ejemplo n.º 7
0
        private static void CMConfig()
        {
            var handlers = new List <BaseTrashHandler>();

            int count = 0;

            HandlerTypes.ForEach(
                type =>
            {
                BaseTrashHandler handler = type.CreateInstance <BaseTrashHandler>();

                if (handler == null)
                {
                    return;
                }

                handlers.Add(handler);

                if (CMOptions.ModuleDebug)
                {
                    CMOptions.ToConsole(
                        "Created trash handler '{0}' ({1})", handler.GetType().Name, handler.Enabled ? "Enabled" : "Disabled");
                }

                ++count;
            });

            CMOptions.ToConsole("Created {0:#,0} trash handler{1}", count, count != 1 ? "s" : String.Empty);

            handlers.ForEach(
                h =>
            {
                if (!Handlers.ContainsKey(h.UID))
                {
                    Handlers.Add(h.UID, h);
                }
                else
                {
                    Handlers[h.UID] = h;
                }
            });

            ExtendedOPL.OnItemOPLRequest   += AddTrashProperties;
            ExtendedOPL.OnMobileOPLRequest += AddTrashProperties;
        }
Ejemplo n.º 8
0
        private static int InternalHandlerSort(BaseTrashHandler a, BaseTrashHandler b)
        {
            if (a == b)
            {
                return(0);
            }

            if (a == null)
            {
                return(1);
            }

            if (b == null)
            {
                return(-1);
            }

            if (!a.Enabled && !b.Enabled)
            {
                return(0);
            }

            if (!a.Enabled)
            {
                return(1);
            }

            if (!b.Enabled)
            {
                return(-1);
            }

            if (a.Priority > b.Priority)
            {
                return(1);
            }

            if (a.Priority < b.Priority)
            {
                return(-1);
            }

            return(0);
        }
Ejemplo n.º 9
0
		private static int InternalHandlerSort(BaseTrashHandler a, BaseTrashHandler b)
		{
			if (a == b)
			{
				return 0;
			}

			if (a == null)
			{
				return 1;
			}

			if (b == null)
			{
				return -1;
			}

			if (!a.Enabled && !b.Enabled)
			{
				return 0;
			}

			if (!a.Enabled)
			{
				return 1;
			}

			if (!b.Enabled)
			{
				return -1;
			}

			if (a.Priority > b.Priority)
			{
				return 1;
			}

			if (a.Priority < b.Priority)
			{
				return -1;
			}

			return 0;
		}