2
0
Эх сурвалжийг харах

CPathfinder: rename functions to better represent what they doing

ArseniyShestakov 10 жил өмнө
parent
commit
595deda270

+ 4 - 4
lib/CPathfinder.cpp

@@ -110,7 +110,7 @@ void CPathfinder::calculatePaths()
 				if(cp->layer != i && !isLayerTransitionPossible())
 					continue;
 
-				if(!isMovementPossible())
+				if(!isMovementToDestPossible())
 					continue;
 
 				int cost = gs->getMovementCost(hero, cp->coord, dp->coord, movement);
@@ -138,7 +138,7 @@ void CPathfinder::calculatePaths()
 					dp->turns = turnAtNextTile;
 					dp->theNodeBefore = cp;
 
-					if(checkDestinationTile())
+					if(isMovementAfterDestPossible())
 						mq.push_back(dp);
 				}
 			}
@@ -225,7 +225,7 @@ void CPathfinder::addTeleportExits(bool noTeleportExcludes)
 	}
 }
 
-bool CPathfinder::isMovementPossible()
+bool CPathfinder::isMovementToDestPossible()
 {
 	switch (dp->layer)
 	{
@@ -263,7 +263,7 @@ bool CPathfinder::isMovementPossible()
 	return true;
 }
 
-bool CPathfinder::checkDestinationTile()
+bool CPathfinder::isMovementAfterDestPossible()
 {
 	if(dp->accessible == CGPathNode::ACCESSIBLE)
 		return true;

+ 2 - 2
lib/CPathfinder.h

@@ -105,8 +105,8 @@ private:
 	void addNeighbours(const int3 &coord);
 	void addTeleportExits(bool noTeleportExcludes = false);
 
-	bool isMovementPossible(); //checks if current move will be between sea<->land. If so, checks it legality (returns false if movement is not possible) and sets useEmbarkCost
-	bool checkDestinationTile();
+	bool isMovementToDestPossible(); //checks if current move will be between sea<->land. If so, checks it legality (returns false if movement is not possible) and sets useEmbarkCost
+	bool isMovementAfterDestPossible();
 
 	int3 getSourceGuardPosition();
 	bool isSourceGuarded();