public ClientQueue(ClientQueue queue) { this.numberClient = queue.numberClient; this.clientList = new List<Client>(); for (int i = 0; i < queue.clientList.Count; i++) { this.clientList.Add(new Client(queue.clientList[i])); } this.observer = queue.observer; }
public Bank() { //this.listBankWindows = new List<BankWindow>(); this.clientQueue = new ClientQueue(); this.periodTimer = 1000; this.numberOfNewClients = 0; this.timer = new Timer(periodTimer); this.timer.Elapsed += OnTimedEvent; this.countBankWindows = 0; this.nameClients = new List<string>(); string line; System.IO.StreamReader file = new System.IO.StreamReader(@"nameClients.txt",System.Text.Encoding.Default); while ((line = file.ReadLine()) != null) { this.nameClients.Add(line); } file.Close(); bankWindows = new BankWindowComposite(); BankWindowComponent one = new BankWindowComposite(); BankWindowComponent two = new BankWindowComposite(); BankWindowComponent three = new BankWindowComposite(); BankWindowComponent oneWindow = new BankWindow(1); oneWindow.addOperation(new Credit()); oneWindow.addOperation(new Deposit()); bankWindows.add(oneWindow); bankWindows.add(one); BankWindowComponent twoWindow = new BankWindow(2); twoWindow.addOperation(new Credit()); twoWindow.addOperation(new Deposit()); twoWindow.addOperation(new Card()); BankWindowComponent threeWindow = new BankWindow(3); threeWindow.addOperation(new Payment()); threeWindow.addOperation(new Transfer()); threeWindow.addOperation(new CurrencyExchangeAdapter(new CurrencyExchange())); one.add(twoWindow); one.add(threeWindow); one.add(two); BankWindowComponent fourWindow = new BankWindow(4); fourWindow.addOperation(new Deposit()); fourWindow.addOperation(new Transfer()); two.add(fourWindow); two.add(three); BankWindowComponent fiveWindow = new BankWindow(5); fiveWindow.addOperation(new Deposit()); fiveWindow.addOperation(new Transfer()); fiveWindow.addOperation(new Card()); three.add(fiveWindow); }
public Bank() { this.listBankWindows = new List<BankWindow>(); this.clientQueue = new ClientQueue(); this.periodTimer = 1000; this.numberOfNewClients = 0; this.timer = new Timer(periodTimer); this.timer.Elapsed += OnTimedEvent; this.countBankWindows = 0; this.nameClients = new List<string>(); string line; System.IO.StreamReader file = new System.IO.StreamReader(@"nameClients.txt",System.Text.Encoding.Default); while ((line = file.ReadLine()) != null) { this.nameClients.Add(line); } file.Close(); }
public Bank(Bank bank) { this.manager = new OperationManager(bank.manager); this.listBankWindows = new List<BankWindow>(); for (int i = 0; i < bank.countBankWindows; i++) { BankWindow bw = new BankWindow(bank.listBankWindows[i]); bw.setManager(this.manager); this.listBankWindows.Add(bw); } this.clientQueue = new ClientQueue(bank.clientQueue); this.timer = new Timer(bank.periodTimer); this.periodTimer = bank.periodTimer; this.timer.Elapsed += OnTimedEvent; this.numberOfNewClients = bank.numberOfNewClients; this.countBankWindows = bank.countBankWindows; this.nameClients = bank.nameClients; //this.timerActive = bank.timerActive; }
public void setQueue(ClientQueue queue) { this.clientQueue = queue; }
public void saveQueue(ClientQueue queue) { this.queue = new ClientQueue(queue); }
public void setQueue(ClientQueue queue) { this.bank.setQueue(queue); }