#ifndef GOOMBA_VISITOR_H #define GOOMBA_VISITOR_H #include "../../sdlpp/sdlpp_visitor.hpp" #include "../../sdlpp/sdlpp_geometry.hpp" #include "../../sdlpp/sdlpp_scene.hpp" #include "../blocks.hpp" class GoombaVisitor : public SDLPP::Visitor { public: GoombaVisitor() = delete; GoombaVisitor(const SDLPP::Vec2D &pos) : goomba_pos(pos) {} void visit(const SDLPP::RenderObject &obj) override; bool isOnGround() const { return onGround; } bool isDead() const { return death; } bool instantDeath() const { return instant_death; } void setFromId(uint64_t id) override { from = id; } void setVisitorType(uint64_t type) override { _type = type; } uint64_t getVisitorType() const override { return _type; } uint64_t getFromId() const override { return from; } bool canGoLeft() const { return !left; } bool canGoRight() const { return !right; } double getGroundY() const { return groundY; } bool topBlock() const { return top_hit; } const SDLPP::Vec2D &getMovementBlockage() { return movement_blockage; } double getValidXPos() const { return validXPos; } bool shouldBounce() { return bounce; } private: bool onGround = false; double groundY = 0; uint64_t _type{}; bool death = false; bool instant_death = false; bool bounce = false; uint64_t from = -1; bool left = false; bool right = false; bool top_hit = false; SDLPP::Vec2D movement_blockage; double validXPos = 0; const SDLPP::Vec2D goomba_pos; }; #endif