game/mario/visitors/bounce_visitor.cpp

18 lines
380 B
C++
Raw Normal View History

#include "bounce_visitor.hpp"
#include "../../sdlpp/sdlpp_renderobject.hpp"
#include "../objectids.hpp"
2021-10-18 08:10:43 +00:00
void BounceVisitor::visit(const SDLPP::RenderObject &obj) {
auto id = obj.getId();
2021-10-18 08:10:43 +00:00
switch (id) {
case FLOOR_ID:
case BRICK_ID:
case BRICK_TOP_ID:
2021-10-18 08:10:43 +00:00
if (from == BOUNCE_COLLISION) {
hits += 1;
}
default:
break;
}
}