Пример #1
0
        public BankAccount(int balance)
        {
            this.balance = balance;
            var m = new Mem3nto(balance);

            changes.Add(m);
        }
Пример #2
0
        public Mem3nto Deposit(int amount)
        {
            balance += amount;
            var m = new Mem3nto(balance);

            changes.Add(m);
            ++current;
            return(m);
        }
Пример #3
0
 public Mem3nto Restore(Mem3nto m)
 {
     if (m != null)
     {
         balance = m.Balance;
         changes.Add(m);
         return(m);
     }
     else
     {
         return(null);
     }
 }