public void SetSim(StoreSimulation.SimModels.Simulation sim) { this.sim = sim; this.sim.getStore().ClientAddedToQueue += new Store.ClientAddedToQueueEventHandler(ClientAddedToQueue); this.sim.getStore().ClientRemovedFromQueue += new Store.ClientRemovedFromQueueEventHandler(ClientRemovedFromQueue); this.sim.getStore().ClientInFrontOfQueue += new Store.ClientInFrontOfQueueEventHandler(ClientInFrontOfQueue); this.sim.getStore().ClientEnteredStore += new Store.ClientEnteredStoreEventHandler(ClientEnteredStore); this.sim.getStore().ClientLeftStore += new Store.ClientLeftStoreEventHandler(ClientLeftStore); }
public LoggingView(StoreSimulation.SimModels.Simulation sim, TextWriter output) { this.sim = sim; this.output = output; Logger.changeOutput(this.output); //adding event listeners this.sim.getStore().ClientAddedToQueue += new Store.ClientAddedToQueueEventHandler(ClientAddedToQueue); this.sim.getStore().ClientRemovedFromQueue += new Store.ClientRemovedFromQueueEventHandler(ClientRemovedFromQueue); this.sim.getStore().ClientInFrontOfQueue += new Store.ClientInFrontOfQueueEventHandler(ClientInFrontOfQueue); this.sim.getStore().ClientEnteredStore += new Store.ClientEnteredStoreEventHandler(ClientEnteredStore); this.sim.getStore().ClientLeftStore += new Store.ClientLeftStoreEventHandler(ClientLeftStore); Store.ServicePointOpened += new Store.ServicePointOpenedEventHandler(ServicePointOpened); Store.ServicePointClosed += new Store.ServicePointClosedEventHandler(ServicePointClosed); ServicePoint.ClientEnteredCashier += new ServicePoint.ClientEnteredCashierEventHandler(ClientEnteredServicePoint); ServicePoint.ClientExitCashier += new ServicePoint.ClientExitCashierEventHandler(ClientExitServicePoint); ServicePoint.ClientInFrontOfQueueCashier += new ServicePoint.ClientInFrontOfQueueCashierEventHandler(ClientInFrontOfQueueCashier); }
public static void Main() { StoreSimulation ss = new StoreSimulation(5); ss.Go(); }