Esempio n. 1
0
        public void reset()
        {
            List <Item> IB = Bittiez.Tools.List_Items_In_Container(m_Bag, true);

            foreach (Item i in IB)
            {
                i.Delete();
            }
            m_Bag.Delete();
            m_Price          = 0;
            m_Prize          = null;
            m_Contestants    = new ArrayList();
            m_NewContestants = new List <Contestant>();
            m_Expiration     = DateTime.UtcNow;
            SetUP            = false;
            m_Bag            = new RevBag();
            InvalidateProperties();
        }
Esempio n. 2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int v = reader.ReadInt();

            if (v >= 1)
            {
                m_Price       = reader.ReadInt();
                m_Prize       = reader.ReadItem();
                m_Bag         = (RevBag)reader.ReadItem();
                m_Expiration  = reader.ReadDateTime();
                m_Contestants = reader.ReadMobileList();
                SetUP         = reader.ReadBool();
            }
            if (v >= 2)
            {
                bool CU;
                foreach (Mobile m in m_Contestants)
                {
                    CU = false;
                    foreach (Contestant c in NewContestants)
                    {
                        if (m == c.Player)
                        {
                            c.Tickets += 1;
                            CU         = true;
                            break;
                        }
                    }

                    if (!CU)
                    {
                        NewContestants.Add(new Contestant(m, 1));
                    }
                }
            }
            if (v >= 3)
            {
                TicketLimit = reader.ReadInt();
            }

            Bittiez.Tools.Start_Timer_Delayed_Call(TimeSpan.FromMinutes(5), Expire);
        }