private Dictionary <IElixirBank, List <IncomingTransfer> > GroupTransfers(List <Transfer> transfers) { Dictionary <IElixirBank, List <IncomingTransfer> > groupedTransfers = new Dictionary <IElixirBank, List <IncomingTransfer> >(); foreach (Transfer transfer in transfers) { string bankIdentifier = transfer.ToAccountNumber.Substring(0, 4); if (Banks.ContainsKey(bankIdentifier)) { IElixirBank bank = Banks[bankIdentifier]; if (!groupedTransfers.ContainsKey(bank)) { groupedTransfers[bank] = new List <IncomingTransfer>(); } IncomingTransfer incomingTransfer = new IncomingTransfer((BankManager)bank, transfer.FromAccount.AccountNumber, transfer.ToAccountNumber, transfer.Amount); groupedTransfers[bank].Add(incomingTransfer); } } return(groupedTransfers); }
public void Visit(IncomingTransfer transfer) { }