pacman/lib/SuperPellets.cpp

13 lines
334 B
C++
Raw Normal View History

#include "SuperPellets.hpp"
SuperPellets::SuperPellets(const Board & board)
: positions(board.initialSuperPelletPositions()) {}
2021-06-16 11:59:16 +00:00
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;
}