mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
CPathfinder: rename functions to better represent what they doing
This commit is contained in:
parent
dfd70849e9
commit
595deda270
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user