pacman/lib/SuperPellets.cpp
2021-06-16 15:31:42 +02:00

13 lines
355 B
C++

#include "SuperPellets.hpp"
#include <algorithm>
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;
}