예제 #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;
        }