UE21
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
package UE21_290425_Bruecke;
|
||||
|
||||
import java.time.LocalTime;
|
||||
|
||||
public class Car extends Thread {
|
||||
public Long index;
|
||||
public LocalTime arrivingTime;
|
||||
public long arrivingTime;
|
||||
public Guard guard;
|
||||
|
||||
public Car(Guard guard, long index) {
|
||||
this.guard = guard;
|
||||
this.arrivingTime = LocalTime.now();
|
||||
this.arrivingTime = System.currentTimeMillis();
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(Variables.CROSSING_TIME);
|
||||
Thread.sleep(Variables.CROSSING_TIME * 1000);
|
||||
guard.leavingBridge();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user