alles Funktioniert
This commit is contained in:
@@ -3,19 +3,20 @@ package UE21_290425_Bruecke;
|
||||
import java.time.LocalTime;
|
||||
|
||||
public class Car extends Thread {
|
||||
private static final int crossingTime = 50_000;
|
||||
LocalTime arrivingTime;
|
||||
Guard guard;
|
||||
public Long index;
|
||||
public LocalTime arrivingTime;
|
||||
public Guard guard;
|
||||
|
||||
public Car(Guard guard) {
|
||||
public Car(Guard guard, long index) {
|
||||
this.guard = guard;
|
||||
this.arrivingTime = LocalTime.now();
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(crossingTime);
|
||||
Thread.sleep(Variables.CROSSING_TIME);
|
||||
guard.leaving();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user