2021-08-04 22:32:17 +00:00
|
|
|
#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) {
|
2021-08-04 22:32:17 +00:00
|
|
|
auto id = obj.getId();
|
2021-10-18 08:10:43 +00:00
|
|
|
switch (id) {
|
2021-08-04 22:32:17 +00:00
|
|
|
case FLOOR_ID:
|
|
|
|
case BRICK_ID:
|
|
|
|
case BRICK_TOP_ID:
|
2021-10-18 08:10:43 +00:00
|
|
|
if (from == BOUNCE_COLLISION) {
|
2021-08-04 22:32:17 +00:00
|
|
|
hits += 1;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|