Ex 25: Implement isValidMove().
This commit is contained in:
parent
a8804d096b
commit
b2984adc04
1 changed files with 2 additions and 2 deletions
|
@ -27,8 +27,8 @@ GridPosition PacManAI::pelletClosestToPacman(GridPosition position,
|
||||||
|
|
||||||
// This function is not yet implemented.
|
// This function is not yet implemented.
|
||||||
// You will implement it as part of module 25.
|
// You will implement it as part of module 25.
|
||||||
bool PacManAI::isValidMove(const Move &) {
|
bool PacManAI::isValidMove(const Move & move) {
|
||||||
return false;
|
return isWalkableForPacMan(move.position) && move.direction != oppositeDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is not yet implemented.
|
// This function is not yet implemented.
|
||||||
|
|
Loading…
Reference in a new issue