public void GetIncomingBids(Bidder bidder) { try { decimal bid; while (true) { bool correctformat = decimal.TryParse(bidder.Read(), out bid); if (correctformat == false) { bidder.Write("Not a Number!"); } if (bid <= AuctionHouseRepo.Instance.CurrentBid && bid < AuctionHouseRepo.Instance.CurrentItem.StartingPrice) { bidder.Write("Bid must be higher than current bid."); } else { AuctionHouseRepo.Instance.HighestBidder = bidder; AuctionHouseRepo.Instance.NextBid = bid; } } } catch (Exception) { bidder = null; } }
public void On_New_Connection(Socket socket) { Bidder bidder = new Bidder(socket); bidder.Write("Enter Name to join Auction: "); bidder.Name = bidder.Read(); bidders.Add(bidder); handler.AuctionStart(bidder); }