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