Exemplo n.º 1
0
        public void Add(AuctionData auction)
        {
            var history = new AuctionHistory
            {
                BuyerName   = auction.Buyer.Name,
                SellerName  = auction.Seller.Name,
                ItemForSale = auction.ItemForSale.ObjectIndex.ID,
                SoldFor     = auction.BidAmount,
                SoldOn      = DateTime.UtcNow,
                Saved       = false
            };

            History.ToList().Add(history);
        }
Exemplo n.º 2
0
        public AuctionData StartAuction(CharacterInstance seller, ObjectInstance item, int startingPrice)
        {
            if (Auction != null)
            {
                throw new AuctionAlreadyStartedException(
                          "New auction by Character {0} for Item {1} cannot be started as an auction is already in progress.",
                          seller.ID, item.ID);
            }

            var auction = new AuctionData
            {
                ItemForSale    = item,
                StartingBid    = startingPrice,
                Buyer          = seller,
                Seller         = seller,
                PulseFrequency = GameConstants.GetSystemValue <int>("PulseAuction")
            };

            Auction = auction;
            Repository.Add(auction);
            return(auction);
        }