game/mario/visitors/bounce_visitor.hpp
zv0n 0d855ed218
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
Mario: formatting
2021-10-18 10:10:43 +02:00

35 lines
714 B
C++

#ifndef BOUNCE_VISITOR_HPP
#define BOUNCE_VISITOR_HPP
#include "../../sdlpp/sdlpp_visitor.hpp"
#include "../../sdlpp/sdlpp_geometry.hpp"
class BounceVisitor : public SDLPP::Visitor {
public:
BounceVisitor() = default;
void visit(const SDLPP::RenderObject &obj) override;
void setFromId(uint64_t id) override {
from = id;
}
uint64_t getFromId() const override {
return from;
}
void setVisitorType(uint64_t type) override {
_type = type;
}
uint64_t getVisitorType() const override {
return _type;
}
bool canBounce() const {
return hits < 2;
}
private:
int hits = 0;
uint64_t from{};
uint64_t _type{};
};
#endif