pacman/lib/SuperPellets.cpp
Corentin Jabot f911f6e2a8 Eat pellets
2021-06-16 13:59:16 +02:00

12 lines
334 B
C++

#include "SuperPellets.hpp"
SuperPellets::SuperPellets(const Board & board)
: positions(board.initialSuperPelletPositions()) {}
bool SuperPellets::eatPelletAtPosition(Position p) {
auto it = std::find(positions.begin(), positions.end(), p);
if (it == positions.end())
return false;
positions.erase(it);
return true;
}