WME-EntryPoint

Library for Waze Map Editor Greasy Fork scripts

Bu script direkt olarak kurulamaz. Başka scriptler için bir kütüphanedir ve meta yönergeleri içerir // @require https://update.greasyfork.org/scripts/480123/1281900/WME-EntryPoint.js

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         WME EntryPoint
// @version      0.0.1
// @description  Library for Waze Map Editor Greasy Fork scripts
// @license      MIT License
// @author       Anton Shevchuk
// @namespace    https://greasyfork.org/users/227648-anton-shevchuk
// @supportURL   https://github.com/AntonShevchuk/wme-entrypoint/issues
// @match        https://*.waze.com/editor*
// @match        https://*.waze.com/*/editor*
// @exclude      https://*.waze.com/user/editor*
// @icon         https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://anton.shevchuk.name&size=64
// @grant        none
// ==/UserScript==

/* jshint esversion: 8 */

class entryPoint {
  constructor () {
    let {
      point = { type: 'Point', coordinates: [0, 0] },
      entry = true,
      exit = false,
      primary = false,
      name = ''
    } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}

    this._point = point
    this._entry = entry
    this._exit = exit
    this._isPrimary = primary
    this._name = name
  }

  with () {
    let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
    return new entryPoint(Object.assign(this.toJSON(), e))
  }

  getPoint () {
    return this._point
  }

  getEntry () {
    return this._entry
  }

  getExit () {
    return this._exit
  }

  getName () {
    return this._name
  }

  isPrimary () {
    return this._isPrimary
  }

  toJSON () {
    return {
      entry: this._entry,
      exit: this._exit,
      name: this._name,
      point: this._point,
      primary: this._isPrimary
    }
  }

  clone () {
    return this.with()
  }

  equals (e) {
    return this._point.type === e._point.type
      && this._point.coordinates[0] === e._point.coordinates[0]
      && this._point.coordinates[1] === e._point.coordinates[1]
      && this._name === e._name
      && this._isPrimary === e._isPrimary
      && this._entry === e._entry
      && this._exit === e._exit
  }
}