package nav;

import general.Vector;

/**
 *
 * @author jkjolhed
 */
public class FlightEntry extends Position {

    public final double time;   // real time in seconds
    public final int ID, coalitionID; // Lo world ID and recording time

    public FlightEntry(Vector<String> lines, int lineIndex) {
        super(Double.valueOf(lines.get(lineIndex + 1)).doubleValue() * toDegree,
                Double.valueOf(lines.get(lineIndex + 2)).doubleValue(),
                Double.valueOf(lines.get(lineIndex + 3)).doubleValue(),
                Double.valueOf(lines.get(lineIndex + 4)).doubleValue());
        time = (double) (System.currentTimeMillis()) / 1000;
        coalitionID = Integer.valueOf(lines.get(lineIndex + 5));
        ID = Integer.valueOf(lines.get(lineIndex + 6));
    }

    public FlightEntry(double heading, double lat, double lon, double alt,
            double time, int ID, int coalitionID) {
        super(heading, lat, lon, alt);
        this.time = time;
        this.ID = ID;
        this.coalitionID = coalitionID;
    }
    public static final FlightEntry defaultEntry = new FlightEntry();

    private FlightEntry() {
        super(Position.headingD, Position.latD, Position.lonD, Position.altD);
        time = 0;
        coalitionID = 0;
        ID = 0;
    }

    public FlightEntry(final FlightEntry old) {
        super(old);
        this.time = old.time;
        this.coalitionID = old.coalitionID;
        this.ID = old.ID;
    }

    public FlightEntry(final double hNew, final FlightEntry old) {
        super(old,hNew);
        this.time = old.time;
        this.coalitionID = old.coalitionID;
        this.ID = old.ID;
    }

    public FlightEntry(final FlightEntry old, final double tNew) {
        super(old);
        this.time = tNew;
        this.coalitionID = old.coalitionID;
        this.ID = old.ID;
    }

    public FlightEntry(final FlightEntry old, final double lat, final double lon) {
        super(old, lat, lon);
        this.time = old.time;
        this.coalitionID = old.coalitionID;
        this.ID = old.ID;
    }

}
