#include "components/HazardComponent.hpp" #include "Entity.hpp" #include "components/ColliderComponent.hpp" void HazardComponent::Setup() { auto selfCollider = entity->GetComponent(); if (!selfCollider) { return; } selfCollider->get().monitoring = true; selfCollider->get().AddCollisionListener([this](Entity &other) { if (!context || !context->probeEntity || &other != context->probeEntity) { return; } // hazards instantly end the run by calling the death callback if (context->onPlayerDeath) { context->onPlayerDeath(); } }); } void HazardComponent::Update(float) {} void HazardComponent::Cleanup() {}