refactor bubble
This commit is contained in:
@@ -91,7 +91,7 @@ void Aquarium::redraw() {
|
||||
auto &bubble = *it;
|
||||
bubble->draw();
|
||||
bubble->update();
|
||||
if (bubble->getY() < 9)
|
||||
if (bubble->isOutOfWater())
|
||||
it = bubbles.erase(it);
|
||||
else
|
||||
++it;
|
||||
@@ -137,7 +137,7 @@ void Aquarium::redraw() {
|
||||
applyBackBuffer();
|
||||
}
|
||||
|
||||
void Aquarium::addBubble(float x, float y) {
|
||||
void Aquarium::addBubble(size_t x, size_t y) {
|
||||
bubbles.emplace_back(std::make_unique<Bubble>(x, y));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user