Remove pacman::

This commit is contained in:
Patricia Aas 2021-07-28 15:41:32 +02:00
parent 71cb40ad18
commit 79b78f7dc0
5 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@
namespace pacman {
Blinky::Blinky()
: Ghost(Atlas::Ghost::blinky, pacman::initialBlinkyPosition()) {
: Ghost(Atlas::Ghost::blinky, initialBlinkyPosition()) {
}
double Blinky::speed(const GameState & gameState) const {
@ -19,7 +19,7 @@ Position Blinky::target(const GameState & gameState) const {
return startingPosition;
if (isInPen())
return pacman::penDoorPosition();
return penDoorPosition();
return blinkyScatterTarget();
}

View File

@ -152,7 +152,7 @@ void Ghost::updateDirection(const GameState & gameState) {
continue;
const GridPosition grid_position = { size_t(move.position.x), size_t(move.position.y) };
const bool can_walk = pacman::isWalkableForGhost(grid_position, current_grid_position, isEyes());
const bool can_walk = isWalkableForGhost(grid_position, current_grid_position, isEyes());
if (!can_walk)
continue;

View File

@ -3,7 +3,7 @@
namespace pacman {
Inky::Inky()
: Ghost(Atlas::Ghost::inky, pacman::initialInkyPosition()) {
: Ghost(Atlas::Ghost::inky, initialInkyPosition()) {
}
double Inky::speed(const GameState & gameState) const {
@ -19,7 +19,7 @@ Position Inky::target(const GameState & gameState) const {
return startingPosition;
if (isInPen())
return pacman::penDoorPosition();
return penDoorPosition();
return inkyScatterTarget();
}

View File

@ -25,7 +25,7 @@ void PacMan::reset() {
dead = false;
direction = Direction::NONE;
desired_direction = Direction::NONE;
pos = pacman::initialPacManPosition();
pos = initialPacManPosition();
}
void PacMan::update(std::chrono::milliseconds time_delta, Direction input_direction) {
@ -76,7 +76,7 @@ void PacMan::updateMazePosition(std::chrono::milliseconds time_delta) {
};
auto canGo = [&](Direction move_direction) {
return pacman::isWalkableForPacMan(moveToPosition(pos, move_direction));
return isWalkableForPacMan(moveToPosition(pos, move_direction));
};
if (canGo(desired_direction)) {

View File

@ -3,7 +3,7 @@
namespace pacman {
Pinky::Pinky()
: Ghost(Atlas::Ghost::speedy, pacman::initialSpeedyPosition()) {
: Ghost(Atlas::Ghost::speedy, initialSpeedyPosition()) {
}
double Pinky::speed(const GameState & gameState) const {
@ -19,7 +19,7 @@ Position Pinky::target(const GameState & gameState) const {
return startingPosition;
if (isInPen())
return pacman::penDoorPosition();
return penDoorPosition();
return speedyScatterTarget();
}