path-info.js
// Return number of turns it takes to walk this path
Return number of turns it takes to walk this path
Return number of turns it takes to walk this path
cost(weightRatio) {
		if (weightRatio === 0) {
			return this.path.length;
		} else {
			return (this.path.length + this.swamps.length * 4) * Math.ceil(weightRatio || 1) - Math.floor(1 / weightRatio) * this.roads.length;
		}
	}
cost ( weightRatio ) { if ( weightRatio === 0 ) { return this . path . length ; } else { return ( this . path . length + this . swamps . length * 4 ) * Math . ceil ( weightRatio || 1 ) - Math . floor ( 1 / weightRatio ) * this . roads . length ; } }
Return number of turns it takes to walk this path
Return number of turns it takes to walk this path