Пример #1
0
        public void DefragLooters()
        {
            if (Looters.Count == 0)
            {
                return;
            }

            for (int i = 0; i < Looters.Count; i++)
            {
                try
                {
                    if (Looters[i] is TrashLooter)
                    {
                        m_Looter = (TrashLooter)Looters[i];

                        if (m_Looter.Time + m_LootWait < DateTime.Now || m_Looter.Looter == null)
                        {
                            Looters.RemoveAt(i--);
                        }
                    }
                    else
                    {
                        Looters.RemoveAt(i--);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("/nException Caught in TrashPiles Defrag: /n{0}/n", e);
                }
            }
        }
Пример #2
0
        public bool FindLooter(Mobile from)
        {
            bool rtn = false;

            if (Looters.Count == 0)
            {
                return(rtn);
            }

            foreach (Object obj in Looters)
            {
                if (obj is TrashLooter)
                {
                    m_Looter = (TrashLooter)obj;

                    if (m_Looter.Looter == from)
                    {
                        rtn = true;
                        break;
                    }
                }
            }
            return(rtn);
        }
Пример #3
0
        public void DefragLooters()
        {
            if (Looters.Count == 0)
                return;

            for (int i = 0; i < Looters.Count; i++)
            {
                try
                {
                    if (Looters[i] is TrashLooter)
                    {
                        m_Looter = (TrashLooter)Looters[i];

                        if (m_Looter.Time + m_LootWait < DateTime.Now || m_Looter.Looter == null)
                        {
                            Looters.RemoveAt(i--);
                        }
                    }
                    else
                    {
                        Looters.RemoveAt(i--);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("/nException Caught in TrashPiles Defrag: /n{0}/n", e);
                }
            }
        }
Пример #4
0
        public bool FindLooter(Mobile from)
        {
            bool rtn = false;

            if (Looters.Count == 0)
                return rtn;

            foreach (Object obj in Looters)
            {
                if (obj is TrashLooter)
                {
                    m_Looter = (TrashLooter)obj;

                    if (m_Looter.Looter == from)
                    {
                        rtn = true;
                        break;
                    }
                }
            }
            return rtn;
        }