Make better parameter names
This commit is contained in:
parent
433f0a4496
commit
60774761f5
2 changed files with 4 additions and 4 deletions
|
@ -63,11 +63,11 @@ bool isWalkableForPacMan(GridPosition point) {
|
|||
return cellAtPosition(point) != Cell::wall && cellAtPosition(point) != Cell::pen;
|
||||
}
|
||||
|
||||
bool isWalkableForGhost(GridPosition point, GridPosition origin, bool isEyes) {
|
||||
const Cell cell = cellAtPosition(point);
|
||||
bool isWalkableForGhost(GridPosition target_position, GridPosition current_position, bool isEyes) {
|
||||
const Cell cell = cellAtPosition(target_position);
|
||||
if (cell == Cell::wall)
|
||||
return false;
|
||||
return isEyes || isInPen(origin) || !isInPen(point);
|
||||
return isEyes || isInPen(current_position) || !isInPen(target_position);
|
||||
}
|
||||
|
||||
bool isInPen(GridPosition point) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
namespace pacman {
|
||||
|
||||
bool isWalkableForPacMan(GridPosition point);
|
||||
bool isWalkableForGhost(GridPosition point, GridPosition origin, bool isEyes);
|
||||
bool isWalkableForGhost(GridPosition target_position, GridPosition current_position, bool isEyes);
|
||||
bool isInPen(GridPosition point);
|
||||
bool isPortal(GridPosition point, Direction direction);
|
||||
bool isIntersection(GridPosition point);
|
||||
|
|
Loading…
Reference in a new issue