package UE21_290425_Bruecke;

import java.time.LocalTime;

public class Car extends Thread {
    public Long index;
    public LocalTime arrivingTime;
    public 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(Variables.CROSSING_TIME);
            guard.leaving();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}
