//Count all the items in a register line public int GetNumItems() { int num_items = 0; if (current_customer != null) { num_items += current_customer.GetItems(); } foreach (Customer c in line) { num_items += c.GetItems(); } return(num_items); }
//Select next customer in line public void NextCustomer(int current_time) { if (current_customer == null && line.Count > 0) { current_customer = line[0]; current_customer.QueueFinished(current_time); //Calculate time necessary to help customer processing_time = CalculateProcessingTime(current_customer.GetItems()); //Remove customer from line line.Remove(current_customer); //Start the proc current_customer.ProcessingStart(current_time); } }