コード例 #1
0
        public virtual void EndOfYear()
        {
            if (Economy.CurrentYear == 0)
            {
                Reset();
            }

            MarketValue                *= 1.0 + Economy.Get(Series.RealEstate);
            MaximumMonthlyRent         *= 1.0 + Economy.Get(Series.RealEstate);
            MonthlyMaintenanceExpenses *= 1.0 + Economy.Get(Series.PriceInflation);
        }
コード例 #2
0
        public virtual void EndOfYear()
        {
            if (Economy.CurrentYear == 0)
            {
                Reset();
            }

            MarketValue        = MarketValue * (Economy.Get(Series.RealEstate) + 1);
            Rent               = Rent * (Economy.Get(Series.RealEstate) + 1);
            MaximumAllowedRent = MaximumAllowedRent * (Economy.Get(Series.RealEstate) + 1);
            Maintenance        = Maintenance * (Economy.Get(Series.RealEstate) + 1);
        }
コード例 #3
0
        public void EndOfYear()
        {
            var expensesHouses = RealEstatePortfolio.EndOfYear();
            var earningsSales  = SellHouses();

            foreach (var newDevelopmentProjectType in NewDevelopmentProjectType.GetAll())
            {
                newDevelopmentProjectType.EndOfYear();
            }

            var expensesNewDevelopment = ExecuteNewDevelopmentProjects();

            foreach (var renovationProjectProjectType in RenovationProjectType.GetAll())
            {
                renovationProjectProjectType.EndOfYear();
            }

            var expensesRenovation = ExecuteRenovations();

            var expensesLoans = _loanPortfolio.EndOfYear();

            // If we have spent money we need to attract a new loan.
            var totalExpenses = expensesLoans + expensesHouses + AnnualCosts - _loanPortfolio.Cash - earningsSales + expensesNewDevelopment + expensesRenovation;

            if (totalExpenses > 0)
            {
                var previousDebt = _loanPortfolio.Debt;
                AttractLoan(totalExpenses);
                _loanPortfolio.Cash = 0;

                // Assert that a loan really has been attracted.
                Debug.Assert(Math.Abs(previousDebt + totalExpenses - _loanPortfolio.Debt) < 0.01);
            }
            else
            {
                _loanPortfolio.Cash = -totalExpenses;
            }

            CumulativeInflation *= Economy.Get(Series.PriceInflation) + 1;

            IsBankrupt |= SolvencyRatio < BankruptcyThreshold;
        }