/// <summary>WARNING! Can overflow if money > cost of need. use CanAfford before </summary> //public Value HowMuchCanNotAfford(PrimitiveStorageSet need) //{ // return new Value(Country.market.getCost(need).get() - this.cash.get()); //} /// <summary>WARNING! Can overflow if money > cost of need. use CanAfford before </summary> //public Value HowMuchCanNotAfford(float need) //{ // return new Value(need - this.cash.get()); //} /// <summary> Says how much money lack of desiredSum (counting cash and deposits in bank). New value. /// Goes nut if cash + deposits >= desiredSum, no need for extra money, check that outside /// </summary> public MoneyView HowMuchLacksMoneyIncludingDeposits(MoneyView desiredSum) { return(desiredSum.Copy().Subtract(getMoneyAvailable(), false)); }
/// <summary> /// Says how much money lack of desiredSum (counting cash only). New value /// Says zero if cash >= desiredSum, no need for extra money /// </summary> public MoneyView HowMuchLacksMoneyCashOnly(MoneyView desiredSum) { return(desiredSum.Copy().Subtract(cash, false)); }
public Share(MoneyView initialSumm) { howMuchOwns = initialSumm.Copy(); }