コード例 #1
0
        public RentCostsBuilder CalculatePaymentDetails(Flat flat)
        {
            _hotWaterCostsCalculator.Initialize(flat);
            _coldWaterCostsCalculator.Initialize(flat);
            _heatingWaterCostsCalculator.Initialize(flat);
            _administrationCostsCalculator.Initialize(flat);
            _garbageCostsCalculator.Initialize(flat);

            _payment.AdministrationValue       = _administrationCostsCalculator.CalculateCost();
            _payment.AdministrationDescription = _administrationCostsCalculator.GetDescription();
            _payment.GarbageValue         = _garbageCostsCalculator.CalculateCost();
            _payment.GarbageDescription   = _garbageCostsCalculator.GetDescription();
            _payment.ColdWaterValue       = _coldWaterCostsCalculator.CalculateCost();
            _payment.ColdWaterDescription = _coldWaterCostsCalculator.GetDescription();
            _payment.HotWaterValue        = _hotWaterCostsCalculator.CalculateCost();
            _payment.HotWaterDescription  = _hotWaterCostsCalculator.GetDescription();
            _payment.HeatingValue         = _heatingWaterCostsCalculator.CalculateCost();
            _payment.HeatingDescription   = _heatingWaterCostsCalculator.GetDescription();

            return(this);
        }