Beispiel #1
0
 internal void upgrade(Agent byWhom)
 {
     upgrading = true;
     constructionNeeds.add(getUpgradeNeeds().getCopy());
     if (byWhom.getCountry().economy.getValue() != Economy.PlannedEconomy)
     {
         byWhom.payWithoutRecord(this, Game.market.getCost(getUpgradeNeeds()));
     }
 }
Beispiel #2
0
 /// <summary>
 ///checks outside
 /// </summary>
 //internal bool giveMoneyIf(Consumer taker, Value howMuch)
 //{
 //
 //        Value needLoan = howMuch.subtractOutside(taker.cash);
 //        if (this.canGiveMoney(taker, needLoan))
 //        {
 //            this.giveMoney(taker, needLoan);
 //            return true;
 //        }
 //
 //    return false;
 //}
 /// <summary>
 /// checks inside. Just wouldn't give money if can't
 /// </summary>
 internal bool giveLackingMoney(Agent taker, Value sum)
 {
     if (taker.getCountry().isInvented(Invention.Banking))// find money in bank?
     {
         Value lackOfSum = sum.subtractOutside(taker.cash);
         if (canGiveMoney(taker, lackOfSum))
         {
             giveMoney(taker, lackOfSum);
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 internal void open(Agent byWhom)
 {
     if (byWhom.getCountry().economy.getValue() != Economy.PlannedEconomy)
     {
         salary.set(getProvince().getLocalMinSalary());
         if (byWhom != this)
         {
             byWhom.payWithoutRecord(this, getReopenCost());
         }
     }
     working          = true;
     daysUnprofitable = 0;
     daysClosed       = 0;
 }