Files
SEW_Uebungen_2024.25/src/UE21_290425_Bruecke/Car.java
Alexander Bachinger 5ee8d1a359 UE21
2025-05-19 19:33:43 +02:00

24 lines
552 B
Java

package UE21_290425_Bruecke;
public class Car extends Thread {
public Long index;
public long arrivingTime;
public Guard guard;
public Car(Guard guard, long index) {
this.guard = guard;
this.arrivingTime = System.currentTimeMillis();
this.index = index;
}
@Override
public void run() {
try {
Thread.sleep(Variables.CROSSING_TIME * 1000);
guard.leavingBridge();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}