Ejemplo n.º 1
0
        /// <summary>
        /// Adds an auction into the system
        /// </summary>
        /// <param name="auction">The new auction entry</param>
        public static void Add(AuctionItem auction)
        {
            // Put the item into the control stone
            auction.Item.Internalize();
            m_ControlStone.AddItem(auction.Item);
            //auction.Item.Parent = m_ControlStone;
            auction.Item.Visible = true;

            Auctions.Add(auction);

            m_ControlStone.InvalidateProperties();
        }
Ejemplo n.º 2
0
        public void OnBegin()
        {
            if (Safe == null || Safe.Deleted)
            {
                return;
            }

            if (!OnGoing)
            {
                BidHistory = null;
            }

            StartTime = DateTime.Now;
            OnGoing   = true;

            CurrentBid = StartBid;

            Auctions.Add(this);
        }
Ejemplo n.º 3
0
 public void AddAuction(Auction auction)
 {
     Auctions.Add(auction);
 }
Ejemplo n.º 4
0
        public Auction(IAuctionItem safe, GenericReader reader)
        {
            Safe = safe;

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
                ClaimPeriod = reader.ReadDateTime();
                goto case 1;

            case 1:
                Owner       = reader.ReadMobile();
                AuctionItem = reader.ReadItem();
                CurrentBid  = reader.ReadLong();
                StartBid    = reader.ReadLong();
                Buyout      = reader.ReadLong();
                Description = reader.ReadString();
                Duration    = reader.ReadInt();

                StartTime = reader.ReadDateTime();
                OnGoing   = reader.ReadBool();

                Bids = new List <BidEntry>();

                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    PlayerMobile m     = reader.ReadMobile() as PlayerMobile;
                    BidEntry     entry = new BidEntry(m, reader);

                    if (m != null)
                    {
                        Bids.Add(entry);

                        if (entry.CurrentBid > 0 && (HighestBid == null || entry.CurrentBid > HighestBid.CurrentBid))
                        {
                            HighestBid = entry;
                        }
                    }
                }

                count = reader.ReadInt();

                if (count > 0)
                {
                    BidHistory = new List <HistoryEntry>();
                }

                for (int i = 0; i < count; i++)
                {
                    BidHistory.Add(new HistoryEntry(reader));
                }

                break;
            }

            if (HasBegun)
            {
                Auctions.Add(this);
            }
        }