예제 #1
0
        private void AddToHistory(Mobile m, long highBid)
        {
            if (BidHistory == null)
            {
                BidHistory = new List <HistoryEntry>();
            }

            BidHistory.Add(new HistoryEntry(m, highBid));
        }
예제 #2
0
        public bool AcceptBid(Bid bid)
        {
            var accepted = false;

            if (Expires < DateTime.Now)
            {
                BidHistory.Add(bid);
                CurrentBid = bid;
                accepted   = true;
            }
            return(accepted);
        }
예제 #3
0
        public Auction(AuctionSafe safe, GenericReader reader)
        {
            Safe = safe;

            int version = reader.ReadInt();

            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));
            }

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