File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -231,29 +231,29 @@ Graph.prototype.toString = function() {
231
231
rowDebug = "" ;
232
232
row = nodes [ x ] ;
233
233
for ( y = 0 , l = row . length ; y < l ; y ++ ) {
234
- rowDebug += row [ y ] . type + " " ;
234
+ rowDebug += row [ y ] . weight + " " ;
235
235
}
236
236
graphString = graphString + rowDebug + "\n" ;
237
237
}
238
238
return graphString ;
239
239
} ;
240
240
241
- function GridNode ( x , y , type ) {
241
+ function GridNode ( x , y , weight ) {
242
242
this . x = x ;
243
243
this . y = y ;
244
- this . type = type ;
244
+ this . weight = weight ;
245
245
}
246
246
247
247
GridNode . prototype . toString = function ( ) {
248
248
return "[" + this . x + " " + this . y + "]" ;
249
249
} ;
250
250
251
251
GridNode . prototype . getCost = function ( ) {
252
- return this . type ;
252
+ return this . weight ;
253
253
} ;
254
254
255
255
GridNode . prototype . isWall = function ( ) {
256
- return this . type === 0 ;
256
+ return this . weight === 0 ;
257
257
} ;
258
258
259
259
function BinaryHeap ( scoreFunction ) {
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ test( "GPS Pathfinding", function() {
166
166
this . longRad = this . lng * Math . PI / 180 ;
167
167
this . latRad = this . lat * Math . PI / 180 ;
168
168
}
169
- CityNode . prototype . type = 1 ;
169
+ CityNode . prototype . weight = 1 ;
170
170
CityNode . prototype . toString = function ( ) {
171
171
return "[" + this . name + " (" + this . lat + ", " + this . lng + ")]" ;
172
172
} ;
You can’t perform that action at this time.
0 commit comments