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 Car(Guard guard) {
        this.guard = guard;
        this.arrivingTime = LocalTime.now();
    }

    @Override
    public void run() {
        try {
            Thread.sleep(crossingTime);
            guard.leaving();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}
