Пример #1
0
    public void AcceptOffer()
    {
        if (Offer.IsAvailable)
        {
            CurrentMarket.RegisterTransaction(Offer.Commodity);
            account.Credit(Offer.Value);

            if (Offer.IsAPurchase)
            {
                LoadCargo(Offer.Commodity);
            }
            else if (Offer.IsASale)
            {
                UnloadCargo();
            }

            Offer.Clear();
        }
    }
Пример #2
0
 public void Pay(ILocation source, ILocation destination)
 {
     account.Credit(DistanceBetween(source, destination));
 }