import { EntityPathMarkerDefinition } from "./EntityPathMarkerDefinition.js";

export class EntityPathStyle {
    constructor() {

        /**
         *
         * @type {EntityPathMarkerDefinition}
         */
        this.marker_start = null;

        /**
         *
         * @type {EntityPathMarkerDefinition}
         */
        this.marker_end = null;

        /**
         *
         * @type {EntityPathMarkerDefinition}
         */
        this.marker_main = null;

        /**
         * Distance between markers
         * @type {number}
         */
        this.spacing = 1;
    }

    /**
     *
     * @param marker_start
     * @param marker_end
     * @param marker_main
     * @param spacing
     * @param {ModuleRegistry} registry
     */
    fromJSON({ marker_start, marker_end, marker_main, spacing = 1 }, registry) {
        this.marker_start = EntityPathMarkerDefinition.fromJSON(marker_start, registry);
        this.marker_end = EntityPathMarkerDefinition.fromJSON(marker_end, registry);
        this.marker_main = EntityPathMarkerDefinition.fromJSON(marker_main, registry);

        this.spacing = spacing;
    }
}
