pacman/lib/Pellets.cpp

14 lines
244 B
C++
Raw Normal View History

#include "Pellets.hpp"
2021-06-16 11:59:16 +00:00
#include <algorithm>
2021-07-05 12:10:01 +00:00
namespace pacman {
2021-07-07 09:39:09 +00:00
Pellets::Pellets()
2021-07-08 15:42:24 +00:00
: positions(initialPelletPositions()) {}
2021-06-16 11:59:16 +00:00
2021-07-05 11:54:54 +00:00
bool Pellets::eatPelletAtPosition(GridPosition p) {
return std::erase(positions, p) > 0;
2021-06-16 11:59:16 +00:00
}
2021-07-05 12:10:01 +00:00
} // namespace pacman