| 215 | } |
| 216 | |
| 217 | void collide(ex::EventManager &events) { |
| 218 | for (const std::vector<Candidate> &candidates : grid) { |
| 219 | for (const Candidate &left : candidates) { |
| 220 | for (const Candidate &right : candidates) { |
| 221 | if (left.entity == right.entity) continue; |
| 222 | if (collided(left, right)) |
| 223 | events.emit<CollisionEvent>(left.entity, right.entity); |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | float length(const sf::Vector2f &v) { |
| 230 | return std::sqrt(v.x * v.x + v.y * v.y); |
nothing calls this directly
no outgoing calls
no test coverage detected