(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
This commit is contained in:
@@ -124,7 +124,7 @@ void AyStar::CheckTile(AyStarNode *current, OpenListNode *parent)
|
||||
/* The f-value if g + h */
|
||||
new_f = new_g + new_h;
|
||||
|
||||
/* Get the pointer to the parent in the ClosedList (the currentone is to a copy of the one in the OpenList) */
|
||||
/* Get the pointer to the parent in the ClosedList (the current one is to a copy of the one in the OpenList) */
|
||||
closedlist_parent = this->ClosedListIsInList(&parent->path.node);
|
||||
|
||||
/* Check if this item is already in the OpenList */
|
||||
|
@@ -64,7 +64,7 @@ struct AyStar;
|
||||
/**
|
||||
* Check whether the end-tile is found.
|
||||
* @param aystar %AyStar search algorithm data.
|
||||
* @param current Node to examone.
|
||||
* @param current Node to exam one.
|
||||
* @note The 2nd parameter should be #OpenListNode, and \em not #AyStarNode. #AyStarNode is
|
||||
* part of #OpenListNode and so it could be accessed without any problems.
|
||||
* The good part about #OpenListNode is, and how AIs use it, that you can
|
||||
|
@@ -100,7 +100,7 @@ static inline void NPFSetFlag(AyStarNode *node, NPFNodeFlag flag, bool value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the minimum distance traveled to get from t0 to t1 when only
|
||||
* Calculates the minimum distance travelled to get from t0 to t1 when only
|
||||
* using tracks (ie, only making 45 degree turns). Returns the distance in the
|
||||
* NPF scale, ie the number of full tiles multiplied by NPF_TILE_LENGTH to
|
||||
* prevent rounding.
|
||||
@@ -145,7 +145,7 @@ static int32 NPFCalcZero(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Calcs the heuristic to the target station or tile. For train stations, it
|
||||
/* Calculates the heuristic to the target station or tile. For train stations, it
|
||||
* takes into account the direction of approach.
|
||||
*/
|
||||
static int32 NPFCalcStationOrTileHeuristic(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
@@ -245,7 +245,7 @@ static uint NPFSlopeCost(AyStarNode *current)
|
||||
}
|
||||
return 0;
|
||||
/* Should we give a bonus for slope down? Probably not, we
|
||||
* could just substract that bonus from the penalty, because
|
||||
* could just subtract that bonus from the penalty, because
|
||||
* there is only one level of steepness... */
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ static int32 NPFFindStationOrTile(AyStar *as, OpenListNode *current)
|
||||
* Find the node containing the first signal on the path.
|
||||
*
|
||||
* If the first signal is on the very first two tiles of the path,
|
||||
* the second signal is returnd. If no suitable signal is present, the
|
||||
* the second signal is returned. If no suitable signal is present, the
|
||||
* last node of the path is returned.
|
||||
*/
|
||||
static const PathNode *FindSafePosition(PathNode *path, const Train *v)
|
||||
@@ -1052,7 +1052,7 @@ static NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir track
|
||||
/* Search using breadth first. Good for little track choice and inaccurate
|
||||
* heuristic, such as railway/road with two start nodes, the second being the reverse. Call
|
||||
* NPFGetFlag(result.node, NPF_FLAG_REVERSE) to see from which node the path
|
||||
* orginated. All pathfs from the second node will have the given
|
||||
* originated. All paths from the second node will have the given
|
||||
* reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full
|
||||
* tile).
|
||||
*/
|
||||
|
@@ -158,7 +158,7 @@ bool BinaryHeap::Delete(void *item, int priority)
|
||||
|
||||
for (;;) {
|
||||
j = i;
|
||||
/* Check if we have 2 childs */
|
||||
/* Check if we have 2 children */
|
||||
if (2 * j + 1 <= this->size) {
|
||||
/* Is this child smaller than the parent? */
|
||||
if (this->GetElement(j).priority >= this->GetElement(2 * j).priority) i = 2 * j;
|
||||
@@ -170,13 +170,13 @@ bool BinaryHeap::Delete(void *item, int priority)
|
||||
if (this->GetElement(j).priority >= this->GetElement(2 * j).priority) i = 2 * j;
|
||||
}
|
||||
|
||||
/* One of our childs is smaller than we are, switch */
|
||||
/* One of our children is smaller than we are, switch */
|
||||
if (i != j) {
|
||||
temp = this->GetElement(j);
|
||||
this->GetElement(j) = this->GetElement(i);
|
||||
this->GetElement(i) = temp;
|
||||
} else {
|
||||
/* None of our childs is smaller, so we stay here.. stop :) */
|
||||
/* None of our children is smaller, so we stay here.. stop :) */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
static const int NPF_TILE_LENGTH = 100;
|
||||
|
||||
/**
|
||||
* This penalty is the equivalent of "infite", which means that paths that
|
||||
* This penalty is the equivalent of "infinite", which means that paths that
|
||||
* get this penalty will be chosen, but only if there is no other route
|
||||
* without it. Be careful with not applying this penalty to often, or the
|
||||
* total path cost might overflow..
|
||||
@@ -33,7 +33,7 @@ static const int YAPF_TILE_LENGTH = 100;
|
||||
static const int YAPF_TILE_CORNER_LENGTH = 71;
|
||||
|
||||
/**
|
||||
* This penalty is the equivalent of "infite", which means that paths that
|
||||
* This penalty is the equivalent of "infinite", which means that paths that
|
||||
* get this penalty will be chosen, but only if there is no other route
|
||||
* without it. Be careful with not applying this penalty to often, or the
|
||||
* total path cost might overflow..
|
||||
|
@@ -34,8 +34,8 @@ extern int _total_pf_time_us;
|
||||
* you need to declare only your node type. Look at test_yapf.h for an example.
|
||||
*
|
||||
*
|
||||
* Requrements to your pathfinder class derived from CYapfBaseT:
|
||||
* -------------------------------------------------------------
|
||||
* Requirements to your pathfinder class derived from CYapfBaseT:
|
||||
* --------------------------------------------------------------
|
||||
* Your pathfinder derived class needs to implement following methods:
|
||||
* inline void PfSetStartupNodes()
|
||||
* inline void PfFollowNode(Node& org)
|
||||
|
@@ -15,7 +15,7 @@
|
||||
/** Base implementation for cost accounting. */
|
||||
struct CYapfCostBase {
|
||||
/**
|
||||
* Does the given track direction on the given tile yeild an uphill penalty?
|
||||
* Does the given track direction on the given tile yield an uphill penalty?
|
||||
* @param tile The tile to check.
|
||||
* @param td The track direction to check.
|
||||
* @return True if there's a slope, otherwise false.
|
||||
|
Reference in New Issue
Block a user