main
 1using gorilla.commons.utility;
 2using MoMoney.Domain.Core;
 3
 4namespace MoMoney.Domain.Accounting
 5{
 6    class TotalPaymentsCalculator : ValueReturningVisitor<Money, IPayment>
 7    {
 8        public TotalPaymentsCalculator()
 9        {
10            reset();
11        }
12
13        public void visit(IPayment payment)
14        {
15            value = payment.apply_to(value);
16        }
17
18        public Money value { get; private set; }
19
20        public void reset()
21        {
22            value = new Money(0);
23        }
24    }
25}