internal void open(IShareOwner byWhom, bool payMoney) { var agent = byWhom as Agent; if (agent.GetCountry().economy.getValue() != Economy.PlannedEconomy) { salary.set(GetProvince().getLocalMinSalary()); } if (payMoney) { agent.payWithoutRecord(this, getReopenCost()); ownership.Add(byWhom, getReopenCost()); //Debug.Log(byWhom + " invested " + getReopenCost() + " in reopening " + this); } _isOpen = true; daysUnprofitable = 0; daysClosed = 0; }
/// <summary> /// Don't call it directly /// </summary> public Factory(Province province, IShareOwner investor, FactoryType type, Value cost) : base(type, province) { //this.buildByPlannedEconomy = buildByPlannedEconomy; ownership = new Owners(this); if (investor != null) // that mean that factory is a fake { currentInvestor = investor; //assuming this is level 0 building constructionNeeds = new StorageSet(getType().GetBuildNeeds()); ownership.Add(investor, cost); salary.set(province.getLocalMinSalary()); if (GetCountry().economy.getValue() == Economy.PlannedEconomy) { setPriorityAutoWithPlannedEconomy(); } //else // Debug.Log(investor + " invested " + cost + " in building new " + this); } }