コード例 #1
0
        private int GetCleaningCharges(IRentable rentable)
        {
            var cleaningChargesCalculatingVisitor = new CleanChargesCalculatingVisitor();

            return(rentable.Visit(cleaningChargesCalculatingVisitor));
        }
コード例 #2
0
        private int GetWaterCharges(IRentable rentable)
        {
            var waterChargesCalculatingVisitor = new WaterChargesCalculatingVisitor();

            return(rentable.Visit(waterChargesCalculatingVisitor));
        }
コード例 #3
0
        private int GetElectricityCharges(IRentable rentable)
        {
            var electricityChargesCalculatingVisitor = new ElectricityChargesCalculatingVisitor();

            return(rentable.Visit(electricityChargesCalculatingVisitor));
        }
コード例 #4
0
        private int GetRentingCharges(IRentable rentable)
        {
            var rentingCalculatingVisitor = new RentCalculatingVisitor();

            return(rentable.Visit(rentingCalculatingVisitor));
        }