2020-11-28 13:10:25 +00:00
|
|
|
#include "SuperPellets.hpp"
|
2021-06-16 13:31:42 +00:00
|
|
|
#include <algorithm>
|
2020-11-28 13:10:25 +00:00
|
|
|
|
2021-06-16 10:52:04 +00:00
|
|
|
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;
|
|
|
|
}
|