Esempio n. 1
0
            public static MongbatMeadDrunkard Find(Mobile from)
            {
                foreach (MongbatMeadDrunkard drunk in Drunks)
                {
                    if (from == drunk.Mobile)
                    {
                        return(drunk);
                    }
                }

                var newDrunk = new MongbatMeadDrunkard(from, DateTime.UtcNow);

                Drunks.Add(newDrunk);

                if (Drunks.Count == 1)
                {
                    if (m_Timer != null)
                    {
                        m_Timer.Stop();
                    }
                    else
                    {
                        m_Timer = new InternalTimer();
                        m_Timer.Start();
                    }
                }

                return(newDrunk);
            }
Esempio n. 2
0
            public static void Remove(MongbatMeadDrunkard drunk)
            {
                if (Drunks.Contains(drunk))
                {
                    Drunks.Remove(drunk);

                    if (Drunks.Count == 0)
                    {
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                            m_Timer = null;
                        }
                    }
                }
            }