You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
418B

  1. package de.hems.trafficsim;
  2. public class Worker extends Thread {
  3. protected Track track;
  4. protected boolean stop;
  5. public Worker(Track track) {
  6. super();
  7. this.track = track;
  8. this.stop = false;
  9. }
  10. void setStop(boolean stop) {
  11. this.stop = stop;
  12. }
  13. @Override
  14. public void run() {
  15. while (!stop) {
  16. this.track.timeElapse(50);
  17. }
  18. }
  19. }