diff --git a/src/routing-result.js b/src/routing-result.js index 4521642..6c75c75 100644 --- a/src/routing-result.js +++ b/src/routing-result.js @@ -2,62 +2,62 @@ //export {RoutingResult as default}; export default class RoutingResult{ - #foundPath=[]; - #traversedCountries=[]; - #isClosest=false; + _foundPath=[]; + _traversedCountries=[]; + _isClosest=false; - #fromCountryCode=''; - #toCountryCode=''; + _fromCountryCode=''; + _toCountryCode=''; get isClosest() { - return this.#isClosest; + return this._isClosest; } set isClosest(value) { - this.#isClosest = value; + this._isClosest = value; } get traversedCountries() { - return this.#traversedCountries; + return this._traversedCountries; } get fromCountryCode() { - return this.#fromCountryCode; + return this._fromCountryCode; } get toCountryCode() { - return this.#toCountryCode; + return this._toCountryCode; } getFoundPath() { //TODO: foundPath elements should be a class instance! - return this.#foundPath; + return this._foundPath; } prependToFoundPath(foundPathEntry){ //TODO: this is not used sufficiently, use it wherever you can - this.#foundPath=[foundPathEntry,...this.#foundPath]; + this._foundPath=[foundPathEntry,...this._foundPath]; } appendToFoundPath(foundPathEntry){ - this.#foundPath.push(foundPathEntry); + this._foundPath.push(foundPathEntry); } get pathDistance() { - return this.#foundPath.reduce((n, {distanceBetweenNode}) => n + distanceBetweenNode, 0); + return this._foundPath.reduce((n, {distanceBetweenNode}) => n + distanceBetweenNode, 0); } get pathCountryCount() { - return this.#foundPath.length; + return this._foundPath.length; } constructor(foundPath, traversedCountries, fromCountryCode, toCountryCode) { - this.#foundPath = foundPath; - this.#traversedCountries = traversedCountries; - this.#fromCountryCode = fromCountryCode; - this.#toCountryCode = toCountryCode; + this._foundPath = foundPath; + this._traversedCountries = traversedCountries; + this._fromCountryCode = fromCountryCode; + this._toCountryCode = toCountryCode; } diff --git a/src/traverse-country-node/traverse-country-node.js b/src/traverse-country-node/traverse-country-node.js index 1cb5ff4..fc543cf 100644 --- a/src/traverse-country-node/traverse-country-node.js +++ b/src/traverse-country-node/traverse-country-node.js @@ -3,22 +3,22 @@ import Utils from "../utils.js"; export class CountryNode { - #countryCode; - #attributes; + _countryCode; + _attributes; constructor(countryCode, attributes) { - this.#countryCode = countryCode; - this.#attributes = attributes; + this._countryCode = countryCode; + this._attributes = attributes; } get countryCode() { - return this.#countryCode; + return this._countryCode; } get attributes() { - return this.#attributes; + return this._attributes; } isSameCountryNode(targetCountryNode){ @@ -45,23 +45,23 @@ export class CountryNode { export class TraverseCountryNode extends CountryNode { - #distanceToFinalDestination;//TODO: this can be handled here. Consider. + _distanceToFinalDestination;//TODO: this can be handled here. Consider. - #distanceBetweenNode; + _distanceBetweenNode; constructor(countryCode, attributes, distanceToFinalDestination, distanceBetweenNode) { super(countryCode,attributes); - this.#distanceToFinalDestination = distanceToFinalDestination; - this.#distanceBetweenNode = distanceBetweenNode; + this._distanceToFinalDestination = distanceToFinalDestination; + this._distanceBetweenNode = distanceBetweenNode; } get distanceToFinalDestination() { - return this.#distanceToFinalDestination; + return this._distanceToFinalDestination; } get distanceBetweenNode() { - return this.#distanceBetweenNode; + return this._distanceBetweenNode; }