// Models
import { Coordinates } from '../coordinates/coordinates-model';
export class Waypoint {
    constructor() {
        this.id = '';
        this.coordinates = new Coordinates(0, 0);
    }
    ////////////////////////////////////////////////////////////////
    //  Factory
    ////////////////////////////////////////////////////////////////
    /**
     * Create a waypoint
     * @param id
     * @param coordinates
     * @return the created waypoint
     */
    static make(id, coordinates) {
        let waypoint = new Waypoint();
        waypoint.id = id;
        waypoint.coordinates = coordinates;
        return waypoint;
    }
    ////////////////////////////////////////////////////////////////
    // Static Methods
    ////////////////////////////////////////////////////////////////
    /**
     * Convert a waypoint array to a double array of number
     * @param waypoints
     */
    static convertCoordinatesToSimpleArray(waypoints) {
        let array = [];
        waypoints.forEach(waypoint => {
            array.push([waypoint.coordinates.lat, waypoint.coordinates.lon]);
        });
        return array;
    }
}
