package nl.sbdeveloper.themeparkplus.api.objects;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.bukkit.Location;

import java.util.ArrayList;
import java.util.List;

@NoArgsConstructor @AllArgsConstructor
public class WaitingRow {
    @Getter @Setter private String rideID;
    @Getter @Setter private String regionID;
    @Getter @Setter private transient int waitingPlayers = 0;
    @Getter private transient double waitingTimeMinutes = 0;
    private final List<Location> signLocations = new ArrayList<>();

    public WaitingRow(String rideID, String regionID) {
        this.rideID = rideID;
        this.regionID = regionID;
    }

    public List<Location> getSignLocations() {
        return signLocations;
    }

    public void addSignLocation(Location loc) {
        this.signLocations.add(loc);
    }

    public void removeSignLocation(Location loc) {
        this.signLocations.remove(loc);
    }

    public void setWaitingTimeMinutes(double waitingTimeMinutes) {
        if (waitingTimeMinutes < 0) return;
        this.waitingTimeMinutes = waitingTimeMinutes;
    }
}
