public BankAccount(int balance) { this.balance = balance; var m = new Mem3nto(balance); changes.Add(m); }
public Mem3nto Deposit(int amount) { balance += amount; var m = new Mem3nto(balance); changes.Add(m); ++current; return(m); }
public Mem3nto Restore(Mem3nto m) { if (m != null) { balance = m.Balance; changes.Add(m); return(m); } else { return(null); } }