Esempio n. 1
0
 /// <summary>
 /// Buys, returns actually bought, subsidizations allowed, uses deposits if available
 /// </summary>
 public Storage Sell(Consumer toWhom, Storage need, Country subsidizer)
 {
     if (toWhom.CanAfford(need) || subsidizer == null)
     {
         return(Sell(toWhom, need));
     }
     //todo fix that
     else if (subsidizer.GiveFactorySubsidies(toWhom, toWhom.HowMuchLacksMoneyIncludingDeposits(getCost(need))))
     {
         return(Sell(toWhom, need));
     }
     else
     {
         return(new Storage(need.Product, 0f));
     }
 }