26 explicit FlappyDebugSystem(
const std::shared_ptr<eng::IRenderer> &renderer,
bool &showDebug)
41 for (
const auto &[key, hitboxComponent] : circleShapes)
51 if (texture && (texture->id.find(
"pipe") != std::string::npos))
60 if ((transform ==
nullptr) || (hitbox ==
nullptr))
65 const float hitboxX = transform->x + hitbox->offsetX - hitbox->radius;
66 const float hitboxY = transform->
y + hitbox->offsetY - hitbox->radius;
68 const std::string circleName =
"hitbox_" + std::to_string(key);
77 catch (
const std::runtime_error &)
This file contains the component definitions.
This file contains the IRenderer class declaration.
This file contains the Registry class declaration.
Abstract class for system.
Class for managing entities and their components.
bool hasComponent(Entity e)
std::unordered_map< Entity, T > & getAll()
T * getComponent(Entity e)
virtual void drawCircleShape(const std::string &name)=0
virtual void setCircleShapePosition(const std::string &name, float x, float y)=0
Class for FlappyBird debug system that excludes pipes from circle hitbox display.
FlappyDebugSystem(FlappyDebugSystem &&)=delete
FlappyDebugSystem & operator=(const FlappyDebugSystem &)=delete
FlappyDebugSystem(const FlappyDebugSystem &)=delete
FlappyDebugSystem(const std::shared_ptr< eng::IRenderer > &renderer, bool &showDebug)
FlappyDebugSystem & operator=(const FlappyDebugSystem &&)=delete
const std::shared_ptr< eng::IRenderer > & m_renderer
void update(ecs::Registry ®istry, float) override
~FlappyDebugSystem() override=default